summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2011-06-07 23:49:49 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2011-06-07 23:49:49 +0200
commit942066bc4a311355ff3c4424aadbb3b78d1263f5 (patch)
treea40f1fee5742c5e473663306147db173eb6b2c96
parent79148ce33b760079adba5af43f35ceb72149df87 (diff)
downloadbuildscripts-942066bc4a311355ff3c4424aadbb3b78d1263f5.tar.gz
buildscripts-942066bc4a311355ff3c4424aadbb3b78d1263f5.tar.bz2
buildscripts-942066bc4a311355ff3c4424aadbb3b78d1263f5.zip
allow to create tarball releases of old Git tags
-rwxr-xr-xbin/x2go-tarballrelease5
1 files changed, 4 insertions, 1 deletions
diff --git a/bin/x2go-tarballrelease b/bin/x2go-tarballrelease
index d3d3d7c..5103977 100755
--- a/bin/x2go-tarballrelease
+++ b/bin/x2go-tarballrelease
@@ -22,7 +22,9 @@
set -e
RELEASE="$1"
-test -n "$RELEASE" || { echo "usage: $(basename "$0") <release-version>"; exit 1; }
+test -n "$RELEASE" || { echo "usage: $(basename "$0") <release-version> [<checkout>]"; exit 1; }
+
+CHECKOUT="${2:-master}"
PROJECT="$(basename $PWD)"
TARGETDIR=".."
@@ -34,6 +36,7 @@ echo $MANIFEST
trap "rm -f \"${MANIFEST}\"; rm -rf \"${TEMP_DIR}\"" 0
git clone . "$TEMP_DIR/${PROJECT}_$RELEASE"
+( set -e; cd "$TEMP_DIR/${PROJECT}_$RELEASE/" && git checkout ${CHECKOUT} 2>/dev/null || true )
( set -e; cd "$TEMP_DIR" && rm -Rf "${PROJECT}_$RELEASE/.git"* )
( set -e; cd "$TEMP_DIR" && find "${PROJECT}_$RELEASE" -type f | sed 's/^\.*\/*//' | sort > "$MANIFEST" )
tar c -C "$TEMP_DIR" --owner 0 --group 0 --numeric-owner --no-recursion --files-from "$MANIFEST" | gzip -n > "$TARGETDIR/${PROJECT}_$RELEASE.tar.gz"