From 5b7209d88206f3a6eabeb546818c0096f4ea4a0e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Michael=20P=C3=B6hn?= Date: Sat, 22 Apr 2017 12:04:32 +0200 Subject: [PATCH] unified method for naming build output --- fdroidserver/build.py | 9 ++++----- fdroidserver/dscanner.py | 2 +- fdroidserver/update.py | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/fdroidserver/build.py b/fdroidserver/build.py index 7c4fddf3..c16bd182 100644 --- a/fdroidserver/build.py +++ b/fdroidserver/build.py @@ -1212,7 +1212,7 @@ def main(): url = url.replace('%v', build.versionName) url = url.replace('%c', str(build.versionCode)) logging.info("...retrieving " + url) - of = "{0}_{1}.apk.binary".format(app.id, build.versionCode) + of = common.get_release_filename(app, build) + '.binary' of = os.path.join(output_dir, of) try: net.download_file(url, local_filename=of) @@ -1225,10 +1225,9 @@ def main(): # and remove everything from the unsigend folder. with tempfile.TemporaryDirectory() as tmpdir: unsigned_apk = \ - '{0}_{1}.apk'.format(appid, - build.versionCode) - unsigned_apk = os.path.join(output_dir, - unsigned_apk) + common.get_release_filename(app, build) + unsigned_apk = \ + os.path.join(output_dir, unsigned_apk) compare_result = \ common.verify_apks(of, unsigned_apk, tmpdir) if compare_result: diff --git a/fdroidserver/dscanner.py b/fdroidserver/dscanner.py index 10e98b31..a9ffa027 100644 --- a/fdroidserver/dscanner.py +++ b/fdroidserver/dscanner.py @@ -467,7 +467,7 @@ def main(): for build in app.builds: apks = [] for f in os.listdir(options.repo_path): - n = "%v_%v.apk".format(app_id, build.versionCode) + n = common.get_release_filename(app, build) if f == n: apks.append(f) for apk in sorted(apks): diff --git a/fdroidserver/update.py b/fdroidserver/update.py index a97a40bf..d08bb25b 100644 --- a/fdroidserver/update.py +++ b/fdroidserver/update.py @@ -319,7 +319,7 @@ def delete_disabled_builds(apps, apkcache, repodirs): for build in app['builds']: if not build.disable: continue - apkfilename = appid + '_' + str(build.versionCode) + '.apk' + apkfilename = common.get_release_filename(app, build) iconfilename = "%s.%s.png" % ( appid, build.versionCode) -- 2.30.2