clickhouse: preserve VERSION_REVISION from the source tree (#544291)
This commit is contained in:
@@ -165,8 +165,17 @@ llvmStdenv.mkDerivation (finalAttrs: {
|
||||
gitHash = rev;
|
||||
in
|
||||
''
|
||||
cat <<'EOF' > cmake/autogenerated_versions.txt
|
||||
SET(VERSION_REVISION 0)
|
||||
# Preserve VERSION_REVISION from the source tree, like ClickHouse CI
|
||||
# does. It identifies the server release line to clients (exposed via
|
||||
# the revision() SQL function)
|
||||
versionRevision=$(sed -n 's/^SET(VERSION_REVISION \([0-9]\{1,\}\))$/\1/p' cmake/autogenerated_versions.txt)
|
||||
if [[ -z "$versionRevision" ]]; then
|
||||
echo "Could not extract VERSION_REVISION from cmake/autogenerated_versions.txt" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cat <<EOF > cmake/autogenerated_versions.txt
|
||||
SET(VERSION_REVISION $versionRevision)
|
||||
SET(VERSION_MAJOR ${major})
|
||||
SET(VERSION_MINOR ${minor})
|
||||
SET(VERSION_PATCH ${patch})
|
||||
|
||||
Reference in New Issue
Block a user