aboutsummaryrefslogtreecommitdiff
path: root/llvm_tools/llvm_patch_management.py
diff options
context:
space:
mode:
authorSalud Lemus <saludlemus@google.com>2019-08-22 14:44:39 -0700
committerSalud Lemus <saludlemus@google.com>2019-08-22 23:46:47 +0000
commit36a9ee41bfa691c593217670576d0991ae5a7492 (patch)
tree80f72c98300debd1f3f2277a6216f4976f9ba200 /llvm_tools/llvm_patch_management.py
parent39385f9275505753ba34a45aa9dde6051b513ac0 (diff)
downloadtoolchain-utils-36a9ee41bfa691c593217670576d0991ae5a7492.tar.gz
LLVM tools: Display to stdout when the log level is 'verbose'
BUG=None TEST=Ran the 'update_chromeos_llvm_next_hash.py' with log level set to 'none' and then with 'verbose'. It correctly displayed to stdout for 'verbose'. Change-Id: Ib6b3bba44ccdb78a0d000f51287ffc7b0b5670d5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1766581 Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Tested-by: Salud Lemus <saludlemus@google.com>
Diffstat (limited to 'llvm_tools/llvm_patch_management.py')
-rwxr-xr-xllvm_tools/llvm_patch_management.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/llvm_tools/llvm_patch_management.py b/llvm_tools/llvm_patch_management.py
index ac8adc83..4812627a 100755
--- a/llvm_tools/llvm_patch_management.py
+++ b/llvm_tools/llvm_patch_management.py
@@ -121,7 +121,7 @@ def GetPathToFilesDirectory(chroot_path, package):
ret, chroot_ebuild_path, err = ce.ChrootRunCommandWOutput(
chromeos_root=chroot_path,
command='equery w %s' % package,
- print_to_console=False)
+ print_to_console=ce.GetLogLevel() == 'verbose')
if ret: # Failed to get the absolute chroot path to package's ebuild.
raise ValueError(
@@ -182,7 +182,8 @@ def _MoveSrcTreeHEADToGitHash(src_path, git_hash):
move_head_cmd = 'git -C %s checkout %s' % (quote(src_path), git_hash)
- ret, _, err = ce.RunCommandWOutput(move_head_cmd, print_to_console=False)
+ ret, _, err = ce.RunCommandWOutput(
+ move_head_cmd, print_to_console=ce.GetLogLevel() == 'verbose')
if ret: # Failed to checkout to 'git_hash'.
raise ValueError('Failed to moved HEAD in %s to %s: %s' % (quote(src_path),
@@ -269,6 +270,14 @@ def main():
args_output.patch_metadata_file, args_output.packages,
FailureModes(args_output.failure_mode))
+ # Only 'disable_patches' and 'remove_patches' can potentially modify the patch
+ # metadata file.
+ if args_output.failure_mode == FailureModes.DISABLE_PATCHES.value or \
+ args_output.failure_mode == FailureModes.REMOVE_PATCHES.value:
+ print('The patch file %s has been modified for the packages:' %
+ args_output.patch_metadata_file)
+ print('\n'.join(args_output.packages))
+
if __name__ == '__main__':
main()