diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-03-05 11:35:42 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-03-05 11:35:42 +0000 |
commit | 17ffcdc70c6424f3ab3fa8c8d9670ce2619c1ae7 (patch) | |
tree | 3d3281c9591e0b67803c352207131fc98f74c733 /CMakeLists.txt | |
parent | 71993413ec7829fec777248d3a8c444532f57ec2 (diff) | |
download | rspamd-17ffcdc70c6424f3ab3fa8c8d9670ce2619c1ae7.tar.gz rspamd-17ffcdc70c6424f3ab3fa8c8d9670ce2619c1ae7.zip |
Restore build id parsing.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 5c26cfbf8..5bce194f8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -887,12 +887,15 @@ ENDIF(NOT DESTDIR) # Try to detect tip version from hg SET(ID "unknown") -FIND_PROGRAM(HG "hg") +FIND_PROGRAM(HG "git") IF(HG) - EXECUTE_PROCESS(COMMAND "${HG}" id OUTPUT_VARIABLE HG_ID ERROR_QUIET) + EXECUTE_PROCESS(COMMAND "${HG}" rev-parse --verify HEAD + WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" + OUTPUT_VARIABLE HG_ID ERROR_QUIET) IF(HG_ID) - STRING(REGEX MATCH ^[0-9a-z]+ RSPAMD_ID "${HG_ID}") + STRING(SUBSTRING "${HG_ID}" 0 10 RSPAMD_ID) + MESSAGE(STATUS "Git revision: ${RSPAMD_ID}") ELSE(HG_ID) FIND_FILE(HG_ARCH ".hg_archival.txt" "${CMAKE_CURRENT_SOURCE_DIR}") IF(HG_ARCH) |