lint: support new per-package subdirs for l18n and dev signatures

Graphics and localized text can now be stored in the package folders,
always in a folder that is named for the locale.  The upstream developer
signature is also now stored, so that the upstream APK can be reproduced
even if they remove their APKs.

#291
fdroiddata!2229
fdroiddata!2224
fdroidclient#15
fdroidserver#174
This commit is contained in:
Hans-Christoph Steiner 2017-05-15 15:17:33 +02:00
parent 3dbd74262f
commit 1178d032f3

View file

@ -121,6 +121,8 @@ regex_checks = {
], ],
} }
locale_pattern = re.compile(r'^[a-z]{2,3}(-[A-Z][A-Z])?$')
def check_regexes(app): def check_regexes(app):
for f, checks in regex_checks.items(): for f, checks in regex_checks.items():
@ -325,12 +327,12 @@ def check_files_dir(app):
files = set() files = set()
for name in os.listdir(dir_path): for name in os.listdir(dir_path):
path = os.path.join(dir_path, name) path = os.path.join(dir_path, name)
if not os.path.isfile(path): if not (os.path.isfile(path) or name == 'signatures' or locale_pattern.match(name)):
yield "Found non-file at %s" % path yield "Found non-file at %s" % path
continue continue
files.add(name) files.add(name)
used = set() used = {'signatures', }
for build in app.builds: for build in app.builds:
for fname in build.patch: for fname in build.patch:
if fname not in files: if fname not in files:
@ -339,6 +341,8 @@ def check_files_dir(app):
used.add(fname) used.add(fname)
for name in files.difference(used): for name in files.difference(used):
if locale_pattern.match(name):
continue
yield "Unused file at %s" % os.path.join(dir_path, name) yield "Unused file at %s" % os.path.join(dir_path, name)