[Rpm-maint] [RFC/PATCH] comparisons without release
Michael Schroeder
mls at suse.de
Mon Nov 29 17:11:59 UTC 2010
On Fri, Nov 26, 2010 at 08:23:40PM +0100, Michael Schroeder wrote:
> Having said that, the current behaviour seems to be quite broken.
> Please explain the following:
>
> Provides: foo > 1.2-1
> Requires: foo = 1.2 no match
>
> Provides: foo >= 1.2-1
> Requires: foo = 1.2 matches
>
> I think the attached patch (completely untested) may fix the issue,
> but I'll have to it through some tests on Monday.
Seems to work well (after a missing '}' is added). The patch changes
exactly the following cases:
Provides Requires/Conflicts/...
------------ -----------
foo = 1.2, foo < 1.2-1 no match -> match
foo = 1.2, foo > 1.2-1 no match -> match
foo <= 1.2, foo > 1.2-1 no match -> match
foo >= 1.2, foo < 1.2-1 no match -> match
foo < 1.2-1, foo = 1.2 no match -> match
foo < 1.2-1, foo >= 1.2 no match -> match
foo > 1.2-1, foo = 1.2 no match -> match
foo > 1.2-1, foo <= 1.2 no match -> match
The idea behind the patch is that a missing release is handled
as "all/any release". Nothing changes for "foo < 1.2" or
"foo > 1.2", it still just compares the version. But "foo = 1.2"
means "everything with version 1.2". Thus, any match against
a package with version "1.2" a any non-empty release must
return true.
I think the patch is safe to apply, it changes only the corner
cases listed above. Packages that put version-release in the
provides are never affected.
Updated version of the patch attached.
Cheers,
Michael.
--
Michael Schroeder mls at suse.de
SUSE LINUX Products GmbH, GF Markus Rex, HRB 16746 AG Nuernberg
main(_){while(_=~getchar())putchar(~_-1/(~(_|32)/13*2-11)*13);}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rpm-emptyrelease.diff
Type: text/x-patch
Size: 754 bytes
Desc: not available
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20101129/2458cee7/attachment.bin>
More information about the Rpm-maint
mailing list