diff options
| author | Ross Burton <ross.burton@arm.com> | 2024-05-14 16:15:19 +0000 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-05-15 16:39:19 +0100 |
| commit | 6582436a1d1af7775a6bb651aff47a9db773e32b (patch) | |
| tree | de51048ead77efba9f14dc63b45cb7f860894a9d /meta/lib | |
| parent | a9dd9f92ba5881d09713304ceeb230e47c31d5c1 (diff) | |
| download | poky-6582436a1d1af7775a6bb651aff47a9db773e32b.tar.gz | |
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: aada7fda2b118152d82b1ab295d92b8251afe4ac)
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
| -rw-r--r-- | meta/lib/oe/package_manager/__init__.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/meta/lib/oe/package_manager/__init__.py b/meta/lib/oe/package_manager/__init__.py index 6774cdb794..d3b2317894 100644 --- a/meta/lib/oe/package_manager/__init__.py +++ b/meta/lib/oe/package_manager/__init__.py | |||
| @@ -449,7 +449,7 @@ class PackageManager(object, metaclass=ABCMeta): | |||
| 449 | return res | 449 | return res |
| 450 | return _append(uris, base_paths) | 450 | return _append(uris, base_paths) |
| 451 | 451 | ||
| 452 | def create_packages_dir(d, subrepo_dir, deploydir, taskname, filterbydependencies): | 452 | def create_packages_dir(d, subrepo_dir, deploydir, taskname, filterbydependencies, include_self=False): |
| 453 | """ | 453 | """ |
| 454 | Go through our do_package_write_X dependencies and hardlink the packages we depend | 454 | Go through our do_package_write_X dependencies and hardlink the packages we depend |
| 455 | upon into the repo directory. This prevents us seeing other packages that may | 455 | 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 | |||
| 486 | bb.fatal("Couldn't find ourself in BB_TASKDEPDATA?") | 486 | bb.fatal("Couldn't find ourself in BB_TASKDEPDATA?") |
| 487 | pkgdeps = set() | 487 | pkgdeps = set() |
| 488 | start = [start] | 488 | start = [start] |
| 489 | seen = set(start) | 489 | if include_self: |
| 490 | seen = set() | ||
| 491 | else: | ||
| 492 | seen = set(start) | ||
| 490 | # Support direct dependencies (do_rootfs -> do_package_write_X) | 493 | # Support direct dependencies (do_rootfs -> do_package_write_X) |
| 491 | # or indirect dependencies within PN (do_populate_sdk_ext -> do_rootfs -> do_package_write_X) | 494 | # or indirect dependencies within PN (do_populate_sdk_ext -> do_rootfs -> do_package_write_X) |
| 492 | while start: | 495 | while start: |
| 493 | next = [] | 496 | next = [] |
| 494 | for dep2 in start: | 497 | for dep2 in start: |
| 495 | for dep in taskdepdata[dep2][3]: | 498 | for dep in taskdepdata[dep2][3]: |
| 496 | if taskdepdata[dep][0] != pn: | 499 | if include_self or taskdepdata[dep][0] != pn: |
| 497 | if "do_" + taskname in dep: | 500 | if "do_" + taskname in dep: |
| 498 | pkgdeps.add(dep) | 501 | pkgdeps.add(dep) |
| 499 | elif dep not in seen: | 502 | elif dep not in seen: |
