GitLab Commit is coming up on August 3-4. Learn how to innovate together using GitLab, the DevOps platform. Register for free:

Commit d06f05e9 authored by Hans-Christoph Steiner's avatar Hans-Christoph Steiner
Browse files

update: do not crash on screenshots without texts/graphics

`fdroid update` crashed for apps that only had screenshots but no graphics
or localized texts because destdir was not being set in that case.  This
fixes that and adds a test case.

closes #320
parent e1d316a4
Pipeline #8958318 passed with stage
in 34 minutes and 47 seconds
......@@ -716,6 +716,7 @@ def insert_localized_app_metadata(apps):
logging.debug(packageName + ' does not have app metadata, skipping l18n scan.')
locale = segments[-1]
destdir = os.path.join('repo', packageName, locale)
for f in files:
if f in ('description.txt', 'full_description.txt'):
_set_localized_text_entry(apps[packageName], locale, 'description',
......@@ -742,7 +743,7 @@ def insert_localized_app_metadata(apps):
base, extension = common.get_extension(f)
if locale == 'images':
locale = segments[-2]
destdir = os.path.join('repo', packageName, locale)
destdir = os.path.join('repo', packageName, locale)
if base in GRAPHIC_NAMES and extension in ALLOWED_EXTENSIONS:
os.makedirs(destdir, mode=0o755, exist_ok=True)
logging.debug('copying ' + os.path.join(root, f) + ' ' + destdir)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment