1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-07 16:59:22 +00:00

lib/oe/package-manager: allow including self in create_packages_dir

This function is typically used to construct a limited feed for image
creation, but there are other cases when you might want a limited feed
and include the current recipe's packages in it.

To ensure that existing behaviour is preserved, add a boolean to control
this behaviour and default it to False.

(From OE-Core rev: 20a6f55328733ad6f0c05b1353e8d525019aeea7)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit aada7fda2b118152d82b1ab295d92b8251afe4ac)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
This commit is contained in:
Ross Burton
2024-05-14 16:15:19 +00:00
committed by Steve Sakoman
parent f490519999
commit 0fe72b1a67
+6 -3
View File
@@ -449,7 +449,7 @@ class PackageManager(object, metaclass=ABCMeta):
return res return res
return _append(uris, base_paths) return _append(uris, base_paths)
def create_packages_dir(d, subrepo_dir, deploydir, taskname, filterbydependencies): def create_packages_dir(d, subrepo_dir, deploydir, taskname, filterbydependencies, include_self=False):
""" """
Go through our do_package_write_X dependencies and hardlink the packages we depend Go through our do_package_write_X dependencies and hardlink the packages we depend
upon into the repo directory. This prevents us seeing other packages that may upon into the repo directory. This prevents us seeing other packages that may
@@ -486,14 +486,17 @@ def create_packages_dir(d, subrepo_dir, deploydir, taskname, filterbydependencie
bb.fatal("Couldn't find ourself in BB_TASKDEPDATA?") bb.fatal("Couldn't find ourself in BB_TASKDEPDATA?")
pkgdeps = set() pkgdeps = set()
start = [start] start = [start]
seen = set(start) if include_self:
seen = set()
else:
seen = set(start)
# Support direct dependencies (do_rootfs -> do_package_write_X) # Support direct dependencies (do_rootfs -> do_package_write_X)
# or indirect dependencies within PN (do_populate_sdk_ext -> do_rootfs -> do_package_write_X) # or indirect dependencies within PN (do_populate_sdk_ext -> do_rootfs -> do_package_write_X)
while start: while start:
next = [] next = []
for dep2 in start: for dep2 in start:
for dep in taskdepdata[dep2][3]: for dep in taskdepdata[dep2][3]:
if taskdepdata[dep][0] != pn: if include_self or taskdepdata[dep][0] != pn:
if "do_" + taskname in dep: if "do_" + taskname in dep:
pkgdeps.add(dep) pkgdeps.add(dep)
elif dep not in seen: elif dep not in seen: