@@ -473,31 +473,7 @@ def create_packages_dir(d, subrepo_dir, deploydir, taskname, filterbydependencie
oe.path.symlink(deploydir, subrepo_dir, True)
return
- start = None
- for dep in taskdepdata:
- data = taskdepdata[dep]
- if data[1] == mytaskname and data[0] == pn:
- start = dep
- break
- if start is None:
- bb.fatal("Couldn't find ourself in BB_TASKDEPDATA?")
- pkgdeps = set()
- start = [start]
- seen = set(start)
- # Support direct dependencies (do_rootfs -> do_package_write_X)
- # or indirect dependencies within PN (do_populate_sdk_ext -> do_rootfs -> do_package_write_X)
- while start:
- next = []
- for dep2 in start:
- for dep in taskdepdata[dep2][3]:
- if taskdepdata[dep][0] != pn:
- if "do_" + taskname in dep:
- pkgdeps.add(dep)
- elif dep not in seen:
- next.append(dep)
- seen.add(dep)
- start = next
-
+ pkgdeps = _find_task_pkg_deps(pn, taskdepdata, mytaskname, taskname)
for dep in pkgdeps:
c = taskdepdata[dep][0]
manifest, d2 = oe.sstatesig.find_sstate_manifest(c, taskdepdata[dep][2], taskname, d, multilibs)
@@ -533,6 +509,31 @@ def create_packages_dir(d, subrepo_dir, deploydir, taskname, filterbydependencie
raise
+def _find_task_pkg_deps(pn, taskdepdata, mytaskname, taskname):
+ start_task = next((dep for dep, data in taskdepdata.items()
+ if data[1] == mytaskname and data[0] == pn), None)
+ if start_task is None:
+ bb.fatal("Couldn't find %s:%s in BB_TASKDEPDATA?" % (pn, mytaskname))
+ pkgdeps = set()
+ tasks = [start_task]
+ seen = set(start_task)
+ # Support direct dependencies (do_rootfs -> do_package_write_X)
+ # or indirect dependencies within PN (do_populate_sdk_ext -> do_rootfs -> do_package_write_X)
+ while tasks:
+ new_tasks = []
+ for task in tasks:
+ deps = taskdepdata[task][3]
+ for dep in deps:
+ if taskdepdata[dep][0] != pn:
+ if "do_" + taskname in dep:
+ pkgdeps.add(dep)
+ elif dep not in seen:
+ new_tasks.append(dep)
+ seen.add(dep)
+ tasks = new_tasks
+ return pkgdeps
+
+
def generate_index_files(d, isFeed = False):
from oe.package_manager.rpm import RpmSubdirIndexer
from oe.package_manager.ipk import OpkgIndexer
To make the logic from create_feed_dir reusable, this change splits the logic used to traverse the package dependencies into a helper function. Additionally, the logic used to find the initial task was updated. Signed-off-by: Charlie Johnston <charlie.johnston@ni.com> --- meta/lib/oe/package_manager/__init__.py | 51 +++++++++++++------------ 1 file changed, 26 insertions(+), 25 deletions(-)