From 7f9df48b0040499c5de3441f56d1f1ed77667526 Mon Sep 17 00:00:00 2001 From: Michal Hecko Date: Sun, 15 Jun 2025 23:39:17 +0200 Subject: [PATCH 61/66] userspacegen: do not repolist source & debug repos Ignore source/debug repositories when running dnf repolist to check what repositories are available for the upgrade. Should prevent needless crashes when the source/debug repositories are malformed, e.g., when the maintainer forgot to sync their content. --- .../targetuserspacecreator/libraries/userspacegen.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py b/repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py index 699f1517..9ec4ecac 100644 --- a/repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py +++ b/repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py @@ -929,7 +929,13 @@ def _get_rh_available_repoids(context, indata): os.rename(foreign_repofile, '{0}.back'.format(foreign_repofile)) try: - dnf_cmd = ['dnf', 'repolist', '--releasever', target_ver, '-v', '--enablerepo', '*'] + dnf_cmd = [ + 'dnf', 'repolist', + '--releasever', target_ver, '-v', + '--enablerepo', '*', + '--disablerepo', '*-source-*', + '--disablerepo', '*-debug-*', + ] repolist_result = context.call(dnf_cmd)['stdout'] repoid_lines = [line for line in repolist_result.split('\n') if line.startswith('Repo-id')] rhui_repoids = {extract_repoid_from_line(line) for line in repoid_lines} -- 2.50.1