[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#679829: britney: breakage of packages on removal of virtual packages



On 2012-07-02 00:19, Adam D. Barratt wrote:
> On Mon, 2012-07-02 at 00:12 +0200, Niels Thykier wrote:
>> --- a/britney.py
>> +++ b/britney.py
>> @@ -600,8 +600,8 @@ class Britney(object):
>>                  # register real packages
>>                  if a[0] in packages and (not check_doubles or pkg not in packages[a[0]][RDEPENDS]):
>>                      packages[a[0]][RDEPENDS].append(pkg)
>> -                # register packages which provide a virtual package
>> -                elif a[0] in provides:
>> +                # also register packages which provide a virtual package (if any)
>> +                if a[0] in provides:
>>                      for i in provides.get(a[0]):
>>                          if i not in packages: continue
>>                          if not check_doubles or pkg not in packages[i][RDEPENDS]: 
> 
> Hmmm, does the rconflicts block immediately below not need the same
> change?
> 
> Regards,
> 
> Adam
> 

Seems reasonable.  I am not able to produce a test for that case.
However, that may just be a lack of imagination on my part, so here is
an updated patch.

~Niels



>From bbc59621e91131fec4048a22bb01bc31d8b42846 Mon Sep 17 00:00:00 2001
From: Niels Thykier <niels@thykier.net>
Date: Sun, 1 Jul 2012 23:52:48 +0200
Subject: [PATCH] Always include providers of virtual packages in rdepends

Signed-off-by: Niels Thykier <niels@thykier.net>
---
 britney.py |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/britney.py b/britney.py
index 5205f64..c7e3bda 100755
--- a/britney.py
+++ b/britney.py
@@ -600,8 +600,8 @@ class Britney(object):
                 # register real packages
                 if a[0] in packages and (not check_doubles or pkg not in packages[a[0]][RDEPENDS]):
                     packages[a[0]][RDEPENDS].append(pkg)
-                # register packages which provide a virtual package
-                elif a[0] in provides:
+                # also register packages which provide the package (if any)
+                if a[0] in provides:
                     for i in provides.get(a[0]):
                         if i not in packages: continue
                         if not check_doubles or pkg not in packages[i][RDEPENDS]:
@@ -613,8 +613,8 @@ class Britney(object):
                     # register real packages
                     if a[0] in packages and (not check_doubles or pkg not in packages[a[0]][RCONFLICTS]):
                         packages[a[0]][RCONFLICTS].append(pkg)
-                    # register packages which provide a virtual package
-                    elif a[0] in provides:
+                    # also register packages which provide the package (if any)
+                    if a[0] in provides:
                         for i in provides[a[0]]:
                             if i not in packages: continue
                             if not check_doubles or pkg not in packages[i][RCONFLICTS]:
-- 
1.7.10


Reply to: