use shorthash to identify snapshots

This commit is contained in:
Mark Andrews
2013-11-26 06:18:41 +00:00
parent 08a1e53c73
commit aa5cb9ad91

View File

@@ -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