Is it valid to use 2 requires of the same dependency for min / max versions? For example, I have a package "foo" that depends on package "bar" >= 1.0 and also "bar" < 2.0.
I have seen many packages use this: Requires: bar >= 1.0 Conflicts: bar >= 2.0
but I would like to use the following (which may help with finding dependencies using repoquery): Requires: bar >= 1.0 Requires: bar < 2.0
Shawn
On 03/07/2013 09:47 AM, Shawn Iwinski wrote:
Is it valid to use 2 requires of the same dependency for min / max versions? For example, I have a package "foo" that depends on package "bar" >= 1.0 and also "bar" < 2.0.
I have seen many packages use this: Requires: bar >= 1.0 Conflicts: bar >= 2.0
but I would like to use the following (which may help with finding dependencies using repoquery): Requires: bar >= 1.0 Requires: bar < 2.0
If you have access to modify "bar", I'd suggest one way of tackling issues like this is adding a virtual Provides to bar.spec like:
Provides: bar1 = %{version}-%{release}
So, now you can avoid the above examples you mentioned using just:
Requires: bar1 (versioned or not)
-- rex
Good idea Rex, but I am not sure that will work for my exact case. PHP PEAR requires already use virtual pkgs. Here are a couple real examples I have:
Requires: php-pear(pear.twig-project.org/Twig) >= 1.0 Requires: php-pear(pear.twig-project.org/Twig) < 2.0
Requires: php-pear(pear.doctrine-project.org/DoctrineCommon) >= 2.3.0 Requires: php-pear(pear.doctrine-project.org/DoctrineCommon) < 2.4.0
On Thu, Mar 7, 2013 at 10:54 AM, Rex Dieter rdieter@math.unl.edu wrote:
On 03/07/2013 09:47 AM, Shawn Iwinski wrote:
Is it valid to use 2 requires of the same dependency for min / max versions? For example, I have a package "foo" that depends on package "bar" >= 1.0 and also "bar" < 2.0.
I have seen many packages use this: Requires: bar >= 1.0 Conflicts: bar >= 2.0
but I would like to use the following (which may help with finding dependencies using repoquery): Requires: bar >= 1.0 Requires: bar < 2.0
If you have access to modify "bar", I'd suggest one way of tackling issues like this is adding a virtual Provides to bar.spec like:
Provides: bar1 = %{version}-%{release}
So, now you can avoid the above examples you mentioned using just:
Requires: bar1 (versioned or not)
-- rex
packaging mailing list packaging@lists.fedoraproject.**org packaging@lists.fedoraproject.org https://admin.fedoraproject.**org/mailman/listinfo/packaginghttps://admin.fedoraproject.org/mailman/listinfo/packaging
Le Jeu 7 mars 2013 16:47, Shawn Iwinski a écrit :
Is it valid to use 2 requires of the same dependency for min / max versions? For example, I have a package "foo" that depends on package "bar" >= 1.0 and also "bar" < 2.0.
I have seen many packages use this: Requires: bar >= 1.0 Conflicts: bar >= 2.0
but I would like to use the following (which may help with finding dependencies using repoquery): Requires: bar >= 1.0 Requires: bar < 2.0
That will almost certainly *not* do what you intend, as a system with a package providing bar 0.9 and another providing bar 3.0 will satisfy your rules. You you want a real version range you can't avoid Conflicts, as rpm evaluates Requires separately from one another.
Regards,
Dne 8.3.2013 10:57, Nicolas Mailhot napsal(a):
Le Jeu 7 mars 2013 16:47, Shawn Iwinski a écrit :
Is it valid to use 2 requires of the same dependency for min / max versions? For example, I have a package "foo" that depends on package "bar" >= 1.0 and also "bar" < 2.0.
I have seen many packages use this: Requires: bar >= 1.0 Conflicts: bar >= 2.0
but I would like to use the following (which may help with finding dependencies using repoquery): Requires: bar >= 1.0 Requires: bar < 2.0
That will almost certainly *not* do what you intend, as a system with a package providing bar 0.9 and another providing bar 3.0 will satisfy your rules.
And that is no true. Try it. YUM can handle it as expected.
Vít
You you want a real version range you can't avoid Conflicts, as rpm evaluates Requires separately from one another.
Regards,
Le Ven 8 mars 2013 11:50, Vít Ondruch a écrit :
Dne 8.3.2013 10:57, Nicolas Mailhot napsal(a):
Le Jeu 7 mars 2013 16:47, Shawn Iwinski a écrit :
Is it valid to use 2 requires of the same dependency for min / max versions? For example, I have a package "foo" that depends on package "bar" >= 1.0 and also "bar" < 2.0.
I have seen many packages use this: Requires: bar >= 1.0 Conflicts: bar >= 2.0
but I would like to use the following (which may help with finding dependencies using repoquery): Requires: bar >= 1.0 Requires: bar < 2.0
That will almost certainly *not* do what you intend, as a system with a package providing bar 0.9 and another providing bar 3.0 will satisfy your rules.
And that is no true. Try it. YUM can handle it as expected.
so it's ok if it fails in rpm but works in yum? (just asking)
Dne 8.3.2013 13:54, Nicolas Mailhot napsal(a):
Le Ven 8 mars 2013 11:50, Vít Ondruch a écrit :
Dne 8.3.2013 10:57, Nicolas Mailhot napsal(a):
Le Jeu 7 mars 2013 16:47, Shawn Iwinski a écrit :
Is it valid to use 2 requires of the same dependency for min / max versions? For example, I have a package "foo" that depends on package "bar" >= 1.0 and also "bar" < 2.0.
I have seen many packages use this: Requires: bar >= 1.0 Conflicts: bar >= 2.0
but I would like to use the following (which may help with finding dependencies using repoquery): Requires: bar >= 1.0 Requires: bar < 2.0
That will almost certainly *not* do what you intend, as a system with a package providing bar 0.9 and another providing bar 3.0 will satisfy your rules.
And that is no true. Try it. YUM can handle it as expected.
so it's ok if it fails in rpm but works in yum? (just asking)
For me it is OK and for 99,9 % of Fedora users, who installs packages using YUM, it is OK as well, I would say.
Vít
packaging@lists.fedoraproject.org