diff options
author | prettyboy <prettyboy@yandex-team.com> | 2023-03-27 08:38:19 +0300 |
---|---|---|
committer | prettyboy <prettyboy@yandex-team.com> | 2023-03-27 08:38:19 +0300 |
commit | cd17556f6887bcd2ff85b0071f82f27ef193b619 (patch) | |
tree | e80a54180ad3cb295a812cd26953514dd22d220d /build/scripts | |
parent | 8f9b3c6be615e45788ac1917ad5dec0c66ae66b1 (diff) | |
download | ydb-cd17556f6887bcd2ff85b0071f82f27ef193b619.tar.gz |
[devtools/ya/package] Populate custom-version to vcs info
Diffstat (limited to 'build/scripts')
-rw-r--r-- | build/scripts/c_templates/svn_interface.c | 8 | ||||
-rw-r--r-- | build/scripts/c_templates/svnversion.h | 1 | ||||
-rw-r--r-- | build/scripts/vcs_info.py | 3 |
3 files changed, 12 insertions, 0 deletions
diff --git a/build/scripts/c_templates/svn_interface.c b/build/scripts/c_templates/svn_interface.c index d8bdd1a70d..9c4414afd2 100644 --- a/build/scripts/c_templates/svn_interface.c +++ b/build/scripts/c_templates/svn_interface.c @@ -142,6 +142,14 @@ const char* GetProgramBuildDate() { #endif } +const char* GetCustomVersion() { +#if defined(CUSTOM_VERSION) + return CUSTOM_VERSION; +#else + return ""; +#endif +} + int GetProgramBuildTimestamp() { #if defined(BUILD_TIMESTAMP) return BUILD_TIMESTAMP; diff --git a/build/scripts/c_templates/svnversion.h b/build/scripts/c_templates/svnversion.h index 7aece931aa..8c90323d09 100644 --- a/build/scripts/c_templates/svnversion.h +++ b/build/scripts/c_templates/svnversion.h @@ -27,6 +27,7 @@ const char* GetProgramCommitId() Y_HIDDEN; void PrintSvnVersionAndExit(int argc, char* argv[]) Y_HIDDEN; void PrintSvnVersionAndExitEx(int argc, char* argv[], const char* opts) Y_HIDDEN; void PrintSvnVersionAndExit0() Y_HIDDEN; +const char* GetCustomVersion() Y_HIDDEN; // Currently returns <str> specified with --custom-version <str> in ya package const char* GetProgramScmData() Y_HIDDEN; // verbose multiline message const char* GetProgramShortVersionData() Y_HIDDEN; const char* GetProgramBuildUser() Y_HIDDEN; diff --git a/build/scripts/vcs_info.py b/build/scripts/vcs_info.py index 6a57c19807..801713d138 100644 --- a/build/scripts/vcs_info.py +++ b/build/scripts/vcs_info.py @@ -72,6 +72,7 @@ def get_default_json(): "BUILD_TIMESTAMP": 0, "BUILD_HOST": "localhost", "BUILD_USER": "nobody", + "CUSTOM_VERSION": "", "PROGRAM_VERSION": "Arc info:\\n Branch: unknown-vcs-branch\\n Commit: 0000000000000000000000000000000000000000\\n Author: <UNKNOWN>\\n Summary: No VCS\\n\\n", "SCM_DATA": "Arc info:\\n Branch: unknown-vcs-branch\\n Commit: 0000000000000000000000000000000000000000\\n Author: <UNKNOWN>\\n Summary: No VCS\\n", "VCS": "arc", @@ -220,6 +221,8 @@ def print_java_mf(info): lines += wrap('Build-Date: ', info['BUILD_DATE']) if 'BUILD_TIMESTAMP' in info: lines += wrap('Build-Timestamp: ', str(info['BUILD_TIMESTAMP'])) + if 'CUSTOM_VERSION' in info: + lines += wrap('Custom-Version-String: ', base64.b64encode(info['CUSTOM_VERSION'].encode('utf-8')).decode('utf-8')) return lines, names |