1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-01-19 05:33:02 +00:00

Sanitize branch name so branches with a slash in its name do not break (Fixes: #521)

This commit is contained in:
Carles Fernandez 2021-07-03 13:41:42 +02:00
parent 4004169f6d
commit ad5ebaa813
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D

View File

@ -41,6 +41,8 @@ if(GIT_FOUND)
OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_STRIP_TRAILING_WHITESPACE
) )
endif() endif()
# Sanitize branch name
string(REGEX REPLACE "[#!?&|\/^$%*]" "_" GIT_BRANCH "${GIT_BRANCH}")
set(VOLK_GNSSSDR_GIT_BRANCH "${GIT_BRANCH}") set(VOLK_GNSSSDR_GIT_BRANCH "${GIT_BRANCH}")
set(VOLK_GNSSSDR_GIT_HASH "${GIT_COMMIT_HASH}") set(VOLK_GNSSSDR_GIT_HASH "${GIT_COMMIT_HASH}")
else() else()
@ -51,6 +53,8 @@ else()
endif() endif()
if(GIT_BRANCH) if(GIT_BRANCH)
# Sanitize branch name
string(REGEX REPLACE "[#!?&|\/^$%*]" "_" GIT_BRANCH "${GIT_BRANCH}")
set(VOLK_GNSSSDR_GIT_BRANCH "${GIT_BRANCH}") set(VOLK_GNSSSDR_GIT_BRANCH "${GIT_BRANCH}")
else() else()
set(VOLK_GNSSSDR_GIT_BRANCH "unknown") set(VOLK_GNSSSDR_GIT_BRANCH "unknown")