[elbe-devel] [PATCH 3/3] Change pkglist during licences generation

Olivier Dion dion at linutronix.de
Fri Feb 21 20:03:46 CET 2020


Filtering out purged package and also move the licences generation
after the finetuning in case the <purge> command was used.

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

diff --git a/elbepack/elbeproject.py b/elbepack/elbeproject.py
index b64a5fcb..930c2e2b 100644
--- a/elbepack/elbeproject.py
+++ b/elbepack/elbeproject.py
@@ -585,19 +585,6 @@ class ElbeProject (object):
         elbe_report(self.xml, self.buildenv, self.get_rpcaptcache(),
                     self.targetfs)
 
-        # Collect Licence Files
-        lic_txt_fname = os.path.join(self.builddir, "licence.txt")
-        lic_xml_fname = os.path.join(self.builddir, "licence.xml")
-
-        pkglist = self.get_rpcaptcache().get_installed_pkgs()
-        pkgnames = [p.name for p in pkglist]
-
-        with io.open(lic_txt_fname,
-                     'w+',
-                     encoding='utf-8',
-                     errors='replace') as f:
-            self.buildenv.rfs.write_licenses(f, pkgnames, lic_xml_fname)
-
         # Use some handwaving to determine grub version
         grub_arch = "ia32" if self.arch == "i386" else self.arch
         grub_fw_type = []
@@ -640,6 +627,19 @@ class ElbeProject (object):
                           self.targetfs,
                           self.builddir)
 
+        # Collect Licence Files
+        lic_txt_fname = os.path.join(self.builddir, "licence.txt")
+        lic_xml_fname = os.path.join(self.builddir, "licence.xml")
+
+        pkglist = self.get_rpcaptcache().get_licence_pkgs()
+        pkgnames = [p.name for p in pkglist]
+
+        with io.open(lic_txt_fname,
+                     'w+',
+                     encoding='utf-8',
+                     errors='replace') as f:
+            self.buildenv.rfs.write_licenses(f, pkgnames, lic_xml_fname)
+
         self.targetfs.pack_images(self.builddir)
 
         system('cat "%s"' % self.validationpath)
-- 
2.25.1




More information about the elbe-devel mailing list