diff --git a/elbepack/aptpkgutils.py b/elbepack/aptpkgutils.py
index 3bcfb795e..d25fb5d7b 100644
--- a/elbepack/aptpkgutils.py
+++ b/elbepack/aptpkgutils.py
@@ -67,17 +67,21 @@ def getdeps(pkg):
yield d.name
-def getalldeps(c, pkgname):
- retval = []
+def getalldeps(c, pkgname, blacklist=()):
+ retval = [pkgname]
togo = [pkgname]
while togo:
pp = togo.pop()
+ if pp in blacklist:
+ continue
pkg = c[pp]
for p in getdeps(pkg.candidate):
if p in retval:
continue
+ if p in blacklist:
+ continue
if p not in c:
continue
retval.append(p)
diff --git a/elbepack/efilesystem.py b/elbepack/efilesystem.py
index ec5eb6a9f..491f63be0 100644
--- a/elbepack/efilesystem.py
+++ b/elbepack/efilesystem.py
@@ -112,13 +112,20 @@ def extract_target(src, xml, dst, cache):
arch = xml.text('project/buildimage/arch', key='arch')
if xml.tgt.has('diet'):
+ if xml.has('target/pkg-blacklist/'):
+ blacklist = [p.et.text for p in xml.node('target/pkg-blacklist/target')]
withdeps = []
for p in pkglist:
- deps = cache.get_dependencies(p)
+ if p in blacklist:
+ continue
+ deps = cache.get_dependencies(p, blacklist)
withdeps += [d.name for d in deps]
withdeps += [p]
pkglist = list(set(withdeps))
+ elif xml.has('target/pkg-blacklist/'):
+ logging.error(
+ 'Impossible to blacklist packages outside of diet mode')
file_list = []
for line in pkglist:
@@ -133,6 +140,9 @@ def extract_target(src, xml, dst, cache):
copy_filelist(src, file_list, dst)
else:
# first copy most diretories
+ if xml.has('target/pkg-blacklist/'):
+ logging.error(
+ 'Impossible to blacklist packages outside of diet mode')
for f in src.listdir():
subprocess.call(['cp', '-a', '--reflink=auto', f, dst.fname('')])
diff --git a/elbepack/rpcaptcache.py b/elbepack/rpcaptcache.py
index bc6623636..ad376a75c 100644
--- a/elbepack/rpcaptcache.py
+++ b/elbepack/rpcaptcache.py
@@ -224,8 +224,8 @@ def commit(self):
ElbeInstallProgress(fileno=sys.stdout.fileno()))
self.cache.open(progress=ElbeOpProgress())
- def get_dependencies(self, pkgname):
- deps = getalldeps(self.cache, pkgname)
+ def get_dependencies(self, pkgname, blacklist):
+ deps = getalldeps(self.cache, pkgname, blacklist)
return [APTPackage(self.cache[p]) for p in deps]
def get_installed_pkgs(self, section='all'):
diff --git a/elbepack/schema/dbsfed.xsd b/elbepack/schema/dbsfed.xsd
index 7809eb5c2..04b81999f 100644
--- a/elbepack/schema/dbsfed.xsd
+++ b/elbepack/schema/dbsfed.xsd
@@ -1133,7 +1133,7 @@ SPDX-FileCopyrightText: Linutronix GmbH
- avoid installation of packages into sysroot
+ avoid installation of packages into sysroot or target
@@ -3094,6 +3094,13 @@ SPDX-FileCopyrightText: Linutronix GmbH
+
+
+
+ avoid installing the specified packages into the target (only works in diet mode)
+
+
+