1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-10-02 09:10:11 +02:00

Merge branch 'patch-1' into 'master'

change glob filter for graphics to not filter out valid IETF RFC5646 locales (fixes #621 and #357)

Closes #357 and #621

See merge request fdroid/fdroidserver!611
This commit is contained in:
Hans-Christoph Steiner 2019-01-31 22:09:41 +00:00
commit 709d35be0e

View File

@ -817,39 +817,30 @@ def copy_triple_t_store_metadata(apps):
def insert_localized_app_metadata(apps):
"""scans standard locations for graphics and localized text
Scans for localized description files, store graphics, and
screenshot PNG files in statically defined screenshots directory
and adds them to the app metadata. The screenshots and graphic
must be PNG or JPEG files ending with ".png", ".jpg", or ".jpeg"
and must be in the following layout:
# TODO replace these docs with link to All_About_Descriptions_Graphics_and_Screenshots
Scans for localized description files, changelogs, store graphics, and
screenshots and adds them to the app metadata. Each app's source repo root
checked out at /build/<packageName> is scanned at the following standard
locations for these files...
repo/packageName/locale/featureGraphic.png
repo/packageName/locale/phoneScreenshots/1.png
repo/packageName/locale/phoneScreenshots/2.png
metadata/<locale>/
fastlane/metadata/android/<locale>/
src/<buildFlavor>/fastlane/metadata/android/<locale>/
The changelog files must be text files named with the versionCode
ending with ".txt" and must be in the following layout:
https://github.com/fastlane/fastlane/blob/2.28.7/supply/README.md#changelogs-whats-new
...as well as the /metadata/<packageName>/<locale> directory.
repo/packageName/locale/changelogs/12345.txt
This will scan the each app's source repo then the metadata/ dir
for these standard locations of changelog files. If it finds
them, they will be added to the dict of all packages, with the
versions in the metadata/ folder taking precendence over the what
If it finds them, they will be added to the dict of all packages, with the
versions in the /metadata/ folder taking precendence over the what
is in the app's source repo.
Where "packageName" is the app's packageName and "locale" is the locale
of the graphics, e.g. what language they are in, using the IETF RFC5646
format (en-US, fr-CA, es-MX, etc).
The <locale> is the locale of the files supplied in that directory, using
the IETF RFC5646 format (e.g. en, en-US, ast, etc).
This will also scan the app's git for a fastlane folder, and the
metadata/ folder and the apps' source repos for standard locations
of graphic and screenshot files. If it finds them, it will copy
them into the repo. The fastlane files follow this pattern:
For each <locale> directory, this script searches for the following files
in the directory structure as supplied by fastlane. See
https://github.com/fastlane/fastlane/blob/2.28.7/supply/README.md#images-and-screenshots
See also our documentation page:
https://f-droid.org/en/docs/All_About_Descriptions_Graphics_and_Screenshots/#in-the-apps-build-metadata-in-an-fdroiddata-collection
"""
sourcedirs = glob.glob(os.path.join('build', '[A-Za-z]*', 'src', '[A-Za-z]*', 'fastlane', 'metadata', 'android', '[a-z][a-z]*'))
@ -923,7 +914,7 @@ def insert_localized_app_metadata(apps):
logging.debug('copying ' + f + ' ' + screenshotdestdir)
_strip_and_copy_image(f, screenshotdestdir)
repofiles = sorted(glob.glob(os.path.join('repo', '[A-Za-z]*', '[a-z][a-z][A-Z-.@]*')))
repofiles = sorted(glob.glob(os.path.join('repo', '[A-Za-z]*', '[a-z][a-z]*')))
for d in repofiles:
if not os.path.isdir(d):
continue