From 43d3a9c7a580b2555e8e247d15416f3ba6a3ccc7 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Fri, 2 Jun 2017 13:39:18 +0200 Subject: [PATCH 1/4] support fastlane simplified metadata dir Running `fastlane init` gave me a much simpler directory layout, which turns out to be the same as what is used for fdroiddata. --- fdroidserver/update.py | 1 + 1 file changed, 1 insertion(+) diff --git a/fdroidserver/update.py b/fdroidserver/update.py index faec9144..6b1fd807 100644 --- a/fdroidserver/update.py +++ b/fdroidserver/update.py @@ -703,6 +703,7 @@ def insert_localized_app_metadata(apps): """ sourcedirs = glob.glob(os.path.join('build', '[A-Za-z]*', 'fastlane', 'metadata', 'android', '[a-z][a-z]*')) + sourcedirs += glob.glob(os.path.join('build', '[A-Za-z]*', 'metadata', '[a-z][a-z]*')) sourcedirs += glob.glob(os.path.join('metadata', '[A-Za-z]*', '[a-z][a-z]*')) for d in sorted(sourcedirs): From 37c3bf304c3b3739ba79f382f05b08f36a8981d6 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Fri, 2 Jun 2017 13:41:04 +0200 Subject: [PATCH 2/4] support fdroid names in filenames for localized texts * "full description" is just "description" * "short description" is "summary" * "title" is "name" --- fdroidserver/update.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fdroidserver/update.py b/fdroidserver/update.py index 6b1fd807..6bbaf827 100644 --- a/fdroidserver/update.py +++ b/fdroidserver/update.py @@ -717,15 +717,15 @@ def insert_localized_app_metadata(apps): continue locale = segments[-1] for f in files: - if f == 'full_description.txt': + if f in ('description.txt', 'full_description.txt'): _set_localized_text_entry(apps[packageName], locale, 'description', os.path.join(root, f)) continue - elif f == 'short_description.txt': + elif f in ('summary.txt', 'short_description.txt'): _set_localized_text_entry(apps[packageName], locale, 'summary', os.path.join(root, f)) continue - elif f == 'title.txt': + elif f in ('name.txt', 'title.txt'): _set_localized_text_entry(apps[packageName], locale, 'name', os.path.join(root, f)) continue From 18c3bfa5fb06e3ac2d5887c03f2691244dbb11fe Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Fri, 2 Jun 2017 13:56:57 +0200 Subject: [PATCH 3/4] lint can no longer properly detect unset Summary/Description Since the Summary/Description can now be set in the app's source code, or in fdroiddata/metadata///*.txt, this lint check is no longer valid. It is important to check whether these texts are empty, but it'll require some thinking about how and where to best to that. `fdroid update` will have access to all that data, but perhaps at that point it is too late. Also, the current text prioritization puts Summary/Description in the .txt/.yml file at the highest priority, overriding every other copy, including in fdroiddata/metadata// and in the app's source code. --- fdroidserver/lint.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/fdroidserver/lint.py b/fdroidserver/lint.py index 9aebd998..3ffdf5e3 100644 --- a/fdroidserver/lint.py +++ b/fdroidserver/lint.py @@ -88,8 +88,6 @@ regex_checks = { "Unnecessary trailing space"), ], 'Summary': [ - (re.compile(r'^$'), - "Summary yet to be filled"), (re.compile(r'.*\b(free software|open source)\b.*', re.IGNORECASE), "No need to specify that the app is Free Software"), (re.compile(r'.*((your|for).*android|android.*(app|device|client|port|version))', re.IGNORECASE), @@ -102,8 +100,6 @@ regex_checks = { "Unnecessary trailing space"), ], 'Description': [ - (re.compile(r'^No description available$'), - "Description yet to be filled"), (re.compile(r'\s*[*#][^ .]'), "Invalid bulleted list"), (re.compile(r'^\s'), From 30ff777897c601bc446b0be983c8ba109caa5ab5 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Wed, 7 Jun 2017 11:33:01 +0200 Subject: [PATCH 4/4] rewritemeta: do not include empty Summary: or Description: Since the Summary: and Description: in the metadata file has the highest priority of all the localized texts, adding blank versions means that apps would always have blank Summary and Description even if the app has those fields in the localized sections of fdroiddata and/or in the app's source repo itself. fdroiddata!2262 --- fdroidserver/metadata.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fdroidserver/metadata.py b/fdroidserver/metadata.py index 9d18c4a3..6ca9aace 100644 --- a/fdroidserver/metadata.py +++ b/fdroidserver/metadata.py @@ -1225,8 +1225,8 @@ def write_plaintext_metadata(mf, app, w_comment, w_field, w_build): mf.write('\n') w_field_nonempty('Name') w_field_nonempty('Auto Name') - w_field_always('Summary') - w_field_always('Description', description_txt(app.Description)) + w_field_nonempty('Summary') + w_field_nonempty('Description', description_txt(app.Description)) mf.write('\n') if app.RequiresRoot: w_field_always('Requires Root', 'yes')