From 9461d4788412f8e198e475acf939efaf0e439a97 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Jan 28 2023 17:57:03 +0000 Subject: critpath.py: don't crash if a group is missing on an arch Nothing in critical-path-standard exists on s390x, apparently, and the script didn't like that. Signed-off-by: Adam Williamson --- diff --git a/scripts/critpath.py b/scripts/critpath.py index 076eb89..0894d86 100755 --- a/scripts/critpath.py +++ b/scripts/critpath.py @@ -19,6 +19,7 @@ import shutil from tempfile import mkdtemp from urllib.request import urlopen import dnf +import dnf.exceptions class SackError(Exception): @@ -153,7 +154,12 @@ def expand_dnf_critpath(urls, arch): # load up the comps data from configured repositories base.read_comps() group = group.replace("@", "") - base.group_install(group, ["mandatory", "default", "optional"], strict=False) + try: + base.group_install(group, ["mandatory", "default", "optional"], strict=False) + except dnf.exceptions.CompsError as err: + if str(err).startswith("Group id") and str(err).endswith("does not exist."): + print(f"Warning: group {group} does not exist for arch {conf.arch}") + continue # resolve the groups marked in base object base.resolve() packages[group] = base.transaction.install_set