aboutsummaryrefslogtreecommitdiff
path: root/system/sdl-jstest/git2tarxz.sh
diff options
context:
space:
mode:
Diffstat (limited to 'system/sdl-jstest/git2tarxz.sh')
-rw-r--r--system/sdl-jstest/git2tarxz.sh11
1 files changed, 6 insertions, 5 deletions
diff --git a/system/sdl-jstest/git2tarxz.sh b/system/sdl-jstest/git2tarxz.sh
index 627abe3e96..85acbc65b6 100644
--- a/system/sdl-jstest/git2tarxz.sh
+++ b/system/sdl-jstest/git2tarxz.sh
@@ -2,8 +2,7 @@
# Create source tarball from sdl-jstest git repo, with generated version
# number. Since the build expects to have the git log available (for
-# embedding the git hash in --version output), don't rm -rf .git,
-# but do use --depth 1 when cloning.
+# embedding the git hash in --version output), don't rm -rf .git.
# Note that this script doesn't need to be run as root. It does need to
# be able to write to the current directory it's run from.
@@ -12,13 +11,13 @@
# tarball of. With no arg, HEAD is used.
PRGNAM=sdl-jstest
-CLONE_URL=https://gitlab.com/$PRGNAM/$PRGNAM.git
+CLONE_URL=https://github.com/Grumbel/sdl-jstest
set -e
GITDIR=$( mktemp -dt $PRGNAM.git.XXXXXX )
rm -rf $GITDIR
-git clone --depth 1 $CLONE_URL $GITDIR
+git clone $CLONE_URL $GITDIR
CWD="$( pwd )"
cd $GITDIR
@@ -33,7 +32,9 @@ GIT_SHA=$( git rev-parse --short HEAD )
DATE=$( git log --date=format:%Y%m%d --format=%cd | head -1 )
-VERSION=${DATE}_${GIT_SHA}
+V=$( git tag --sort=v:refname | tail -1 | sed 's,^v,,' )
+
+VERSION=${V}+${DATE}_${GIT_SHA}
mv .git .keep.git
find . -name .git\* -print0 | xargs -0 rm -rf