aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2011-11-25 16:15:00 +0300
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2011-11-25 16:15:00 +0300
commit3f330b5b0b95b61f3d8cf15e0b6860d4439975d9 (patch)
treeb75be94db2b9ad8e36a42f209b20abaf4409d381 /CMakeLists.txt
parent993872bac9e7d3231824f90035c50a1a9b5aff4e (diff)
downloadrspamd-3f330b5b0b95b61f3d8cf15e0b6860d4439975d9.tar.gz
rspamd-3f330b5b0b95b61f3d8cf15e0b6860d4439975d9.zip
Fix build id detecting.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt24
1 files changed, 21 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e9e41b6a0..806299ab0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -726,7 +726,7 @@ SET(ID "unknown")
FIND_PROGRAM(HG "hg")
IF(HG)
- EXECUTE_PROCESS(COMMAND "${HG} id > /dev/null" OUTPUT_VARIABLE HG_ID)
+ EXECUTE_PROCESS(COMMAND "${HG}" id OUTPUT_VARIABLE HG_ID ERROR_QUIET)
IF(HG_ID)
STRING(REGEX MATCH ^[0-9a-z]+ ID "${HG_ID}")
ELSE(HG_ID)
@@ -736,8 +736,17 @@ IF(HG)
IF(HG_ID)
STRING(REGEX MATCH "node: [0-9a-z]+" _tmp "${HG_ID}")
STRING(SUBSTRING "${_tmp}" 6 12 ID)
- ENDIF(HG_ID)
- ENDIF(HG_ARCH)
+ ENDIF(HG_ID)
+ ELSE(HG_ARCH)
+ # Maybe this is git copy
+ FIND_PROGRAM(GIT "git")
+ IF(GIT)
+ EXECUTE_PROCESS(COMMAND "${GIT}" branch -v OUTPUT_VARIABLE GIT_ID ERROR_QUIET)
+ IF(GIT_ID)
+ STRING(REGEX REPLACE "^. [0-9a-z]+ ([0-9a-f]+) .*" \\1 ID "${GIT_ID}")
+ ENDIF(GIT_ID)
+ ENDIF(GIT)
+ ENDIF(HG_ARCH)
ENDIF(HG_ID)
ELSE(HG)
# Now check .hg_archival.txt
@@ -748,6 +757,15 @@ ELSE(HG)
STRING(REGEX MATCH "node: [0-9a-z]+" _tmp "${HG_ID}")
STRING(SUBSTRING "${_tmp}" 6 12 ID)
ENDIF(HG_ID)
+ ELSE(HG_ARCH)
+ # Maybe this is git copy
+ FIND_PROGRAM(GIT "git")
+ IF(GIT)
+ EXECUTE_PROCESS(COMMAND "${GIT}" branch -v OUTPUT_VARIABLE GIT_ID ERROR_QUIET)
+ IF(GIT_ID)
+ STRING(REGEX REPLACE "^. [0-9a-z]+ ([0-9a-f]+) .*" \\1 ID "${GIT_ID}")
+ ENDIF(GIT_ID)
+ ENDIF(GIT)
ENDIF(HG_ARCH)
ENDIF(HG)