diff options
author | Thomas Habets <thomas@habets.se> | 2012-12-29 15:17:31 +0000 |
---|---|---|
committer | Thomas Habets <thomas@habets.se> | 2012-12-29 15:18:02 +0000 |
commit | 935283b3379e0ec45feda29fa42ff26624d0a775 (patch) | |
tree | 75f558e06b2c55e876cc534db99824b6cc82ed3d | |
parent | b3742a85a70ab6d20fea978c8a790861eeb2493c (diff) | |
download | arping-935283b3379e0ec45feda29fa42ff26624d0a775.tar.gz |
Fix mktarball script for non-tags
-rwxr-xr-x | extra/mktarball | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/extra/mktarball b/extra/mktarball index 295e1c1..986c3c6 100755 --- a/extra/mktarball +++ b/extra/mktarball @@ -4,17 +4,21 @@ set -e VERSION="$1" -if [ "$VERSION" == "" ]; then +if [ x"$VERSION" = x"" ]; then echo "Usage: $0 <version>" echo echo " Example: $0 arping-2.11" exit 1 fi -if [ "$VERSION" == "latest" ]; then +if [ x"$VERSION" = x"latest" ]; then VERSION="$(git tag | tail -1)" fi +if [ x"$VERSION" = x"HEAD" ]; then + VERSION="$(git describe)" +fi + OUTPUT="$VERSION.tar.gz" echo "Writing $OUTPUT" @@ -26,6 +30,7 @@ TMPDIR="$(mktemp -d)" mkdir "$VERSION" cd "$VERSION" git init + git fetch "$GITDIR" git fetch --tags "$GITDIR" git checkout "$VERSION" rm -fr .git |