diff options
author | robot-ya-builder <[email protected]> | 2023-12-01 13:19:30 +0300 |
---|---|---|
committer | robot-ya-builder <[email protected]> | 2023-12-01 15:13:39 +0300 |
commit | 242e9089ecf026d921e6197487f1ecd421cbd403 (patch) | |
tree | 8381b5b3515deb8aa47efe6b1fcca50476a4fe71 /build/scripts/generate_vcs_info.py | |
parent | 078083fad75ffdcef17addfc6646e06d1c7f17d6 (diff) |
External build system generator release 64
Update tools: yexport, os-yexport
Diffstat (limited to 'build/scripts/generate_vcs_info.py')
-rw-r--r-- | build/scripts/generate_vcs_info.py | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/build/scripts/generate_vcs_info.py b/build/scripts/generate_vcs_info.py index 770d2ec8026..b311be5617d 100644 --- a/build/scripts/generate_vcs_info.py +++ b/build/scripts/generate_vcs_info.py @@ -29,19 +29,19 @@ def _get_user_locale(): return [] -class _GitVersion(): +class _GitVersion: @classmethod def parse(cls, commit_hash, author_info, summary_info, body_info, tag_info, branch_info, depth=None): - r""" Parses output of - git rev-parse HEAD - git log -1 --format='format:%an <%ae>' - git log -1 --format='format:%s' - git log -1 --grep='^git-svn-id: ' --format='format:%b' or - git log -1 --grep='^Revision: r?\d*' --format='format:%b - git describe --exact-match --tags HEAD - git describe --exact-match --all HEAD - and depth as computed by _get_git_depth - '""" + r"""Parses output of + git rev-parse HEAD + git log -1 --format='format:%an <%ae>' + git log -1 --format='format:%s' + git log -1 --grep='^git-svn-id: ' --format='format:%b' or + git log -1 --grep='^Revision: r?\d*' --format='format:%b + git describe --exact-match --tags HEAD + git describe --exact-match --all HEAD + and depth as computed by _get_git_depth + '""" info = {} info['hash'] = commit_hash @@ -91,8 +91,8 @@ class _GitVersion(): hash_args = ['rev-parse', 'HEAD'] author_args = ['log', '-1', '--format=format:%an <%ae>'] summary_args = ['log', '-1', '--format=format:%s'] - svn_args = ['log', '-1', '--grep=^git-svn-id: ', '--format=format:%b'] - svn_args_alt = ['log', '-1', '--grep=^Revision: r\\?\\d*', '--format=format:%b'] + svn_args = ['log', '-1', '--grep=^git-svn-id: ', '--format=format:%b'] + svn_args_alt = ['log', '-1', '--grep=^Revision: r\\?\\d*', '--format=format:%b'] tag_args = ['describe', '--exact-match', '--tags', 'HEAD'] branch_args = ['describe', '--exact-match', '--all', 'HEAD'] @@ -163,6 +163,7 @@ class _SystemInfo: @classmethod def get_locale(cls): import codecs + for i in cls.LOCALE_LIST: if not i: continue @@ -237,6 +238,7 @@ class _SystemInfo: errcodes += ', win-error {}'.format(e.winerror) try: import ctypes + msg = six_.text_type(ctypes.FormatError(e.winerror), _SystemInfo.get_locale()).encode('utf-8') except ImportError: pass @@ -262,7 +264,8 @@ def _get_json(vcs_root): def _dump_json( - arc_root, info, + arc_root, + info, other_data=None, build_user=None, build_date=None, @@ -287,14 +290,14 @@ def _dump_json( j['DIRTY'] = info.get('dirty', '') if 'url' in info or 'svn_url' in info: - j['SVN_REVISION'] = info.get('svn_commit_revision', info.get('revision', -1)) - j['SVN_ARCROOT'] = info.get('url', info.get('svn_url', '')) - j['SVN_TIME'] = info.get('commit_date', info.get('svn_commit_date', '')) + j['SVN_REVISION'] = info.get('svn_commit_revision', info.get('revision', -1)) + j['SVN_ARCROOT'] = info.get('url', info.get('svn_url', '')) + j['SVN_TIME'] = info.get('commit_date', info.get('svn_commit_date', '')) j['BUILD_DATE'] = build_date j['BUILD_TIMESTAMP'] = build_timestamp - return json.dumps(j, sort_keys=True, indent=4, separators=(',', ': ')) + return json.dumps(j, sort_keys=True, indent=4, separators=(',', ': ')) def get_version_info(arc_root, custom_version=""): @@ -318,4 +321,3 @@ def get_version_info(arc_root, custom_version=""): if __name__ == '__main__': with open(sys.argv[1], 'w') as f: f.write(get_version_info(sys.argv[2])) - |