Merge "Fail check-boot-jars if boot jar contains 0 .class files" into rvc-dev
This commit is contained in:
@@ -49,8 +49,10 @@ def CheckJar(allow_list_path, jar):
|
|||||||
if p.returncode != 0:
|
if p.returncode != 0:
|
||||||
return False
|
return False
|
||||||
items = stdout.split()
|
items = stdout.split()
|
||||||
|
classes = 0
|
||||||
for f in items:
|
for f in items:
|
||||||
if f.endswith('.class'):
|
if f.endswith('.class'):
|
||||||
|
classes += 1
|
||||||
package_name = os.path.dirname(f)
|
package_name = os.path.dirname(f)
|
||||||
package_name = package_name.replace('/', '.')
|
package_name = package_name.replace('/', '.')
|
||||||
if not package_name or not allow_list_re.match(package_name):
|
if not package_name or not allow_list_re.match(package_name):
|
||||||
@@ -58,6 +60,9 @@ def CheckJar(allow_list_path, jar):
|
|||||||
' not in the allow list %s of packages allowed on the bootclasspath.'
|
' not in the allow list %s of packages allowed on the bootclasspath.'
|
||||||
% (jar, f, package_name, allow_list_path))
|
% (jar, f, package_name, allow_list_path))
|
||||||
return False
|
return False
|
||||||
|
if classes == 0:
|
||||||
|
print >> sys.stderr, ('Error: %s does not contain any class files.' % jar)
|
||||||
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user