From 960d31af2a27625cb0d1f0dac9b2fe9c9a92ba06 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Tue, 7 Jul 2020 10:20:03 +0200 Subject: [PATCH] import: standardize on 'appid' var name for Application ID The rest of the fdroidserver code uses 'appid' or 'packageName'. The official Android name is "Application ID". "Package Name" is the Java term, and it is used in Android in Java code. --- fdroidserver/import.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/fdroidserver/import.py b/fdroidserver/import.py index a6098202..c7286e08 100644 --- a/fdroidserver/import.py +++ b/fdroidserver/import.py @@ -127,9 +127,9 @@ def main(): paths = common.get_all_gradle_and_manifests(tmp_importer_dir) subdir = common.get_gradle_subdir(tmp_importer_dir, paths) if paths: - versionName, versionCode, package = common.parse_androidmanifests(paths, app) - if not package: - raise FDroidException(_("Couldn't find package ID")) + versionName, versionCode, appid = common.parse_androidmanifests(paths, app) + if not appid: + raise FDroidException(_("Couldn't find Application ID")) if not versionName: logging.warning(_('Could not find latest version name')) if not versionCode: @@ -138,8 +138,8 @@ def main(): raise FDroidException(_("No gradle project could be found. Specify --subdir?")) # Make sure it's actually new... - if package in apps: - raise FDroidException("Package " + package + " already exists") + if appid in apps: + raise FDroidException(_('Package "{appid}" already exists').format(appid=appid)) # Create a build line... build.versionName = versionName or 'Unknown' @@ -205,17 +205,17 @@ def main(): # Keep the repo directory to save bandwidth... if not os.path.exists('build'): os.mkdir('build') - build_dir = os.path.join('build', package) + build_dir = os.path.join('build', appid) if os.path.exists(build_dir): logging.warning(_('{path} already exists, ignoring import results!') .format(path=build_dir)) sys.exit(1) elif tmp_importer_dir is not None: shutil.move(tmp_importer_dir, build_dir) - with open('build/.fdroidvcs-' + package, 'w') as f: + with open('build/.fdroidvcs-' + appid, 'w') as f: f.write(app.RepoType + ' ' + app.Repo) - metadatapath = os.path.join('metadata', package + '.yml') + metadatapath = os.path.join('metadata', appid + '.yml') metadata.write_metadata(metadatapath, app) logging.info("Wrote " + metadatapath)