[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnunet] branch master updated: make version info robust w.r.t. sparse g
From: |
gnunet |
Subject: |
[gnunet] branch master updated: make version info robust w.r.t. sparse git checkouts |
Date: |
Wed, 15 Mar 2023 11:12:39 +0100 |
This is an automated email from the git hooks/post-receive script.
dold pushed a commit to branch master
in repository gnunet.
The following commit(s) were added to refs/heads/master by this push:
new 1677379a3 make version info robust w.r.t. sparse git checkouts
1677379a3 is described below
commit 1677379a3c3608374b9a8e70ff12afdfa63b4c76
Author: Florian Dold <florian@dold.me>
AuthorDate: Wed Mar 15 11:11:45 2023 +0100
make version info robust w.r.t. sparse git checkouts
---
contrib/get_version.sh | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/contrib/get_version.sh b/contrib/get_version.sh
index 6e3ab5141..00f418f3c 100755
--- a/contrib/get_version.sh
+++ b/contrib/get_version.sh
@@ -1,18 +1,18 @@
#!/bin/sh
# Gets the version number from git, or from the contents of .version
VERSION=
-if test -f ".version"
-then
+if test -f ".version"; then
VERSION=$(cat .version)
fi
-if [ -e ./.git ]
-then
- VERSION=$(git describe --tags)
- VERSION=${VERSION#v}
- echo $VERSION > .version
+if [ -e ./.git ]; then
+ # With sparse checkouts, we have a .git dir but possibly no tags
+ gitver=$(git describe --tags 2>/dev/null || echo no-git-version)
+ if test "$gitver" != "no-git-version"; then
+ VERSION=${gitver#v}
+ echo "$VERSION" > .version
+ fi
fi
-if test "x$VERSION" = "x"
-then
+if test "x$VERSION" = "x"; then
VERSION="unknown"
fi
case $1 in
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnunet] branch master updated: make version info robust w.r.t. sparse git checkouts,
gnunet <=