[elbe-devel] [PATCH v3 1/4] elbeproject: Add gen_licenses method

Olivier Dion dion at linutronix.de
Tue Apr 7 16:42:48 CEST 2020


The method sorts the list of packages before generating the license
files for the RFS.

Signed-off-by: Olivier Dion <dion at linutronix.de>
---
 elbepack/elbeproject.py | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/elbepack/elbeproject.py b/elbepack/elbeproject.py
index 33627711..d3a76fef 100644
--- a/elbepack/elbeproject.py
+++ b/elbepack/elbeproject.py
@@ -923,3 +923,15 @@ class ElbeProject (object):
             except SystemError as e:
                 logging.exception("Commiting changes failed")
                 raise AptCacheCommitError(str(e))
+
+    def gen_licenses(self, rfs, env, pkg_list):
+
+        lic_txt_fname = os.path.join(self.builddir,
+                                     "licence-%s.txt" % rfs)
+        lic_xml_fname = os.path.join(self.builddir,
+                                     "licence-%s.xml" % rfs)
+        pkg_list.sort()
+
+        with io.open(lic_txt_fname, 'w+',
+                     encoding='utf-8', errors='replace') as f:
+            env.rfs.write_licenses(f, pkg_list, lic_xml_fname)
-- 
2.26.0




More information about the elbe-devel mailing list