From f8e3dead56e41c6793eedff338bf09ba819f7cbc Mon Sep 17 00:00:00 2001 From: Auke Kok Date: Tue, 13 Aug 2019 14:51:32 -0700 Subject: [PATCH] Abirepot: omit -extras- subrpms. We don't want to make bundles that include all the deps for *extras* rpms, these are most likely removed or optional components. We may have to create separate used_libs_extras files for them instead. We ignore the package name when searching for -extras-. --- autospec/abireport.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/autospec/abireport.py b/autospec/abireport.py index 9d205a0..4e338e8 100644 --- a/autospec/abireport.py +++ b/autospec/abireport.py @@ -27,6 +27,7 @@ import shutil import subprocess import sys +import tarball import util valid_dirs = ["/usr/lib", "/usr/lib64"] @@ -219,8 +220,20 @@ def examine_abi(download_path): def examine_abi_host(download_path, results_dir): """Make use of the hostside abireport tool.""" + rpms = set() + for item in os.listdir(results_dir): + namelen = len(tarball.name) + if item.find("-extras-", namelen) >= namelen: + continue + if item.endswith(".rpm") and not item.endswith(".src.rpm"): + rpms.add("{}/{}".format(results_dir, item)) + + if len(rpms) == 0: + util.print_fatal("No usable rpms found, aborting") + sys.exit(1) + try: - util.call("abireport scan-packages \"{}\"".format(results_dir), + util.call("abireport scan-packages {}".format(" ".join(rpms)), cwd=download_path) except Exception as e: util.print_fatal("Error invoking abireport: {}".format(e)) @@ -232,6 +245,9 @@ def examine_abi_fallback(download_path, results_dir): rpms = set() for item in os.listdir(results_dir): + namelen = len(tarball.name) + if item.find("-extras-", namelen) >= namelen: + continue if item.endswith(".rpm") and not item.endswith(".src.rpm"): rpms.add(os.path.basename(item))