From 2e964c8bb813fd390adeb71eb2baa951a2857f25 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Fri, 15 Dec 2017 12:33:27 -0600 Subject: [PATCH] Added tag checking to make-tar.sh Modified the default values for filename and tar prefix. Also allows omitting the leading 'R' from a tag-name, so it will not be included in the generated default filename and prefix values. The combination of these changes is that it is now possible to make a standard release tarfile just by running 'make-tar.sh 7.0.1.1'. --- .ci/make-tar.sh | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/.ci/make-tar.sh b/.ci/make-tar.sh index 11778f7b6..370968545 100755 --- a/.ci/make-tar.sh +++ b/.ci/make-tar.sh @@ -18,23 +18,34 @@ then cat <&2 usage: $0 [rev] [outfile.tar.gz] [prefix/] - "" may be any git revision spec. (tag, branch, or commit id). + may be any git revision spec. (tag, branch, or commit id). Output file may be .tar.gz, .tar.bz2, or any extension supported by "tar -a". - If output file name is omitted, then ".tar.gz" is the default. - If prefix is omitted, then the default is "/". + If output file name is omitted, "base-.tar.gz" will be used. + If is omitted, the default prefix is "base-/". EOF exit 1 fi -[ "$FINALTAR" ] || FINALTAR="$TOPREV.tar.gz" -[ "$PREFIX" ] || PREFIX="$TOPREV/" +[ "$FINALTAR" ] || FINALTAR="base-$TOPREV.tar.gz" +[ "$PREFIX" ] || PREFIX="base-$TOPREV/" case "$PREFIX" in */) ;; *) die "Prefix must end with '/'";; esac +# Check for both and R +if ! [ `git tag -l $TOPREV` ] +then + if [ `git tag -l R$TOPREV` ] + then + TOPREV="R$TOPREV" + else + die "No tags exist '$TOPREV' or 'R$TOPREV'" + fi +fi + # temporary directory w/ automatic cleanup TDIR=`mktemp -d` trap 'rm -rf "$TDIR"' EXIT INT QUIT TERM