From: Hans-Christoph Steiner Date: Mon, 15 May 2017 13:17:33 +0000 (+0200) Subject: lint: support new per-package subdirs for l18n and dev signatures X-Git-Tag: 0.8~52^2~2 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=1178d032f3c5e88059be4aa622b3afa3af65e524;p=fdroidserver.git 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 --- diff --git a/fdroidserver/lint.py b/fdroidserver/lint.py index b7dbdea1..a1702225 100644 --- a/fdroidserver/lint.py +++ b/fdroidserver/lint.py @@ -121,6 +121,8 @@ regex_checks = { ], } +locale_pattern = re.compile(r'^[a-z]{2,3}(-[A-Z][A-Z])?$') + def check_regexes(app): for f, checks in regex_checks.items(): @@ -325,12 +327,12 @@ def check_files_dir(app): files = set() for name in os.listdir(dir_path): 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 continue files.add(name) - used = set() + used = {'signatures', } for build in app.builds: for fname in build.patch: if fname not in files: @@ -339,6 +341,8 @@ def check_files_dir(app): used.add(fname) for name in files.difference(used): + if locale_pattern.match(name): + continue yield "Unused file at %s" % os.path.join(dir_path, name)