From 6a7aefe2f82940e8a559e6ee8c880310b3182357 Mon Sep 17 00:00:00 2001
From: Charles Ballard <charles.ballard@stfc.ac.uk>
Date: Thu, 4 Jan 2024 12:17:03 +0000
Subject: [PATCH 1/2] python 2 to 3

---
 misc/make_list.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/misc/make_list.py b/misc/make_list.py
index ac49d517..25ee5711 100755
--- a/misc/make_list.py
+++ b/misc/make_list.py
@@ -61,7 +61,7 @@ def print_file_list(all_files, copied_dir):
         try:
             st = os.lstat(os.path.join(copied_dir, path))
         except OSError as e:
-            print '%s ERROR: %s' % (path, e)
+            print('%s ERROR: %s' % (path, e))
             continue
         if S_ISDIR(st.st_mode):
             size = 'dir'
@@ -70,10 +70,10 @@ def print_file_list(all_files, copied_dir):
         else:
             size = st.st_size
         if os.name == 'nt':
-            print "%-70s %15s %8s" % (path, module, size)
+            print("%-70s %15s %8s" % (path, module, size))
         else:
             mode = oct(st.st_mode)[-3:]
-            print "%-70s %s %15s %8s" % (path, mode, module, size)
+            print( "%-70s %s %15s %8s" % (path, mode, module, size))
 
 
 def main():
-- 
GitLab


From 087b894a7de88918c8482d621e3b865cfa019948 Mon Sep 17 00:00:00 2001
From: Charles Ballard <charles.ballard@stfc.ac.uk>
Date: Thu, 4 Jan 2024 12:18:11 +0000
Subject: [PATCH 2/2] guard against empty manifest

---
 jhbuild/utils/packagedb.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/jhbuild/utils/packagedb.py b/jhbuild/utils/packagedb.py
index b938c27c..62af81be 100755
--- a/jhbuild/utils/packagedb.py
+++ b/jhbuild/utils/packagedb.py
@@ -76,7 +76,8 @@ class PackageEntry:
         # write manifest
         fileutils.mkdir_with_parents(os.path.join(self.dirname, 'manifests'))
         writer = fileutils.SafeWriter(os.path.join(self.dirname, 'manifests', self.package))
-        writer.fp.write('\n'.join(self.manifest).encode('utf-8', 'backslashreplace') + b'\n')
+        if self.manifest is not None:
+            writer.fp.write('\n'.join(self.manifest).encode('utf-8', 'backslashreplace') + b'\n')
         writer.commit()
 
     def remove(self):
-- 
GitLab