<div dir="ltr"><div class="gmail_default" style="font-family:times new roman,serif;font-size:large"><span style="font-family:arial,sans-serif;font-size:small">On Wed, Aug 26, 2015 at 6:13 AM, Neal Gompa </span><span dir="ltr" style="font-family:arial,sans-serif;font-size:small"><<a href="mailto:ngompa13@gmail.com" target="_blank">ngompa13@gmail.com</a>></span><span style="font-family:arial,sans-serif;font-size:small"> wrote:</span><br></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div class="h5"><div style="font-family:times new roman,serif;font-size:large"><span style="font-family:arial,sans-serif;font-size:small">On Wed, Aug 26, 2015 at 4:47 AM, Florian Festi </span><span dir="ltr" style="font-family:arial,sans-serif;font-size:small"><<a href="mailto:ffesti@redhat.com" target="_blank">ffesti@redhat.com</a>></span><span style="font-family:arial,sans-serif;font-size:small"> wrote:</span><br></div></div></div><div class="gmail_extra"><div><div class="h5"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>On 08/25/2015 06:58 PM, Neal Gompa wrote:<br>
> I consider the NOT evaluation to be useful for intent more than anything<br>
> else.<br>
><br>
> For example: "Requires: (pkgA IF NOT pkgB)" or "Requires: (IF NOT pkgB<br>
> THEN pkgA)"<br>
> That lines says two things to me:<br>
><br>
</span>>   * The package prefers pkgB over pkgA<br>
>   * Either option works (functionally an OR operation)<br>
<span>><br>
> This could be handy for declaring priority of dependencies based on what<br>
> functionality it provides.<br>
><br>
> For a more concrete example, suppose I have a package that has a runtime<br>
> dependency on a kmod package. However, the kmod package is available in<br>
> several forms (akmod, dkms, and finally kmod). I could set up something<br>
> like this:<br>
><br>
> "Requires: (IF NOT (IF NOT module-kmod THEN module-akmod) THEN<br>
> module-dkms)"<br>
><br>
> ​If read with the intent given, then that means that if module-kmod<br>
> isn't installable, then use module-akmod. If that's not installable,<br>
> then use module-dkms.<br>
><br>
> Or maybe I'm misreading how this would work, but that's how I interpret it.<br>
<br>
</span>You are actually not that far from the truth:<br>
<br>
As (. IF  .) is equivalent to (. OR NOT .) (. IF NOT .) is  equivalent<br>
to (. OR .). So you are writing things more complicated than needed. You<br>
can just write (module-kmod OR module-akmod OR module-dkms). This is<br>
exactly the same.<br>
<br>
Right now libsolv does not distinguish between different orders of the<br>
operands. But we have already discussed making the OR operator<br>
preferring the left most operand. This is something RPM does not really<br>
care about but of cause has implications for packaging if implemented in<br>
libsolv.<br>
<span><br>
Florian<br>
<br>
<br>
--<br>
<br>
Red Hat GmbH, <a href="http://www.de.redhat.com/" rel="noreferrer" target="_blank">http://www.de.redhat.com/</a> Registered seat: Grasbrunn,<br>
Commercial register: Amtsgericht Muenchen, HRB 153243,<br>
Managing Directors: Charles Cachera, Michael Cunningham, Michael<br>
O'Neill, Charles Peters</span></blockquote></div><br></div></div><div style="font-family:'times new roman',serif;font-size:large">​Well, my assumption was that OR doesn't have short-circuit logic in place, or that it has a particular ordering. The logic I wrote technically enforces the order by explicitly declaring how I want the resolution to take place. It's essentially more expressive than just saying "Requires: (module-kmod OR module-akmod OR module-dkms)".​ The three-term OR statement does not make it obvious what the preference actually is.</div><div style="font-family:'times new roman',serif;font-size:large"><br></div><div style="font-family:'times new roman',serif;font-size:large">I think there's a place for having equally weighted ordering as well as priority oriented ordering. There are circumstances where either one could be useful. The intent is also important if the user has none of the providers installed already. If one of them is already installed, obviously we shouldn't install something new, but if none of the Requires are satisfied by the package set already installed, then it should pick one or bomb out depending on what you want it to do.</div><span class=""><div><br></div>
</span></div></div>
</blockquote></div><br><div class="gmail_default" style="font-family:'times new roman',serif;font-size:large">​Actually, I want to append to this slightly. I would expect that an equal weighted OR Requires would be depsolved by choosing the dependency that drags in the fewest dependencies unless the user explicitly suggests otherwise.​</div><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">真実はいつも一つ!/ Always, there's only one truth!<br></div></div>
</div><font face="yw-402608bc37fe50adb11a5899295781aeb83d248d-d0c066349bc7106e9edb0280ec8da0d6--o" style="display: none;"></font></div>