From cd0eaf7ec9ad211da8d50673c22352b246eebca8 Mon Sep 17 00:00:00 2001 From: Joachim Gleissner Date: Wed, 8 Nov 2023 08:59:57 +0000 Subject: [PATCH] generate_sbom: fix support for older RPM versions Do not abort in dump_rpmdb in case rpmdb does not support --exportdb but use fallback using /usr/lib/rpm/rpmdb_dump. --- generate_sbom | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/generate_sbom b/generate_sbom index 0d819857b..16f983d50 100755 --- a/generate_sbom +++ b/generate_sbom @@ -173,9 +173,9 @@ sub dump_rpmdb { } else { system_chroot($root, 'stdout', $outfile, '/usr/bin/rpmdb', '--exportdb'); } + exit($?) if $?; + return; } - exit($?) if $?; - return; } # try to get the dbpath from the root if we can if (!$dbpath && can_run($root, '/usr/bin/rpm')) {