[Rpm-ecosystem] Rich deps syntax finalization
ffesti at redhat.com
Wed Aug 26 08:47:43 UTC 2015
On 08/25/2015 06:58 PM, Neal Gompa wrote:
> I consider the NOT evaluation to be useful for intent more than anything
> For example: "Requires: (pkgA IF NOT pkgB)" or "Requires: (IF NOT pkgB
> THEN pkgA)"
> That lines says two things to me:
> * The package prefers pkgB over pkgA
> * Either option works (functionally an OR operation)
> This could be handy for declaring priority of dependencies based on what
> functionality it provides.
> For a more concrete example, suppose I have a package that has a runtime
> dependency on a kmod package. However, the kmod package is available in
> several forms (akmod, dkms, and finally kmod). I could set up something
> like this:
> "Requires: (IF NOT (IF NOT module-kmod THEN module-akmod) THEN
> If read with the intent given, then that means that if module-kmod
> isn't installable, then use module-akmod. If that's not installable,
> then use module-dkms.
> Or maybe I'm misreading how this would work, but that's how I interpret it.
You are actually not that far from the truth:
As (. IF .) is equivalent to (. OR NOT .) (. IF NOT .) is equivalent
to (. OR .). So you are writing things more complicated than needed. You
can just write (module-kmod OR module-akmod OR module-dkms). This is
exactly the same.
Right now libsolv does not distinguish between different orders of the
operands. But we have already discussed making the OR operator
preferring the left most operand. This is something RPM does not really
care about but of cause has implications for packaging if implemented in
Red Hat GmbH, http://www.de.redhat.com/ Registered seat: Grasbrunn,
Commercial register: Amtsgericht Muenchen, HRB 153243,
Managing Directors: Charles Cachera, Michael Cunningham, Michael
O'Neill, Charles Peters
More information about the Rpm-ecosystem