This allows building Debian packages from future release tarballs which lack a .git directory. Also, fix a spelling error while we're at it. Signed-off-by: Eric Wong <e@xxxxxxxxx> --- make-debs.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/make-debs.sh b/make-debs.sh index 0913c47..867612b 100755 --- a/make-debs.sh +++ b/make-debs.sh @@ -39,7 +39,12 @@ orgfile=$(echo $outfile | tr '-' '_') # Prepare source code cp -arf ${dirname}/${basename} ${releasedir}/${outfile} cd ${releasedir}/${outfile} -git clean -dxf +if git clean -dxf +then + rm -rf .git +else # building from unpacked tarball + make clean +fi # Change changelog if it's needed cur_ver=$(sed -n -e '1s/.* (\(.*\)) .*/\1/p' debian/changelog) @@ -47,7 +52,7 @@ if [ "$cur_ver" != "$version-1" ]; then dch -D $codename --force-distribution -b -v "$version-1" "new version" fi -# Create tar archieve +# Create tar archive cd ../ tar cvzf ${outfile}.tar.gz ${outfile} ln -s ${outfile}.tar.gz ${orgfile}.orig.tar.gz