aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2018-03-06 18:24:11 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2018-03-06 18:24:11 +0000
commit0d6a25c73f762a9639e26c97b6e11701653efb0b (patch)
treee5d46ce59fa9f477bc88dd9d49a95d0332c5e5a9
parent53876001bff28611593f3121b9b67c2d726606af (diff)
parent7b179ae17702758f56230260ad9b95be5ae47fce (diff)
downloadbuild-0d6a25c73f762a9639e26c97b6e11701653efb0b.tar.gz
Merge "Clarify error message for bootclasspath whitelist."android-p-preview-1
-rwxr-xr-xcore/tasks/check_boot_jars/check_boot_jars.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/core/tasks/check_boot_jars/check_boot_jars.py b/core/tasks/check_boot_jars/check_boot_jars.py
index 1b4540cb8d..9d71553c81 100755
--- a/core/tasks/check_boot_jars/check_boot_jars.py
+++ b/core/tasks/check_boot_jars/check_boot_jars.py
@@ -39,7 +39,7 @@ def LoadWhitelist(filename):
return True
-def CheckJar(jar):
+def CheckJar(whitelist_path, jar):
"""Check a jar file.
"""
# Get the list of files inside the jar file.
@@ -55,8 +55,9 @@ def CheckJar(jar):
package_name = package_name.replace('/', '.')
# Skip class without a package name
if package_name and not whitelist_re.match(package_name):
- print >> sys.stderr, ('Error: %s contains class file %s, which is not in the whitelist'
- % (jar, f))
+ print >> sys.stderr, ('Error: %s contains class file %s, whose package name %s is not '
+ 'in the whitelist %s of packages allowed on the bootclasspath.'
+ % (jar, f, package_name, whitelist_path))
return False
return True
@@ -65,13 +66,14 @@ def main(argv):
if len(argv) < 2:
print __doc__
return 1
+ whitelist_path = argv[0]
- if not LoadWhitelist(argv[0]):
+ if not LoadWhitelist(whitelist_path):
return 1
passed = True
for jar in argv[1:]:
- if not CheckJar(jar):
+ if not CheckJar(whitelist_path, jar):
passed = False
if not passed:
return 1