#111 Add weak dependency prioritizing targeted package
Closed 3 years ago by vmojzis. Opened 3 years ago by vmojzis.
rpms/ vmojzis/selinux-policy enhances  into  master

file modified
+1
@@ -555,6 +555,7 @@ 

  Conflicts:  seedit

  Conflicts:  389-ds-base < 1.2.7, 389-admin < 1.1.12

  Conflicts: container-selinux < 2:1.12.1-22

+ Enhances: selinux-policy

  

  %description targeted

  SELinux Reference policy targeted base module.

Whenever a package requiring selinux-policy package is installed on a
system with no package covering selinux-policy-base,
selinux-policy-minimum is chosen (alphabetical order).
Use weak dependency to prioritise selinux-policy-targeted in this case.

Note: Adding "Suggests: selinux-policy-targeted" to selinux-policy
section has the same effect

Enhances/Suggests is documented as a "very weak" dependency type, meaning "By default the dependency solver shall ignore them. But they may be used to show the matching packages as option to the user."
So does this solution actually work or did I misunderstood the doc?
https://rpm.org/user_doc/dependencies.html

Enhances/Suggests is documented as a "very weak" dependency type, meaning "By default the dependency solver shall ignore them. But they may be used to show the matching packages as option to the user."
So does this solution actually work or did I misunderstood the doc?
https://rpm.org/user_doc/dependencies.html

https://fedoraproject.org/wiki/Packaging:WeakDependencies:
If there are multiple (typically virtual) providers for a dependency the requiring package may add a Suggests: to provide a hint to the dependency resolver as to which poption is preferred.
I tested it and "dnf install selinux-policy" on a system without selinux-policy* will install selinux-policy-targeted...
But the following enhancement of this approach should also work with packages requiring selinux-policy-base (as opposed to this patch where it only only packages requiring selinux-policy are affected)... https://src.fedoraproject.org/rpms/selinux-policy/pull-request/110#comment-57299

This PR can also be closed, right?

Pull-Request has been closed by vmojzis

3 years ago