mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-30 22:15:20 +00:00
use shorthash to avoid race when using a branch name
(cherry picked from commit fe35097681
)
This commit is contained in:
32
util/kit.sh
32
util/kit.sh
@@ -77,21 +77,6 @@ cd $tmpdir || {
|
|||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
verdir=bind9-kit.$$
|
|
||||||
mkdir $verdir || {
|
|
||||||
echo "$0: could not create directory $tmpdir/$verdir" >&2
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
git archive --format=tar $remote $tag version | ( cd $verdir ;tar xf - )
|
|
||||||
test -f $verdir/version || {
|
|
||||||
echo "$0: could not get 'version' file" >&2
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
. $verdir/version
|
|
||||||
|
|
||||||
rm $verdir/version
|
|
||||||
rmdir $verdir
|
|
||||||
|
|
||||||
shorthash=`git ls-remote $repo refs/heads/$tag | cut -c1-7`
|
shorthash=`git ls-remote $repo refs/heads/$tag | cut -c1-7`
|
||||||
if [ -z "$shorthash" ]; then
|
if [ -z "$shorthash" ]; then
|
||||||
shorthash=`git ls-remote $repo refs/tags/$tag | cut -c1-7`
|
shorthash=`git ls-remote $repo refs/tags/$tag | cut -c1-7`
|
||||||
@@ -101,6 +86,21 @@ if [ -z "$shorthash" ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
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 - )
|
||||||
|
test -f $verdir/version || {
|
||||||
|
echo "$0: could not get 'version' file" >&2
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
. $verdir/version
|
||||||
|
|
||||||
|
rm $verdir/version
|
||||||
|
rmdir $verdir
|
||||||
|
|
||||||
if $snapshot
|
if $snapshot
|
||||||
then
|
then
|
||||||
RELEASETYPE=s
|
RELEASETYPE=s
|
||||||
@@ -120,7 +120,7 @@ test ! -d $topdir || {
|
|||||||
|
|
||||||
mkdir $topdir || exit 1
|
mkdir $topdir || exit 1
|
||||||
|
|
||||||
git archive --format=tar $remote $tag | ( cd $topdir; tar xf -)
|
git archive --format=tar $remote $shorthash | ( cd $topdir; tar xf -)
|
||||||
|
|
||||||
cd $topdir || exit 1
|
cd $topdir || exit 1
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user