Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dunfell patch provided by Baxter #11

Open
wants to merge 1 commit into
base: dunfell
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions classes/fossa.bbclass
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ python do_fossa_pkg() {
# this way it is able to capture the output of `do_fossa_pkg` for every
# package that was processed.
python do_fossa() {
from oe.rootfs import image_list_installed_packages

if not is_fossa_enabled(d):
bb.debug(1, "Since FOSSA_ENABLED is 0, skipping: creating fossa-deps.json")
return
Expand All @@ -93,13 +95,14 @@ python do_fossa() {

metadata_dir = d.getVar('FOSSA_METADATA_RECIPES')
pkg_metadata = all_pkg_metadata(d, metadata_dir)
pkgs = image_list_installed_packages(d)

installed_pkgs = []
for pkg in pkg_metadata:
for pkg in pkgs:
try:
installed_pkgs.append(mk_user_dependencies(pkg_metadata[pkg]))
except Exception as err:
bb.error(f'failed to retrieve pkg metadata for {pkg} because: {err}')
except Exception:
pass

# Ensure path exists
fossa_deps_dir = d.getVar("FOSSA_STAGING_DIR")
Expand Down
10 changes: 5 additions & 5 deletions classes/fossa_upload.bbclass
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ inherit fossa_utils
addtask do_fossa_analyze before do_build after do_rootfs
do_fossa_analyze[doc] = "Analyze via fossa-cli"
do_fossa_analyze[nostamp] = "1"
do_fossa_analyze[depends] = "fossa-cli:do_populate_sysroot"
do_fossa_analyze[depends] = "fossa-cli-native:do_populate_sysroot"

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

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

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

out = subprocess.run(cmds, cwd=d.getVar("FOSSA_STAGING_DIR"), capture_output=True, text=True, shell=False)
Expand Down
1 change: 1 addition & 0 deletions recipes-extended/fossa/fossa-cli.bb
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,4 @@ do_install() {
}

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