aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2011-02-02 16:31:06 +0300
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2011-02-02 16:31:06 +0300
commitd91bd23d16f2aff5150e6fc25229f20325bc9878 (patch)
treefa3f0d14a37687679574de2a3cc65d5b27f930fa /CMakeLists.txt
parent0bf3d4d0f2c1e82e4eee7ae20e2fd17b6c03d3f8 (diff)
downloadrspamd-d91bd23d16f2aff5150e6fc25229f20325bc9878.tar.gz
rspamd-d91bd23d16f2aff5150e6fc25229f20325bc9878.zip
Small fix for build id detection.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt11
1 files changed, 10 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1437166a8..d6c3ac576 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -518,9 +518,18 @@ SET(ID "unknown")
FIND_PROGRAM(HG "hg")
IF(HG)
- EXECUTE_PROCESS(COMMAND ${HG} "id" OUTPUT_VARIABLE HG_ID)
+ EXECUTE_PROCESS(COMMAND "${HG} id > /dev/null" OUTPUT_VARIABLE HG_ID)
IF(HG_ID)
STRING(REGEX MATCH ^[0-9a-z]+ ID "${HG_ID}")
+ ELSE(HG_ID)
+ FIND_FILE(HG_ARCH ".hg_archival.txt" "${CMAKE_CURRENT_SOURCE_DIR}")
+ IF(HG_ARCH)
+ FILE(READ ${HG_ARCH} HG_ID)
+ 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)
# Now check .hg_archival.txt