[gnome-runtime-images/wip/fmuellner/multi-sources] Allow rewriting manifests with multiple sources



commit 6ec33b9475d8eb427c4b63eca30def4a2bc9cf4a
Author: Florian Müllner <fmuellner gnome org>
Date:   Thu Apr 23 18:39:00 2020 +0200

    Allow rewriting manifests with multiple sources
    
    There are valid use cases for using additional sources, in particular
    "patch", "script", "shell" or "extra-data" ones. Support those by only
    rewriting sources of type "git" instead of bailing out altogether.

 rewrite-flatpak-manifest | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/rewrite-flatpak-manifest b/rewrite-flatpak-manifest
index 3aa53b1..4783b71 100755
--- a/rewrite-flatpak-manifest
+++ b/rewrite-flatpak-manifest
@@ -38,6 +38,8 @@ if __name__ == '__main__':
                 continue
 
             if mod['name'] == modulename:
-                assert len(mod['sources']) == 1
-                path = os.path.relpath('.', os.path.dirname(manifestfile))
-                mod['sources'] = [{'type': 'dir', 'path': path}]
+                for i in range(0, len(mod['sources'])):
+                    if not mod['sources'][i]['type'] == 'git':
+                        continue
+                    path = os.path.relpath('.', os.path.dirname(manifestfile))
+                    mod['sources'][i] = {'type': 'dir', 'path': path}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]