[PATCH setup] Finish providing support for provides: and conflicts:

Jon Turney jon.turney@dronecode.org.uk
Fri Jul 6 16:28:00 GMT 2018


On 23/06/2018 16:09, Ken Brown wrote:
>> I'll try again to reproduce this, but it might be a few days until I 
>> can get to it.
> 
> Here's a recipe for reproducing the problem:
> 
> 1. Create a repository with two packages, A and B, and two versions 1-1 
> and 2-1 of each.  Make A-1-1 require B>=1, and make A-2-1 require B>=2. 
> The attached script does all this.
> 
> 2. Run setup on this repo and install A-1-1 and B-1-1.
> 
> 3. Run setup again.  It will offer to update both A and B.  Choose to 
> keep B and press 'Next'.
> 
> setup built from the current HEAD correctly reports the dependency 
> problem.  But if I apply my patch, then setup doesn't report the problem 
> and lets me proceed to update A without updating B.
Thanks very much for this testcase, it helped a lot.

This looks like completely my fault:  SolvableVersion::deplist()'s 
handling of dependencies with a version relation was completely bogus.

So provides() on B was always returning unversioned B, rather than 
B-1-1, so the installed B ended up with that as provides, which appears 
to be enough to satisfy a depends of B-2-1.

(previously we'd just have the correct, implicit provide made at 
libsolv.cpp:472)

Attached patch seems to make it work.

-------------- next part --------------
From 5947bc929bc772bf067a6b457fc825bbbfc4b0e6 Mon Sep 17 00:00:00 2001
From: Jon Turney <jon.turney@dronecode.org.uk>
Date: Fri, 6 Jul 2018 17:16:16 +0100
Subject: [PATCH setup] Fix SolvableVersion::deplist() to handle
 version-relations correctly

This was using completely the wrong Id for the version-relation, so it was
always returning unversioned dependencies
---
 libsolv.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libsolv.cc b/libsolv.cc
index fc61651..63942b2 100644
--- a/libsolv.cc
+++ b/libsolv.cc
@@ -159,9 +159,9 @@ SolvableVersion::deplist(Id keyname) const
           const char *name = pool_id2str(pool, q.elements[i]);
           PackageSpecification *spec = new PackageSpecification (name);
 
-          if (ISRELDEP(id))
+          if (ISRELDEP(q.elements[i]))
             {
-              Reldep *rd = GETRELDEP(pool, id);
+              Reldep *rd = GETRELDEP(pool, q.elements[i]);
               spec->setOperator(RelId2Operator(rd->flags));
               spec->setVersion(pool_id2str(pool, rd->evr));
             }
-- 
2.17.0



More information about the Cygwin-apps mailing list