5

On inspecting dependencies of RHEL8 packages, I recently came across the following dependency statement:

~$ rpm -qpv --requires cockpit-ws-264.1-1.0.1.el8.x86_64.rpm 
post: (policycoreutils if selinux-policy-targeted)
manual: (selinux-policy >= 3.14.3-95.0.1.el8 if selinux-policy-targeted)
...

I understand the or type requirement statements, but how does the RPM package management process if-type dependencies?

  • In the above example, does it mean that policycoreutils is only a requirement if selinux-policy-targeted is already present in the target system?
  • Likewise, is selinux-policy only required if selinux-policy-targeted is already installed? Or is it the version requirement (>= 3.14.3-95.0.1.el8) that only applies if selinux-policy-targeted is installed (although that would deviate from the meaning in case of or-type requirements)?

1 Answer 1

4

a if b is equivalent to a or not(b), so yes, policycoreutils is only a requirement if selinux-policy-targeted is installed.

The if operator applies to the whole dependency, so selinux-policy >= 3.14.3-95.0.1.el8 is only required if selinux-policy-targeted is installed.

if in this context is a boolean operator in RPM, and is documented in the Boolean Dependencies section of the RPM Reference Manual.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .