depsolve: use modules-in-package-specs
This changes the depsolver to expect modules inside the normal `package-specs` instead of having a separate `module-install-specs`. Modules passed to a "normal" `dnf install` must start with an `@` and contain a `:`. This is up to the user to pass correctly. Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
This commit is contained in:
parent
0c0580a570
commit
52b4ba7e63
1 changed files with 10 additions and 5 deletions
|
|
@ -274,9 +274,9 @@ class DNF(SolverBase):
|
||||||
self.base_module.enable(transaction.get("module-enable-specs", []))
|
self.base_module.enable(transaction.get("module-enable-specs", []))
|
||||||
|
|
||||||
# installing a module takes the specification of the module and then
|
# installing a module takes the specification of the module and then
|
||||||
# installs all packages belonging to it
|
# installs all packages belonging to its default group, modules to
|
||||||
self.base_module.install(transaction.get("module-install-specs", []))
|
# install are listed directly in `package-specs` but prefixed with an
|
||||||
|
# `@` *and* containing a `:` this is up to the user of the depsolver
|
||||||
self.base.install_specs(
|
self.base.install_specs(
|
||||||
transaction.get("package-specs"),
|
transaction.get("package-specs"),
|
||||||
transaction.get("exclude-specs"),
|
transaction.get("exclude-specs"),
|
||||||
|
|
@ -349,14 +349,19 @@ class DNF(SolverBase):
|
||||||
modules = {}
|
modules = {}
|
||||||
|
|
||||||
for transaction in transactions:
|
for transaction in transactions:
|
||||||
if transaction.get("module-install-specs") or transaction.get("module-enable-specs"):
|
# 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]
|
||||||
|
|
||||||
|
if transaction.get("module-enable-specs") or modules_in_package_specs:
|
||||||
# we'll be checking later if any packages-from-modules are in the
|
# we'll be checking later if any packages-from-modules are in the
|
||||||
# packages-to-install set so let's do this only once here
|
# packages-to-install set so let's do this only once here
|
||||||
package_nevras = list(p["nevra"] for p in packages)
|
package_nevras = list(p["nevra"] for p in packages)
|
||||||
|
|
||||||
for module_spec in itertools.chain(
|
for module_spec in itertools.chain(
|
||||||
transaction.get("module-install-specs", []),
|
|
||||||
transaction.get("module-enable-specs", []),
|
transaction.get("module-enable-specs", []),
|
||||||
|
modules_in_package_specs,
|
||||||
):
|
):
|
||||||
module_packages, module_nsvcap = self.base_module.get_modules(module_spec)
|
module_packages, module_nsvcap = self.base_module.get_modules(module_spec)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue