]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
use full tag with git archive
authorMark Andrews <marka@isc.org>
Thu, 24 Mar 2016 06:03:03 +0000 (17:03 +1100)
committerMark Andrews <marka@isc.org>
Thu, 24 Mar 2016 06:03:50 +0000 (17:03 +1100)
(cherry picked from commit 32a09f01d61ce2fb963370b51e328a7b54c3ad27)

util/kit.sh

index b7adb0a8d0112657752cad15df11256def5d9c3e..92ec411a39b06f01f82bca8f4a3310e93da55032 100644 (file)
@@ -77,21 +77,22 @@ cd $tmpdir || {
        exit 1
 }
 
-shorthash=`git ls-remote $repo refs/heads/$tag | cut -c1-7`
-if [ -z "$shorthash" ]; then
-        shorthash=`git ls-remote $repo refs/tags/$tag | cut -c1-7`
+hash=`git ls-remote $repo refs/heads/$tag | awk '{print $1}'`
+if [ -z "$hash" ]; then
+        hash=`git ls-remote $repo refs/tags/$tag | awk '{print $1}'`
 fi
-if [ -z "$shorthash" ]; then
+if [ -z "$hash" ]; then
         echo "Unable to determine hash for $tag, aborting."
         exit 1
 fi
+shorthash=`echo $hash | cut -c1-7`
 
 verdir=bind9-kit.$$
 mkdir $verdir || {
     echo "$0: could not create directory $tmpdir/$verdir" >&2
     exit 1
 }
-git archive --format=tar $remote $shorthash version | ( cd $verdir ;tar xf - )
+git archive --format=tar $remote $hash version | ( cd $verdir ;tar xf - )
 test -f $verdir/version || {
     echo "$0: could not get 'version' file" >&2
     exit 1
@@ -120,7 +121,7 @@ test ! -d $topdir || {
 
 mkdir $topdir || exit 1
 
-git archive --format=tar $remote $shorthash | ( cd $topdir; tar xf -)
+git archive --format=tar $remote $hash | ( cd $topdir; tar xf -)
 
 cd $topdir || exit 1