[releng: 4/7] convert-to-tarballs: use inline ref-storage



commit b88f8fcedd40e89fd106928e01d2f9487fbf6dc1
Author: Abderrahim Kitouni <akitouni gnome org>
Date:   Thu Feb 6 15:28:21 2020 +0100

    convert-to-tarballs: use inline ref-storage
    
    move junction refs to respective elements as well

 tools/smoketesting/convert-to-tarballs.py | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
---
diff --git a/tools/smoketesting/convert-to-tarballs.py b/tools/smoketesting/convert-to-tarballs.py
index 5f3f5e9..a5bd3da 100755
--- a/tools/smoketesting/convert-to-tarballs.py
+++ b/tools/smoketesting/convert-to-tarballs.py
@@ -880,10 +880,30 @@ def main(args):
                 conf = yaml.round_trip_load(f, preserve_quotes=True)
 
             conf['variables']['branch'] = flatpak_branch
+            conf['ref-storage'] = 'inline'
 
             with open(projectconf, 'w') as f:
                 yaml.round_trip_dump(conf, f)
 
+            # move junction refs to the respective files
+            junctionrefs = os.path.join(options.directory, 'junction.refs')
+            with open(junctionrefs) as f:
+                refs = yaml.safe_load(f)['projects']['gnome']
+
+            for element in refs.keys():
+                elfile = os.path.join(options.directory, conf['element-path'], element)
+                with open(elfile) as f:
+                    eldata = yaml.round_trip_load(f, preserve_quotes=True)
+
+                for i in range(len(refs[element])):
+                    if not refs[element][i]: # source has no ref
+                        continue
+
+                    eldata['sources'][i]['ref'] = refs[element][i]['ref']
+
+                with open(elfile, 'w') as f:
+                    yaml.round_trip_dump(eldata, f)
+
     if convert.ignored_tarballs:
         print("Could not find a download site for the following modules:")
         for module_name in convert.ignored_tarballs:


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