On Fri, Nov 26, 2010 at 06:42:59PM +0100, Michael Schroeder wrote:
> On Mon, Aug 09, 2010 at 06:43:18PM +0300, Anssi Hannula wrote:
> > Currently [1], if a package has
> > Provides: foo = 1.2
> > And another package has
> > Conflicts: foo < 1.2-1
> > 
> > The conflict does not trigger, as the releases will be ignored if one of 
> > the 
> > compared EVRs does not have it. (mdv bug #55810 [2])
> > 
> > Another similar case is:
> > A: Provides: foo = 1.2
> > B: Requires: foo = 1.2-2  (or >= 1.2-2)
> > The provides will match, which it IMHO should not be doing.
> 
> Most people think that "Provides: foo = 1.2" means that the
> package provides all releases of foo, thus it should match.
> Works good for Requires, doesn't work that well for Conflicts.

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.

Cheers,
  Michael.

-- 
Michael Schroeder                                   m...@suse.de
SUSE LINUX Products GmbH, GF Markus Rex, HRB 16746 AG Nuernberg
main(_){while(_=~getchar())putchar(~_-1/(~(_|32)/13*2-11)*13);}
--- lib/rpmds.c.orig	2010-11-26 18:45:52.000000000 +0000
+++ lib/rpmds.c	2010-11-26 18:54:42.000000000 +0000
@@ -736,8 +736,19 @@ int rpmdsCompare(const rpmds A, const rp
 
     if (sense == 0) {
 	sense = rpmvercmp(aV, bV);
-	if (sense == 0 && aR && *aR && bR && *bR)
-	    sense = rpmvercmp(aR, bR);
+	if (sense == 0) {
+	    if (aR && *aR && bR && *bR) {
+		sense = rpmvercmp(aR, bR);
+	    } else {
+		/* always matches if the side with no release has SENSE_EQUAL */
+		if ((aR && *aR && (B->Flags[B->i] & RPMSENSE_EQUAL)) ||
+		    (bR && *bR && (A->Flags[A->i] & RPMSENSE_EQUAL))) {
+		    aEVR = _free(aEVR);
+		    bEVR = _free(bEVR);
+		    result = 1;
+		    goto exit;
+		}
+	    }
     }
     aEVR = _free(aEVR);
     bEVR = _free(bEVR);
_______________________________________________
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint

Reply via email to