1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-11-19 21:30:10 +01: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): def insert_localized_app_metadata(apps):
"""scans standard locations for graphics and localized text """scans standard locations for graphics and localized text
Scans for localized description files, store graphics, and Scans for localized description files, changelogs, store graphics, and
screenshot PNG files in statically defined screenshots directory screenshots and adds them to the app metadata. Each app's source repo root
and adds them to the app metadata. The screenshots and graphic checked out at /build/<packageName> is scanned at the following standard
must be PNG or JPEG files ending with ".png", ".jpg", or ".jpeg" locations for these files...
and must be in the following layout:
# TODO replace these docs with link to All_About_Descriptions_Graphics_and_Screenshots
repo/packageName/locale/featureGraphic.png metadata/<locale>/
repo/packageName/locale/phoneScreenshots/1.png fastlane/metadata/android/<locale>/
repo/packageName/locale/phoneScreenshots/2.png src/<buildFlavor>/fastlane/metadata/android/<locale>/
The changelog files must be text files named with the versionCode ...as well as the /metadata/<packageName>/<locale> directory.
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
repo/packageName/locale/changelogs/12345.txt 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
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
is in the app's source repo. is in the app's source repo.
Where "packageName" is the app's packageName and "locale" is the locale The <locale> is the locale of the files supplied in that directory, using
of the graphics, e.g. what language they are in, using the IETF RFC5646 the IETF RFC5646 format (e.g. en, en-US, ast, etc).
format (en-US, fr-CA, es-MX, etc).
This will also scan the app's git for a fastlane folder, and the For each <locale> directory, this script searches for the following files
metadata/ folder and the apps' source repos for standard locations in the directory structure as supplied by fastlane. See
of graphic and screenshot files. If it finds them, it will copy
them into the repo. The fastlane files follow this pattern:
https://github.com/fastlane/fastlane/blob/2.28.7/supply/README.md#images-and-screenshots 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]*')) 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) logging.debug('copying ' + f + ' ' + screenshotdestdir)
_strip_and_copy_image(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: for d in repofiles:
if not os.path.isdir(d): if not os.path.isdir(d):
continue continue