|
|
@@ -37,11 +37,27 @@ if(PkgConfig_FOUND)
|
|
|
pkg_check_modules(SYSTEMD IMPORTED_TARGET libsystemd)
|
|
|
endif()
|
|
|
|
|
|
-# git commit for version banner
|
|
|
-execute_process(COMMAND git rev-parse --short HEAD
|
|
|
- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
|
|
- OUTPUT_VARIABLE SVAPI_GIT_COMMIT OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
|
- ERROR_QUIET)
|
|
|
+# git commit for version banner.
|
|
|
+#
|
|
|
+# An EXPLICITLY PROVIDED value wins over the git probe, and that ordering is the
|
|
|
+# whole point: the Docker release path has no `.git` (`.dockerignore` excludes
|
|
|
+# it), so the probe fails there and every release deb reported
|
|
|
+# `commit: unknown` while the local build reported the sha. build.sh had always
|
|
|
+# computed the commit and passed it as `--build-arg BUILD_GIT_COMMIT`, and
|
|
|
+# Dockerfile.build never declared the ARG - so Docker silently dropped it and
|
|
|
+# nothing consumed it. Accepted and ignored, in the build system rather than on
|
|
|
+# a route.
|
|
|
+#
|
|
|
+# It matters because this field is the cheapest answer to "is that fix in this
|
|
|
+# release": without it, the only instruments are the deb's mtime, which is not
|
|
|
+# evidence, and mapping a commit against a bump commit, which needs you to
|
|
|
+# already know the bump.
|
|
|
+if(NOT SVAPI_GIT_COMMIT)
|
|
|
+ execute_process(COMMAND git rev-parse --short HEAD
|
|
|
+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
|
|
+ OUTPUT_VARIABLE SVAPI_GIT_COMMIT OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
|
+ ERROR_QUIET)
|
|
|
+endif()
|
|
|
if(NOT SVAPI_GIT_COMMIT)
|
|
|
set(SVAPI_GIT_COMMIT "unknown")
|
|
|
endif()
|