From cd0c049b034d247b64082d301dcbf39db45aa91d Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Thu, 20 Oct 2022 11:33:41 +0200 Subject: [PATCH 1/3] btlog: include index-v2 files --- fdroidserver/btlog.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fdroidserver/btlog.py b/fdroidserver/btlog.py index b5499d09..870ff93b 100755 --- a/fdroidserver/btlog.py +++ b/fdroidserver/btlog.py @@ -91,7 +91,7 @@ For more info on this idea: cpdir = os.path.join(btrepo, repodir) if not os.path.exists(cpdir): os.mkdir(cpdir) - for f in ('index.xml', 'index-v1.json'): + for f in ('index.xml', 'index-v1.json', 'index-v2.json', 'entry.json'): repof = os.path.join(repodir, f) if not os.path.exists(repof): continue @@ -107,7 +107,7 @@ For more info on this idea: with open(dest, 'w') as fp: json.dump(output, fp, indent=2) gitrepo.index.add([repof]) - for f in ('index.jar', 'index-v1.jar'): + for f in ('index.jar', 'index-v1.jar', 'entry.jar'): repof = os.path.join(repodir, f) if not os.path.exists(repof): continue From 886712026de6cb2a6de3949caa106ae83df12d83 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Tue, 1 Nov 2022 09:53:09 +0100 Subject: [PATCH 2/3] index: Anti-Features should always be a sorted set There are diffs in the index caused by unstable order: * https://gitlab.com/fdroid/f-droid.org-transparency-log/-/commit/184cdd9c656edefbc7d48873c6046ad931ac4f93#572d84bb16becb794e10614840972554f333c66e_169259_169353 * https://gitlab.com/fdroid/f-droid.org-transparency-log/-/commit/184cdd9c656edefbc7d48873c6046ad931ac4f93#24c372740761176e67461dbc9136a799b15cfdbf_204154_204185 --- fdroidserver/index.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/fdroidserver/index.py b/fdroidserver/index.py index f4f5c08f..a29d32c5 100644 --- a/fdroidserver/index.py +++ b/fdroidserver/index.py @@ -910,7 +910,7 @@ def make_v1(apps, packages, repodir, repodict, requestsdict, fdroid_signing_key_ k = k[:1].lower() + k[1:] d[k] = v - # establish sort order in localized dicts + # establish sort order in lists, sets, and localized dicts for app in output['apps']: localized = app.get('localized') if localized: @@ -920,6 +920,9 @@ def make_v1(apps, packages, repodir, repodict, requestsdict, fdroid_signing_key_ for ikey, iname in sorted(lvalue.items()): lordered[lkey][ikey] = iname app['localized'] = lordered + antiFeatures = app.get('AntiFeatures') + if antiFeatures: + app['AntiFeatures'] = sorted(set(antiFeatures)) output_packages = collections.OrderedDict() output['packages'] = output_packages @@ -1192,7 +1195,8 @@ def make_v0(apps, apks, repodir, repodict, requestsdict, fdroid_signing_key_fing if 'antiFeatures' in apklist[0]: app.AntiFeatures.extend(apklist[0]['antiFeatures']) if app.AntiFeatures: - addElementNonEmpty('antifeatures', ','.join(app.AntiFeatures), doc, apel) + afout = sorted(set(app.AntiFeatures)) + addElementNonEmpty('antifeatures', ','.join(afout), doc, apel) # Check for duplicates - they will make the client unhappy... for i in range(len(apklist) - 1): From 890513fcbaa7f0eca24981af4febe35e1441f826 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Tue, 1 Nov 2022 09:54:06 +0100 Subject: [PATCH 3/3] index: standardized AntiFeature variable names This is the only occurance of "anti_features". --- fdroidserver/index.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fdroidserver/index.py b/fdroidserver/index.py index a29d32c5..28f0f285 100644 --- a/fdroidserver/index.py +++ b/fdroidserver/index.py @@ -721,9 +721,9 @@ def v2_repo(repodict, repodir, archive): repo["timestamp"] = repodict["timestamp"] - anti_features = load_locale("antiFeatures", repodir) - if anti_features: - repo["antiFeatures"] = anti_features + antiFeatures = load_locale("antiFeatures", repodir) + if antiFeatures: + repo["antiFeatures"] = antiFeatures categories = load_locale("categories", repodir) if categories: