[elbe-devel] [PATCH 06/11] elbepack: virtapt: delete get_uri() and its dependencies

Thomas Weißschuh thomas.weissschuh at linutronix.de
Thu Aug 1 17:53:03 CEST 2024


It is not used (anymore).

Signed-off-by: Thomas Weißschuh <thomas.weissschuh at linutronix.de>
---
 elbepack/virtapt.py | 78 -----------------------------------------------------
 1 file changed, 78 deletions(-)

diff --git a/elbepack/virtapt.py b/elbepack/virtapt.py
index 7af9d141a2c7..c70d14ac721d 100644
--- a/elbepack/virtapt.py
+++ b/elbepack/virtapt.py
@@ -18,48 +18,6 @@ from elbepack.filesystem import TmpdirFilesystem
 from elbepack.rfs import create_apt_prefs
 
 
-def getdeps(pkg):
-    for dd in pkg.depends_list.get('Depends', []):
-        for d in dd:
-            yield d.target_pkg.name
-
-
-# target_pkg is either a 'package name' or a 'provides'
-#
-# ATTENTION: for provides pinning and priorities for package selection are
-#            ignored. This should be safe for now, because the code is only
-#            used for generating the SDKs host-sysroot.
-#            For generating host-sysroots there is no posibility to modify
-#            package priorities via elbe-xml.
-def lookup_uri(v, d, target_pkg):
-    try:
-        pkg = v.cache[target_pkg]
-        c = d.get_candidate_ver(pkg)
-    except KeyError:
-        pkg = None
-        c = None
-
-    if not c:
-        for pkg in v.cache.packages:
-            for x in pkg.provides_list:
-                if target_pkg == x[0]:
-                    return lookup_uri(v, d, x[2].parent_pkg.name)
-        return '', '', ''
-
-    x = v.source.find_index(c.file_list[0][0])
-
-    r = apt_pkg.PackageRecords(v.cache)
-    r.lookup(c.file_list[0])
-    uri = x.archive_uri(r.filename)
-
-    if not x.is_trusted:
-        return target_pkg, uri, ''
-
-    hashval = str(r.hashes.find('SHA256')).split(':')[1]
-
-    return target_pkg, uri, hashval
-
-
 class VirtApt:
     def __init__(self, xml):
 
@@ -243,41 +201,5 @@ class VirtApt:
 
         return d.destfile
 
-    def get_uri(self, target_pkg, incl_deps=False):
-
-        d = apt_pkg.DepCache(self.cache)
-
-        if not incl_deps:
-            return [lookup_uri(self, d, target_pkg)]
-
-        deps = [lookup_uri(self, d, target_pkg)]
-        togo = [target_pkg]
-        while togo:
-            pp = togo.pop()
-            try:
-                pkg = self.cache[pp]
-                c = d.get_candidate_ver(pkg)
-            except KeyError:
-                pkg = None
-                c = None
-            if not c:
-                for p in self.cache.packages:
-                    for x in p.provides_list:
-                        if pp == x[0]:
-                            pkg = self.cache[x[2].parent_pkg.name]
-                            c = d.get_candidate_ver(pkg)
-            if not c:
-                print(f'couldnt get candidate: {pkg}')
-            else:
-                for p in getdeps(c):
-                    if [y for y in deps if y[0] == p]:
-                        continue
-                    if p != target_pkg and p == pp:
-                        continue
-                    deps.append(lookup_uri(self, d, p))
-                    togo.append(p)
-
-        return list(set(deps))
-
     def delete(self):
         self.basefs.delete()

-- 
2.45.2



More information about the elbe-devel mailing list