use shorthash to identify snapshots
This commit is contained in:
30
util/kit.sh
30
util/kit.sh
@@ -92,21 +92,19 @@ test -f $verdir/version || {
|
||||
rm $verdir/version
|
||||
rmdir $verdir
|
||||
|
||||
shorthash=`git ls-remote $repo refs/heads/$tag | cut -c1-8`
|
||||
if [ -z "$shorthash" ]; then
|
||||
shorthash=`git ls-remote $repo refs/tags/$tag | cut -c1-8`
|
||||
fi
|
||||
if [ -z "$shorthash" ]; then
|
||||
echo "Unable to determine hash for $tag, aborting."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if $snapshot
|
||||
then
|
||||
set `date -u +'%Y%m%d%H%M%S %Y/%m/%d %H:%M:%S UTC'`
|
||||
dstamp=$1
|
||||
RELEASETYPE=s
|
||||
RELEASEVER=${dstamp}${releasetag}
|
||||
shift
|
||||
case $tag in
|
||||
master)
|
||||
tag="$@"
|
||||
;;
|
||||
*)
|
||||
tag="$@"
|
||||
;;
|
||||
esac
|
||||
RELEASEVER=${shorthash}
|
||||
fi
|
||||
|
||||
version=${MAJORVER}.${MINORVER}${PATCHVER:+.}${PATCHVER}${RELEASETYPE}${RELEASEVER}${EXTENSIONS}
|
||||
@@ -123,14 +121,6 @@ test ! -d $topdir || {
|
||||
mkdir $topdir || exit 1
|
||||
|
||||
git archive --format=tar $remote $tag | ( cd $topdir; tar xf -)
|
||||
shorthash=`git ls-remote $repo refs/heads/$tag | cut -c1-8`
|
||||
if [ -z "$shorthash" ]; then
|
||||
shorthash=`git ls-remote $repo refs/tags/$tag | cut -c1-8`
|
||||
fi
|
||||
if [ -z "$shorthash" ]; then
|
||||
echo "Unable to determine hash for $tag, aborting."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd $topdir || exit 1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user