@@ -449,7 +449,23 @@ class PackageManager(object, metaclass=ABCMeta):
return res
return _append(uris, base_paths)
-def create_packages_dir(d, subrepo_dir, deploydir, taskname, filterbydependencies):
+def generate_feed_dirs(d, assumeprovidedfeeds):
+ classes = d.getVar('PACKAGE_CLASSES').replace("package_", "").split()
+
+ pkg_class_map = {
+ "rpm": {"taskname": "package_write_rpm", "pkgdir": d.getVar('DEPLOY_DIR_RPM'), "feeddir": d.getVar('DEPLOY_DIR_FEED_RPM')},
+ "ipk": {"taskname": "package_write_ipk", "pkgdir": d.getVar('DEPLOY_DIR_IPK'), "feeddir": d.getVar('DEPLOY_DIR_FEED_IPK')},
+ "deb": {"taskname": "package_write_deb", "pkgdir": d.getVar('DEPLOY_DIR_DEB'), "feeddir": d.getVar('DEPLOY_DIR_FEED_DEB')}
+ }
+
+ for pkg_class in classes:
+ if not pkg_class in pkg_class_map:
+ continue
+
+ pkgcfg = pkg_class_map[pkg_class]
+ create_packages_dir(d, pkgcfg['feeddir'], pkgcfg['pkgdir'], pkgcfg['taskname'], True, assumeprovidedfeeds)
+
+def create_packages_dir(d, subrepo_dir, deploydir, taskname, filterbydependencies, assumeprovidedfeeds = None):
"""
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
@@ -474,6 +490,15 @@ def create_packages_dir(d, subrepo_dir, deploydir, taskname, filterbydependencie
return
pkgdeps = _find_task_pkg_deps(pn, taskdepdata, mytaskname, taskname)
+
+ # Find any packages which might already be provided in a separate feed or repo
+ # and remove them to avoid duplicates. This assumes any dependencies of the packages
+ # are already met as well.
+ if assumeprovidedfeeds is not None:
+ for pkg_pn in assumeprovidedfeeds.split():
+ provided_pkgdeps = _find_task_pkg_deps(pkg_pn, taskdepdata, mytaskname, taskname)
+ pkgdeps = pkgdeps.difference(provided_pkgdeps)
+
for dep in pkgdeps:
c = taskdepdata[dep][0]
manifest, d2 = oe.sstatesig.find_sstate_manifest(c, taskdepdata[dep][2], taskname, d, multilibs)
Add a generate_feed_dirs method that will call the create_packages_dir method for each package class supported in the build environment. The value of the PACKAGE_CLASSES determines which feed types are built. For each package type, the new method will determine the proper name for the package_write_<type> task, the directory to pull finished packages from, and the feed directory to copy them to. To support side-by-side feeds or situations where one feed is dependent on another, the create_packages_dir method has been updated to support an input called assumeprovidedfeeds which lists feeds whose packages and dependencies can be assumed to be provided in a separate feed. Those packages and dependencies will be excluded the feed directory for the new feed. Signed-off-by: Charlie Johnston <charlie.johnston@ni.com> --- meta/lib/oe/package_manager/__init__.py | 27 ++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-)