1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-11-09 17:00:12 +01:00

Warn about prebuilt jar files when scanning

This commit is contained in:
Daniel Martí 2013-12-30 11:25:15 +01:00
parent e987fb1758
commit ecd074c196
2 changed files with 6 additions and 1 deletions

View File

@ -436,7 +436,7 @@ def build_local(app, thisbuild, vcs, build_dir, output_dir, srclib_dir, extlib_d
if len(buildprobs) > 0: if len(buildprobs) > 0:
print 'Scanner found ' + str(len(buildprobs)) + ' problems:' print 'Scanner found ' + str(len(buildprobs)) + ' problems:'
for problem in buildprobs: for problem in buildprobs:
print '...' + problem print ' %s' % problem
if not force: if not force:
raise BuildException("Can't build due to " + raise BuildException("Can't build due to " +
str(len(buildprobs)) + " scanned problems") str(len(buildprobs)) + " scanned problems")

View File

@ -1237,6 +1237,9 @@ def scan_source(build_dir, root_dir, thisbuild):
else: else:
problems.append('Found %s at %s' % (what, fd)) problems.append('Found %s at %s' % (what, fd))
def warnproblem(what, fd, fp):
print 'Warning: Found %s at %s' % (what, fd)
# Iterate through all files in the source code... # Iterate through all files in the source code...
for r,d,f in os.walk(build_dir): for r,d,f in os.walk(build_dir):
for curfile in f: for curfile in f:
@ -1265,6 +1268,8 @@ def scan_source(build_dir, root_dir, thisbuild):
handleproblem('binary executable', fd, fp) handleproblem('binary executable', fd, fp)
elif mime == 'application/jar' and fp.endswith('.apk'): elif mime == 'application/jar' and fp.endswith('.apk'):
removeproblem('APK file', fd, fp) removeproblem('APK file', fd, fp)
elif mime == 'application/jar' and fp.endswith('.jar'):
warnproblem('JAR file', fd, fp)
elif curfile.endswith('.java'): elif curfile.endswith('.java'):
for line in file(fp): for line in file(fp):