1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
From: Andreas Henriksson <a.henriksson@gmail.com>
Date: Sat, 4 Jan 2025 20:40:22 +0100
Subject: Use DEB_VERSION_UPSTREAM if set instead of git describe
Even if git was available, our source when unpacked will
not be a git repository, so the git command will fail.
---
src/CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 8a7f592..f2d5ad9 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,5 +1,5 @@
execute_process(
- COMMAND sh -c "git describe --tags --dirty --exact-match 2>/dev/null || git rev-parse --short HEAD"
+ COMMAND sh -c "if [ -n \"$DEB_VERSION_UPSTREAM\" ]; then echo \"$DEB_VERSION_UPSTREAM\" ; else git describe --tags --dirty --exact-match 2>/dev/null || git rev-parse --short HEAD ; fi"
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
OUTPUT_VARIABLE MENDER_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE
|