Skip to content

Commit 09e6149

Browse files
author
ryan link
committed
Applied dunfell patch for FOSSA integration
1 parent 0713907 commit 09e6149

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

classes/fossa.bbclass

+6-3
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ python do_fossa_pkg() {
8282
# this way it is able to capture the output of `do_fossa_pkg` for every
8383
# package that was processed.
8484
python do_fossa() {
85+
from oe.rootfs import image_list_installed_packages
86+
8587
if not is_fossa_enabled(d):
8688
bb.debug(1, "Since FOSSA_ENABLED is 0, skipping: creating fossa-deps.json")
8789
return
@@ -93,13 +95,14 @@ python do_fossa() {
9395

9496
metadata_dir = d.getVar('FOSSA_METADATA_RECIPES')
9597
pkg_metadata = all_pkg_metadata(d, metadata_dir)
98+
pkgs = image_list_installed_packages(d)
9699

97100
installed_pkgs = []
98-
for pkg in pkg_metadata:
101+
for pkg in pkgs:
99102
try:
100103
installed_pkgs.append(mk_user_dependencies(pkg_metadata[pkg]))
101-
except Exception as err:
102-
bb.error(f'failed to retrieve pkg metadata for {pkg} because: {err}')
104+
except Exception:
105+
pass
103106

104107
# Ensure path exists
105108
fossa_deps_dir = d.getVar("FOSSA_STAGING_DIR")

classes/fossa_upload.bbclass

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ inherit fossa_utils
66
addtask do_fossa_analyze before do_build after do_rootfs
77
do_fossa_analyze[doc] = "Analyze via fossa-cli"
88
do_fossa_analyze[nostamp] = "1"
9-
do_fossa_analyze[depends] = "fossa-cli:do_populate_sysroot"
9+
do_fossa_analyze[depends] = "fossa-cli-native:do_populate_sysroot"
1010

1111
addtask do_fossa_test before do_build after do_fossa_analyze
1212
do_fossa_test[doc] = "Test via fossa-cli"
1313
do_fossa_test[nostamp] = "1"
14-
do_fossa_test[deptask] += "fossa-cli:do_populate_sysroot"
14+
do_fossa_test[deptask] += "fossa-cli-native:do_populate_sysroot"
1515

16-
# This task runs `fossa-cli` against the `fossa-deps` file generated by `fossa:do_fossa`,
16+
# This task runs `fossa-cli-native` against the `fossa-deps` file generated by `fossa:do_fossa`,
1717
# analyzing the file and storing its results in the FOSSA backend.
1818
#
1919
# This task is run after `do_rootfs` is finalized (`fossa:do_fossa` runs as a post-processing
@@ -54,8 +54,8 @@ def run_fossa_cli(d, cli_args):
5454
BINDIR = d.getVar("bindir")
5555
WORKDIR = d.getVar("WORKDIR")
5656

57-
cli_path = (f"{WORKDIR}/recipe-sysroot{BINDIR}/fossa")
58-
cmds = [cli_path] + cli_args
57+
fossa_cli = ("fossa")
58+
cmds = [fossa_cli] + cli_args
5959
bb.plain(f"running: {' '.join(cmds)}")
6060

6161
out = subprocess.run(cmds, cwd=d.getVar("FOSSA_STAGING_DIR"), capture_output=True, text=True, shell=False)

recipes-extended/fossa/fossa-cli.bb

+1
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,4 @@ do_install() {
7676
}
7777

7878
INSANE_SKIP_${PN} += "already-stripped"
79+
BBCLASSEXTEND = "native"

0 commit comments

Comments
 (0)