From ffcafb390d271588a962f4f302b84ecd557f12c5 Mon Sep 17 00:00:00 2001 From: Simon de Vlieger Date: Wed, 22 Jan 2025 09:54:03 +0100 Subject: [PATCH] depsolve: relax the module naming requirement Remove the requirement for `:` in the name which would have been selected by the fronted, instead asking dnf "is this a module?". Signed-off-by: Simon de Vlieger --- osbuild/solver/dnf.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/osbuild/solver/dnf.py b/osbuild/solver/dnf.py index 9ac56ca7..1c52ccca 100755 --- a/osbuild/solver/dnf.py +++ b/osbuild/solver/dnf.py @@ -348,10 +348,14 @@ class DNF(SolverBase): modules = {} for transaction in transactions: - # module specifications must start with an "@" and include a ":", filter them - # out so we can use them - modules_in_package_specs = [ - p[1:] for p in transaction.get("package-specs", []) if p.startswith("@") and ":" in p] + # module specifications must start with an "@", if they do we try to + # ask DNF for a module by that name, if it doesn't exist it isn't a + # module; otherwise it is and we should use it + modules_in_package_specs = [] + + for p in transaction.get("package-specs", []): + if p.startswith("@") and self.base_module.get_modules(p): + modules_in_package_specs.append(p.lstrip("@")) if transaction.get("module-enable-specs") or modules_in_package_specs: # we'll be checking later if any packages-from-modules are in the