From 19dd25c71cdbd21987e9ce21ed3929999bef84a0 Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Mon, 16 Oct 2023 16:57:09 +0200 Subject: [PATCH] Get the SHA1 when no tag is present The 'git describe' command finds the most recent tag instead of the SHA1. When trying to build from a repository without any tags, for example in a fork, this causes the build to fail. Use the '--always' option to fallback to the SHA1 in case no tag is present. Signed-off-by: Jef Driesen --- packaging/windows/mxe-based-build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/windows/mxe-based-build.sh b/packaging/windows/mxe-based-build.sh index 2d2559984..3a9380767 100755 --- a/packaging/windows/mxe-based-build.sh +++ b/packaging/windows/mxe-based-build.sh @@ -177,7 +177,7 @@ if [ "$MXEBUILDTYPE" = "x86_64-w64-mingw32.shared" ] ; then fi cd "$BUILDDIR" -CURRENT_SHA=$(cd "$BASEDIR"/subsurface/libdivecomputer ; git describe) +CURRENT_SHA=$(cd "$BASEDIR"/subsurface/libdivecomputer ; git describe --always --long) PREVIOUS_SHA=$(cat "libdivecomputer.SHA" 2>/dev/null || echo) if [ ! "$CURRENT_SHA" = "$PREVIOUS_SHA" ] || [ ! -d libdivecomputer ] || [ -f build.libdivecomputer ] ; then rm -f build.libdivecomputer