diff --git a/fdroidserver/common.py b/fdroidserver/common.py index 084f982f..1326c8fe 100644 --- a/fdroidserver/common.py +++ b/fdroidserver/common.py @@ -77,7 +77,7 @@ APK_NAME_REGEX = re.compile(r'^([a-zA-Z][\w.]*)_(-?[0-9]+)_?([0-9a-f]{7})?\.apk' APK_ID_TRIPLET_REGEX = re.compile(r"^package: name='(\w[^']*)' versionCode='([^']+)' versionName='([^']*)'") STANDARD_FILE_NAME_REGEX = re.compile(r'^(\w[\w.]*)_(-?[0-9]+)\.\w+') FDROID_PACKAGE_NAME_REGEX = re.compile(r'''^[a-f0-9]+$''', re.IGNORECASE) -STRICT_APPLICATION_ID_REGEX = re.compile(r'''(?:^[a-z_]+(?:\d*[a-zA-Z_]*)*)(?:\.[a-z_]+(?:\d*[a-zA-Z_]*)*)*$''') +STRICT_APPLICATION_ID_REGEX = re.compile(r'''(?:^[a-zA-Z]+(?:\d*[a-zA-Z_]*)*)(?:\.[a-zA-Z]+(?:\d*[a-zA-Z_]*)*)+$''') VALID_APPLICATION_ID_REGEX = re.compile(r'''(?:^[a-z_]+(?:\d*[a-zA-Z_]*)*)(?:\.[a-z_]+(?:\d*[a-zA-Z_]*)*)*$''', re.IGNORECASE) @@ -3268,7 +3268,7 @@ def deploy_build_log_with_rsync(appid, vercode, log_content, if retcode: logging.warning(_("failed deploying build logs to '{path}'").format(path=webroot)) else: - logging.info(_("deployeded build logs to '{path}'").format(path=webroot)) + logging.info(_("deployed build logs to '{path}'").format(path=webroot)) def get_per_app_repos(): diff --git a/fdroidserver/nightly.py b/fdroidserver/nightly.py index 5fff2f33..9579ae50 100644 --- a/fdroidserver/nightly.py +++ b/fdroidserver/nightly.py @@ -99,7 +99,7 @@ def main(): parser.add_argument("--no-deploy", action="store_true", default=False, help=_("Do not deploy the new files to the repo")) parser.add_argument("--file", default='app/build/outputs/apk/*.apk', - help=_('The the file to be included in the repo (path or glob)')) + help=_('The file to be included in the repo (path or glob)')) parser.add_argument("--no-checksum", action="store_true", default=False, help=_("Don't use rsync checksums")) # TODO add --with-btlog diff --git a/fdroidserver/update.py b/fdroidserver/update.py index 8798f7c9..98eadfbe 100644 --- a/fdroidserver/update.py +++ b/fdroidserver/update.py @@ -1071,7 +1071,7 @@ def scan_apk(apk_file): raise BuildException(_("{appid} from {path} is not a valid Java Package Name!") .format(appid=apk['packageName'], path=apk_file)) elif not common.is_strict_application_id(apk['packageName']): - logging.warning(_("{appid} from {path} is not a valid Java Package Name!") + logging.warning(_("{appid} from {path} is not a valid Android Package Name!") .format(appid=apk['packageName'], path=apk_file)) # Get the signature, or rather the signing key fingerprints diff --git a/locale/bo/LC_MESSAGES/fdroidserver.po b/locale/bo/LC_MESSAGES/fdroidserver.po index 51b1c95c..9021a286 100644 --- a/locale/bo/LC_MESSAGES/fdroidserver.po +++ b/locale/bo/LC_MESSAGES/fdroidserver.po @@ -1483,7 +1483,7 @@ msgid "The root dir for local_copy_dir \"{path}\" does not exist!" msgstr "dir གྱི་རྩ་བ་ for local_copy_dir \"{path}\" མིན་འདུག!" #: ../fdroidserver/nightly.py -msgid "The the file to be included in the repo (path or glob)" +msgid "The file to be included in the repo (path or glob)" msgstr "(path or glob)རེ་པོ་ནང་ཚུད་པའི་ཡིག་ཆ།" #: ../fdroidserver/publish.py diff --git a/locale/de/LC_MESSAGES/fdroidserver.po b/locale/de/LC_MESSAGES/fdroidserver.po index 9970a27e..dd8c36af 100644 --- a/locale/de/LC_MESSAGES/fdroidserver.po +++ b/locale/de/LC_MESSAGES/fdroidserver.po @@ -1530,7 +1530,7 @@ msgid "The root dir for local_copy_dir \"{path}\" does not exist!" msgstr "Das Wurzelverzeichnis für local_copy_dir \"{path}\" existiert nicht!" #: ../fdroidserver/nightly.py -msgid "The the file to be included in the repo (path or glob)" +msgid "The file to be included in the repo (path or glob)" msgstr "Die in das Repo aufzunehmende Datei (Pfad oder Glob)" #: ../fdroidserver/publish.py diff --git a/locale/es/LC_MESSAGES/fdroidserver.po b/locale/es/LC_MESSAGES/fdroidserver.po index d396b40a..d6db12a9 100644 --- a/locale/es/LC_MESSAGES/fdroidserver.po +++ b/locale/es/LC_MESSAGES/fdroidserver.po @@ -1501,7 +1501,7 @@ msgid "The root dir for local_copy_dir \"{path}\" does not exist!" msgstr "" #: ../fdroidserver/nightly.py -msgid "The the file to be included in the repo (path or glob)" +msgid "The file to be included in the repo (path or glob)" msgstr "" #: ../fdroidserver/publish.py diff --git a/locale/es_AR/LC_MESSAGES/fdroidserver.po b/locale/es_AR/LC_MESSAGES/fdroidserver.po index 444cda55..386a1424 100644 --- a/locale/es_AR/LC_MESSAGES/fdroidserver.po +++ b/locale/es_AR/LC_MESSAGES/fdroidserver.po @@ -1425,7 +1425,7 @@ msgid "The root dir for local_copy_dir \"{path}\" does not exist!" msgstr "" #: ../fdroidserver/nightly.py -msgid "The the file to be included in the repo (path or glob)" +msgid "The file to be included in the repo (path or glob)" msgstr "" #: ../fdroidserver/publish.py diff --git a/locale/fa/LC_MESSAGES/fdroidserver.po b/locale/fa/LC_MESSAGES/fdroidserver.po index a2015224..97dd0ea2 100644 --- a/locale/fa/LC_MESSAGES/fdroidserver.po +++ b/locale/fa/LC_MESSAGES/fdroidserver.po @@ -1435,7 +1435,7 @@ msgid "The root dir for local_copy_dir \"{path}\" does not exist!" msgstr "" #: ../fdroidserver/nightly.py -msgid "The the file to be included in the repo (path or glob)" +msgid "The file to be included in the repo (path or glob)" msgstr "" #: ../fdroidserver/publish.py diff --git a/locale/fdroidserver.pot b/locale/fdroidserver.pot index 6794643d..730f12a3 100644 --- a/locale/fdroidserver.pot +++ b/locale/fdroidserver.pot @@ -1424,7 +1424,7 @@ msgid "The root dir for local_copy_dir \"{path}\" does not exist!" msgstr "" #: ../fdroidserver/nightly.py -msgid "The the file to be included in the repo (path or glob)" +msgid "The file to be included in the repo (path or glob)" msgstr "" #: ../fdroidserver/publish.py @@ -1771,7 +1771,7 @@ msgstr "" #: ../fdroidserver/common.py #, python-brace-format -msgid "deployeded build logs to '{path}'" +msgid "deployed build logs to '{path}'" msgstr "" #: /usr/lib/python3.5/argparse.py /usr/lib/python3.6/argparse.py diff --git a/locale/fr/LC_MESSAGES/fdroidserver.po b/locale/fr/LC_MESSAGES/fdroidserver.po index 6cc07da3..245523ef 100644 --- a/locale/fr/LC_MESSAGES/fdroidserver.po +++ b/locale/fr/LC_MESSAGES/fdroidserver.po @@ -1466,7 +1466,7 @@ msgid "The root dir for local_copy_dir \"{path}\" does not exist!" msgstr "" #: ../fdroidserver/nightly.py -msgid "The the file to be included in the repo (path or glob)" +msgid "The file to be included in the repo (path or glob)" msgstr "" #: ../fdroidserver/publish.py diff --git a/locale/it/LC_MESSAGES/fdroidserver.po b/locale/it/LC_MESSAGES/fdroidserver.po index 2d001cf2..fb551e27 100644 --- a/locale/it/LC_MESSAGES/fdroidserver.po +++ b/locale/it/LC_MESSAGES/fdroidserver.po @@ -1463,7 +1463,7 @@ msgid "The root dir for local_copy_dir \"{path}\" does not exist!" msgstr "" #: ../fdroidserver/nightly.py -msgid "The the file to be included in the repo (path or glob)" +msgid "The file to be included in the repo (path or glob)" msgstr "" #: ../fdroidserver/publish.py diff --git a/locale/ja/LC_MESSAGES/fdroidserver.po b/locale/ja/LC_MESSAGES/fdroidserver.po index a6c9399a..1854425f 100644 --- a/locale/ja/LC_MESSAGES/fdroidserver.po +++ b/locale/ja/LC_MESSAGES/fdroidserver.po @@ -1402,7 +1402,7 @@ msgid "The root dir for local_copy_dir \"{path}\" does not exist!" msgstr "" #: ../fdroidserver/nightly.py -msgid "The the file to be included in the repo (path or glob)" +msgid "The file to be included in the repo (path or glob)" msgstr "" #: ../fdroidserver/publish.py diff --git a/locale/kab/LC_MESSAGES/fdroidserver.po b/locale/kab/LC_MESSAGES/fdroidserver.po index b76b9622..72db0e81 100644 --- a/locale/kab/LC_MESSAGES/fdroidserver.po +++ b/locale/kab/LC_MESSAGES/fdroidserver.po @@ -1408,7 +1408,7 @@ msgid "The root dir for local_copy_dir \"{path}\" does not exist!" msgstr "" #: ../fdroidserver/nightly.py -msgid "The the file to be included in the repo (path or glob)" +msgid "The file to be included in the repo (path or glob)" msgstr "" #: ../fdroidserver/publish.py diff --git a/locale/ko/LC_MESSAGES/fdroidserver.po b/locale/ko/LC_MESSAGES/fdroidserver.po index ea9bf88d..e0499033 100644 --- a/locale/ko/LC_MESSAGES/fdroidserver.po +++ b/locale/ko/LC_MESSAGES/fdroidserver.po @@ -1431,7 +1431,7 @@ msgid "The root dir for local_copy_dir \"{path}\" does not exist!" msgstr "" #: ../fdroidserver/nightly.py -msgid "The the file to be included in the repo (path or glob)" +msgid "The file to be included in the repo (path or glob)" msgstr "" #: ../fdroidserver/publish.py diff --git a/locale/nb_NO/LC_MESSAGES/fdroidserver.po b/locale/nb_NO/LC_MESSAGES/fdroidserver.po index d5d886e5..5329535d 100644 --- a/locale/nb_NO/LC_MESSAGES/fdroidserver.po +++ b/locale/nb_NO/LC_MESSAGES/fdroidserver.po @@ -1413,7 +1413,7 @@ msgid "The root dir for local_copy_dir \"{path}\" does not exist!" msgstr "" #: ../fdroidserver/nightly.py -msgid "The the file to be included in the repo (path or glob)" +msgid "The file to be included in the repo (path or glob)" msgstr "" #: ../fdroidserver/publish.py diff --git a/locale/pt_BR/LC_MESSAGES/fdroidserver.po b/locale/pt_BR/LC_MESSAGES/fdroidserver.po index f1485166..a199e8ea 100644 --- a/locale/pt_BR/LC_MESSAGES/fdroidserver.po +++ b/locale/pt_BR/LC_MESSAGES/fdroidserver.po @@ -1465,7 +1465,7 @@ msgid "The root dir for local_copy_dir \"{path}\" does not exist!" msgstr "" #: ../fdroidserver/nightly.py -msgid "The the file to be included in the repo (path or glob)" +msgid "The file to be included in the repo (path or glob)" msgstr "" #: ../fdroidserver/publish.py diff --git a/locale/pt_PT/LC_MESSAGES/fdroidserver.po b/locale/pt_PT/LC_MESSAGES/fdroidserver.po index b4baa078..fee97fb8 100644 --- a/locale/pt_PT/LC_MESSAGES/fdroidserver.po +++ b/locale/pt_PT/LC_MESSAGES/fdroidserver.po @@ -1408,7 +1408,7 @@ msgid "The root dir for local_copy_dir \"{path}\" does not exist!" msgstr "" #: ../fdroidserver/nightly.py -msgid "The the file to be included in the repo (path or glob)" +msgid "The file to be included in the repo (path or glob)" msgstr "" #: ../fdroidserver/publish.py diff --git a/locale/uk/LC_MESSAGES/fdroidserver.po b/locale/uk/LC_MESSAGES/fdroidserver.po index fa87c937..80401dc6 100644 --- a/locale/uk/LC_MESSAGES/fdroidserver.po +++ b/locale/uk/LC_MESSAGES/fdroidserver.po @@ -1490,7 +1490,7 @@ msgid "The root dir for local_copy_dir \"{path}\" does not exist!" msgstr "" #: ../fdroidserver/nightly.py -msgid "The the file to be included in the repo (path or glob)" +msgid "The file to be included in the repo (path or glob)" msgstr "" #: ../fdroidserver/publish.py diff --git a/locale/zh_Hans/LC_MESSAGES/fdroidserver.po b/locale/zh_Hans/LC_MESSAGES/fdroidserver.po index 9ffa76c8..5a271a51 100644 --- a/locale/zh_Hans/LC_MESSAGES/fdroidserver.po +++ b/locale/zh_Hans/LC_MESSAGES/fdroidserver.po @@ -1419,7 +1419,7 @@ msgid "The root dir for local_copy_dir \"{path}\" does not exist!" msgstr "" #: ../fdroidserver/nightly.py -msgid "The the file to be included in the repo (path or glob)" +msgid "The file to be included in the repo (path or glob)" msgstr "" #: ../fdroidserver/publish.py diff --git a/locale/zh_Hant/LC_MESSAGES/fdroidserver.po b/locale/zh_Hant/LC_MESSAGES/fdroidserver.po index f4ee28c1..7f487ae7 100644 --- a/locale/zh_Hant/LC_MESSAGES/fdroidserver.po +++ b/locale/zh_Hant/LC_MESSAGES/fdroidserver.po @@ -1441,7 +1441,7 @@ msgid "The root dir for local_copy_dir \"{path}\" does not exist!" msgstr "local_copy_dir \"{path}\" 根目錄不存在!" #: ../fdroidserver/nightly.py -msgid "The the file to be included in the repo (path or glob)" +msgid "The file to be included in the repo (path or glob)" msgstr "包含在此軟體庫的檔案 (path 或 glob)" #: ../fdroidserver/publish.py diff --git a/tests/common.TestCase b/tests/common.TestCase index 125f0961..518a0a49 100755 --- a/tests/common.TestCase +++ b/tests/common.TestCase @@ -172,16 +172,38 @@ class CommonTest(unittest.TestCase): self.assertFalse(fdroidserver.common.is_apk_and_debuggable_androguard(apkfile), 'androguard missed !') + VALID_STRICT_PACKAGE_NAMES = [ + "An.stop", + "SpeedoMeterApp.main", + "a2dp.Vol", + "au.com.darkside.XServer", + "click.dummer.UartSmartwatch", + "com.Bisha.TI89EmuDonation", + "com.MarcosDiez.shareviahttp", + "com.Pau.ImapNotes2", + "com.app.Zensuren", + "com.darshancomputing.BatteryIndicator", + "com.geecko.QuickLyric", + "com.genonbeta.TrebleShot", + "com.gpl.rpg.AndorsTrail", + "com.hobbyone.HashDroid", + "com.moez.QKSMS", + "com.platypus.SAnd", + "com.prhlt.aemus.Read4SpeechExperiments", + "de.syss.MifareClassicTool", + "org.fdroid.fdroid", + "org.f_droid.fdr0ID", + ] + def test_is_valid_package_name(self): - for name in ["cafebabe", - "org.fdroid.fdroid", - "org.f_droid.fdr0ID", - "SpeedoMeterApp.main", - "05041684efd9b16c2888b1eddbadd0359f655f311b89bdd1737f560a10d20fb8"]: + for name in self.VALID_STRICT_PACKAGE_NAMES + [ + "_SpeedoMeterApp.main", + "05041684efd9b16c2888b1eddbadd0359f655f311b89bdd1737f560a10d20fb8"]: self.assertTrue(fdroidserver.common.is_valid_package_name(name), "{0} should be a valid package name".format(name)) for name in ["0rg.fdroid.fdroid", ".f_droid.fdr0ID", + "trailingdot.", "org.fdroid/fdroid", "/org.fdroid.fdroid"]: self.assertFalse(fdroidserver.common.is_valid_package_name(name), @@ -189,17 +211,17 @@ class CommonTest(unittest.TestCase): def test_is_strict_application_id(self): """see also tests/valid-package-names/""" - for name in ["org.fdroid.fdroid", - "org.f_droid.fdr0ID"]: + for name in self.VALID_STRICT_PACKAGE_NAMES: self.assertTrue(fdroidserver.common.is_strict_application_id(name), "{0} should be a strict application id".format(name)) for name in ["0rg.fdroid.fdroid", ".f_droid.fdr0ID", "oneword", + "trailingdot.", "cafebabe", - "SpeedoMeterApp.main", "org.fdroid/fdroid", "/org.fdroid.fdroid", + "_SpeedoMeterApp.main", "05041684efd9b16c2888b1eddbadd0359f655f311b89bdd1737f560a10d20fb8"]: self.assertFalse(fdroidserver.common.is_strict_application_id(name), "{0} should not be a strict application id".format(name))