diff options
author | Ryan Beltran <ryanbeltran@chromium.org> | 2021-08-11 09:53:12 +0000 |
---|---|---|
committer | Ryan Beltran <ryanbeltran@chromium.org> | 2021-08-11 20:45:20 +0000 |
commit | bf26752f01853772132713de650fd574d1c3f5e0 (patch) | |
tree | 7f5a38dc4e3a283c92ad4654cad4b2ed4bba5593 /llvm_tools/update_chromeos_llvm_hash.py | |
parent | af7b646e9ec66fb6ed16f01071ec390e1c565ec1 (diff) | |
download | toolchain-utils-bf26752f01853772132713de650fd574d1c3f5e0.tar.gz |
llvm_tools: update llvm major in non-llvm ebuilds
This CL implements updating the llvm major version in non-llvm ebuilds.
An example of the current behavior (which uprevs the major version only
for the LLVM ebuild) can be seen here:
https://crrev.com/c/3080644/2
BUG=b:196193631
TEST=./update_chromeos_llvm_hash_unittest.py
Change-Id: Icf82f0a8a4a01b255d0eeb242fe139aaa6957920
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3088319
Reviewed-by: Manoj Gupta <manojgupta@chromium.org>
Commit-Queue: Ryan Beltran <ryanbeltran@chromium.org>
Tested-by: Ryan Beltran <ryanbeltran@chromium.org>
Diffstat (limited to 'llvm_tools/update_chromeos_llvm_hash.py')
-rwxr-xr-x | llvm_tools/update_chromeos_llvm_hash.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm_tools/update_chromeos_llvm_hash.py b/llvm_tools/update_chromeos_llvm_hash.py index afc63f3c..ab83321a 100755 --- a/llvm_tools/update_chromeos_llvm_hash.py +++ b/llvm_tools/update_chromeos_llvm_hash.py @@ -300,13 +300,12 @@ def UprevEbuildToVersion(symlink, svn_version, git_hash): raise ValueError('Invalid symlink provided: %s' % symlink) ebuild = os.path.realpath(symlink) + llvm_major_version = get_llvm_hash.GetLLVMMajorVersion(git_hash) # llvm package = os.path.basename(os.path.dirname(symlink)) if not package: raise ValueError('Tried to uprev an unknown package') - # llvm if package == 'llvm': - llvm_major_version = get_llvm_hash.GetLLVMMajorVersion(git_hash) new_ebuild, is_changed = re.subn( r'(\d+)\.(\d+)_pre([0-9]+)_p([0-9]+)', '%s.\\2_pre%s_p%s' % (llvm_major_version, svn_version, @@ -316,7 +315,8 @@ def UprevEbuildToVersion(symlink, svn_version, git_hash): # any other package else: new_ebuild, is_changed = re.subn( - r'pre([0-9]+)', 'pre%s' % svn_version, ebuild, count=1) + r'(\d+)\.(\d+)_pre([0-9]+)', + '%s.\\2_pre%s' % (llvm_major_version, svn_version), ebuild, count=1) if not is_changed: # failed to increment the revision number raise ValueError('Failed to uprev the ebuild.') |