changeset 145:9201caf7b2a8

flatpak (build_manifest): don't crash if icon is not specified
author Goffi <goffi@goffi.org>
date Mon, 24 Jun 2019 08:57:12 +0200
parents 455f0d305b87
children 64c02902b86a
files flatpak/build_manifest.py
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/flatpak/build_manifest.py	Mon Jun 24 08:40:00 2019 +0200
+++ b/flatpak/build_manifest.py	Mon Jun 24 08:57:12 2019 +0200
@@ -792,7 +792,9 @@
 
 def get_icon():
     icon = build_settings.get('icon')
-    if icon is not None:
+    if icon is None:
+        return []
+    else:
         if isinstance(icon, str):
             icon = {'url': icon}
         icon_path = Path(urlparse(icon['url']).path)
@@ -807,13 +809,15 @@
 
         dest_path = f"/app/share/icons/hicolor/{icon['size']}/apps/{app_id}.{suffix}"
 
-        return file_from_url(
+        data = file_from_url(
             url = icon['url'],
             dest = dest_path,
             # we have common cache if several manifest use the same icon URL
             step_name = f"icon__{icon}",
             step_message = "retrieving application icon",
         )
+        data[0]['name'] = 'icon'
+        return data
 
 
 def generate_appdata_from_template(template_file):