[elbe-devel] [PATCH 1/3] Add method get_licence_pkgs for rpcaptcache

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


Return all packages that are installed and are not marked as
delete (purge).

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

diff --git a/elbepack/rpcaptcache.py b/elbepack/rpcaptcache.py
index 5a1bb01a..0d3c0ee2 100644
--- a/elbepack/rpcaptcache.py
+++ b/elbepack/rpcaptcache.py
@@ -231,6 +231,9 @@ class RPCAPTCache(InChRootObject):
         deps = getalldeps(self.cache, pkgname)
         return [APTPackage(p, cache=self.cache) for p in deps]
 
+    def get_licence_pkgs(self):
+        return [APTPackage(p) for p in self.cache if p.is_installed and not p.marked_delete]
+
     def get_installed_pkgs(self, section='all'):
         if section == 'all':
             pl = [APTPackage(p) for p in self.cache if p.is_installed]
-- 
2.25.1




More information about the elbe-devel mailing list