aboutsummaryrefslogtreecommitdiff
path: root/llvm_tools/llvm_patch_management.py
diff options
context:
space:
mode:
authorJian Cai <jiancai@google.com>2019-11-20 15:32:56 -0800
committerJian Cai <jiancai@google.com>2019-11-24 19:10:42 +0000
commit121dbe56ddaba18ec5b15758ed669afd2e9acfd9 (patch)
tree401a4a18afc5a0a71d436200e6659fa79f09ce88 /llvm_tools/llvm_patch_management.py
parent78c3463730b62fb048d1f76a58c9fbbab23f8efd (diff)
downloadtoolchain-utils-121dbe56ddaba18ec5b15758ed669afd2e9acfd9.tar.gz
toolchain-utils: use LLVM git hashes to track version numbers.
LLVM has stopped issuing SVN version numbers in its commits. This patch adds a way to track SVN-style version number based on a LLVM git hash. BUG=Chromium:1027950 TEST=local tests. Change-Id: Idd8055ea7deb3bcd17c18ab5b642ce8b389e446a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1915373 Tested-by: Jian Cai <jiancai@google.com> Reviewed-by: Manoj Gupta <manojgupta@chromium.org>
Diffstat (limited to 'llvm_tools/llvm_patch_management.py')
-rwxr-xr-xllvm_tools/llvm_patch_management.py16
1 files changed, 7 insertions, 9 deletions
diff --git a/llvm_tools/llvm_patch_management.py b/llvm_tools/llvm_patch_management.py
index dff992a5..ef8b65c8 100755
--- a/llvm_tools/llvm_patch_management.py
+++ b/llvm_tools/llvm_patch_management.py
@@ -9,10 +9,10 @@
from __future__ import print_function
import argparse
+import get_llvm_hash
import os
-from pipes import quote
-
import patch_manager
+
from assert_not_in_chroot import VerifyOutsideChroot
from failure_modes import FailureModes
from get_llvm_hash import CreateTempLLVMRepo
@@ -97,8 +97,8 @@ def GetCommandLineArgs():
# Duplicate packages were passed into the command line
if len(unique_packages) != len(args_output.packages):
- raise ValueError('Duplicate packages were passed in: %s' %
- ' '.join(args_output.packages))
+ raise ValueError('Duplicate packages were passed in: %s' % ' '.join(
+ args_output.packages))
args_output.packages = unique_packages
@@ -212,7 +212,7 @@ def UpdatePackagesPatchMetadataFile(chroot_path, svn_version,
with CreateTempLLVMRepo(temp_dir) as src_path:
# Ensure that 'svn_version' exists in the chromiumum mirror of LLVM by
# finding its corresponding git hash.
- git_hash = llvm_hash.GetGitHashForVersion(src_path, svn_version)
+ git_hash = get_llvm_hash.GetGitHashFrom(src_path, svn_version)
# Git hash of 'svn_version' exists, so move the source tree's HEAD to
# 'git_hash' via `git checkout`.
@@ -232,10 +232,8 @@ def UpdatePackagesPatchMetadataFile(chroot_path, svn_version,
patch_manager.CleanSrcTree(src_path)
# Get the patch results for the current package.
- patches_info = patch_manager.HandlePatches(svn_version,
- patch_metadata_path,
- filesdir_path, src_path,
- mode)
+ patches_info = patch_manager.HandlePatches(
+ svn_version, patch_metadata_path, filesdir_path, src_path, mode)
package_info[cur_package] = patches_info._asdict()