File: 0001-Use-DEB_UPSTREAM_VERSION-if-set-instead-of-git-descr.patch

package info (click to toggle)
mender-client 5.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 4,124 kB
  • sloc: cpp: 56,631; sh: 1,118; python: 633; makefile: 94; xml: 44
file content (21 lines) | stat: -rw-r--r-- 915 bytes parent folder | download
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