diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-05-31 11:25:29 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-06-02 15:59:07 +0100 |
commit | 8fa72c0e9109c2132bf11809c30b1ca001e55eb9 (patch) | |
tree | cfba6d1d71a824319a7286aff02357c2b0125160 /meta/classes | |
parent | 819596507c9d339c0b54647ae01997d7b5adf3f1 (diff) | |
download | poky-8fa72c0e9109c2132bf11809c30b1ca001e55eb9.tar.gz |
create-spdx-2-2: Fix packagedata usage to work with SDK packages
There are two seperate PKGDATA_DIR directories, one for the target and one for
the SDK. Rather than fail when a package can't be found, try the SDK first.
We use a datastore copy to keep the code simple, rather than havng to parameterise
all the packagedata functions.
(From OE-Core rev: 701d8f975c89dc6753188fbcf9d4883650ba5b58)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/create-spdx-2.2.bbclass | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/meta/classes/create-spdx-2.2.bbclass b/meta/classes/create-spdx-2.2.bbclass index f9cb3add38..b8728c5705 100644 --- a/meta/classes/create-spdx-2.2.bbclass +++ b/meta/classes/create-spdx-2.2.bbclass | |||
@@ -714,11 +714,16 @@ def collect_package_providers(d): | |||
714 | deps.append((d.getVar("PN"), d.getVar("BB_HASHFILENAME"))) | 714 | deps.append((d.getVar("PN"), d.getVar("BB_HASHFILENAME"))) |
715 | 715 | ||
716 | for dep_pn, dep_hashfn in deps: | 716 | for dep_pn, dep_hashfn in deps: |
717 | recipe_data = oe.packagedata.read_pkgdata(dep_pn, d) | 717 | localdata = d |
718 | recipe_data = oe.packagedata.read_pkgdata(dep_pn, localdata) | ||
719 | if not recipe_data: | ||
720 | localdata = bb.data.createCopy(d) | ||
721 | localdata.setVar("PKGDATA_DIR", "${PKGDATA_DIR_SDK}") | ||
722 | recipe_data = oe.packagedata.read_pkgdata(dep_pn, localdata) | ||
718 | 723 | ||
719 | for pkg in recipe_data.get("PACKAGES", "").split(): | 724 | for pkg in recipe_data.get("PACKAGES", "").split(): |
720 | 725 | ||
721 | pkg_data = oe.packagedata.read_subpkgdata_dict(pkg, d) | 726 | pkg_data = oe.packagedata.read_subpkgdata_dict(pkg, localdata) |
722 | rprovides = set(n for n, _ in bb.utils.explode_dep_versions2(pkg_data.get("RPROVIDES", "")).items()) | 727 | rprovides = set(n for n, _ in bb.utils.explode_dep_versions2(pkg_data.get("RPROVIDES", "")).items()) |
723 | rprovides.add(pkg) | 728 | rprovides.add(pkg) |
724 | 729 | ||