]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
configure: Ignore unknown Git version number
authorTobias Brunner <tobias@strongswan.org>
Mon, 20 Jul 2020 15:38:03 +0000 (17:38 +0200)
committerTobias Brunner <tobias@strongswan.org>
Tue, 21 Jul 2020 10:49:13 +0000 (12:49 +0200)
Don't abort the script if the version is reported as UNKNOWN, which happens
on CI hosts where the repository is only cloned with a certain depth (which
may not include the latest tag).

Also, never map VERSION to UNKNOWN.

Fixes: 2e522952c77d ("configure: Optionally use version information obtained from Git in executables")
configure.ac

index 6ee47f584c7968ca2609e1cc238fd0f5178f2972..419f1246fea4d89ddc4b497f55de24b8b3f7cefe 100644 (file)
@@ -1391,12 +1391,15 @@ case "$GIT_VERSION" in
        "$PACKAGE_VERSION"*)
                AC_MSG_RESULT([$GIT_VERSION])
                ;;
+       UNKNOWN)
+               AC_MSG_RESULT([$GIT_VERSION (could be due to insufficient clone depth)])
+               ;;
        *)
                AC_MSG_ERROR([$PACKAGE_VERSION is not a prefix of $GIT_VERSION, tag missing?])
                ;;
 esac
 
-if test x$git_version = xtrue; then
+if test x$git_version = xtrue -a "$GIT_VERSION" != "UNKNOWN"; then
        AC_DEFINE_UNQUOTED(VERSION, ["$GIT_VERSION"])
 fi