chiark / gitweb /
lint: support new per-package subdirs for l18n and dev signatures
authorHans-Christoph Steiner <hans@eds.org>
Mon, 15 May 2017 13:17:33 +0000 (15:17 +0200)
committerHans-Christoph Steiner <hans@eds.org>
Fri, 26 May 2017 19:03:38 +0000 (21:03 +0200)
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

fdroidserver/lint.py

index b7dbdea1ba01b9e23d3f30f004cb4016faf9dd8c..a1702225934226d8dfc3523ac312cbf434ad7cb1 100644 (file)
@@ -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)