[yum-commits] Branch 'yum-3_2_X' - 3 commits - output.py test/depsolvetests.py yum/depsolve.py

James Antill james at osuosl.org
Wed Apr 15 20:17:53 UTC 2009


 output.py             |    9 +++++----
 test/depsolvetests.py |   19 +++++++++++++++++++
 yum/depsolve.py       |   10 ++++++++++
 3 files changed, 34 insertions(+), 4 deletions(-)

New commits:
commit 11dc235690a84aba4f1cf32d2d6846a6a3363297
Author: James Antill <james at and.org>
Date:   Wed Apr 15 16:16:08 2009 -0400

    Likely fix for only old packages providing stuff

diff --git a/yum/depsolve.py b/yum/depsolve.py
index 819adac..0c09a2c 100644
--- a/yum/depsolve.py
+++ b/yum/depsolve.py
@@ -1089,6 +1089,16 @@ class Depsolve(object):
             for nextpo in pkgs:
                 if po == nextpo:
                     continue
+
+                #  If this package isn't the latest version of said package,
+                # treat it like it's obsoleted. The problem here is X-1
+                # accidentally provides FOO, so you release X-2 without the
+                # provide, but X-1 is still picked over a real provider.
+                na = (po.name,po.arch)
+                lpos = self.pkgSack.returnNewestByNameArch(naTup=na)
+                if not lpos or po != sorted(lpos)[-1]:
+                    pkgresults[po] -= 1024
+
                 obsoleted = False
                 poprovtup = (po.name, 'EQ', (po.epoch, po.ver, po.release))
                 if nextpo.inPrcoRange('obsoletes', poprovtup):
commit 9583414a41393ab5418981ef055b2f3c2b69ebfc
Author: James Antill <james at and.org>
Date:   Wed Apr 15 16:13:57 2009 -0400

    Test for old pkg provides stuff it shouldn't problem

diff --git a/test/depsolvetests.py b/test/depsolvetests.py
index 2ff4f85..e6c4619 100644
--- a/test/depsolvetests.py
+++ b/test/depsolvetests.py
@@ -1177,3 +1177,22 @@ class DepsolveTests(DepsolveTests):
         self.assertEquals('ok', *self.resolveCode())
         self.assertResult((apo1, apo2))
 
+    def testInstalllib_oldbad_prov1(self):
+        # old version of X provides foo, as does foo itself
+        # new version of X doesn't provide foo
+        # So X shouldn't be installed as a provider of foo.
+        apo1 = FakePackage('X')
+        apo1.addProvides('libfoo.so.2()', None, (None, None, None))
+        self.xsack.addPackage(apo1)
+        apo2 = FakePackage('X', version=2)
+        self.xsack.addPackage(apo2)
+        apo3 = FakePackage('libfoo')
+        apo3.addProvides('libfoo.so.2()', None, (None, None, None))
+        self.xsack.addPackage(apo3)
+
+        ipo1 = FakePackage('bar')
+        ipo1.addRequires('libfoo.so.2()', None, (None, None, None))
+        self.tsInfo.addInstall(ipo1)
+
+        self.assertEquals('ok', *self.resolveCode())
+        self.assertResult((ipo1, apo3))
commit 7dd2634529541c9f4a1b4fd71e9155d294a3ffa3
Author: James Antill <james at and.org>
Date:   Wed Apr 15 15:53:18 2009 -0400

    Magic i18n sprinkles to fix yum provides on pkgs with (R) in them

diff --git a/output.py b/output.py
index 16da351..099f8fc 100755
--- a/output.py
+++ b/output.py
@@ -833,18 +833,19 @@ class YumOutput:
         print _("Repo        : %s") % po.repoid
         print _('Matched from:')
         for item in yum.misc.unique(values):
-            if po.name == item or po.summary == item:
+            item = to_utf8(item)
+            if to_utf8(po.name) == item or to_utf8(po.summary) == item:
                 continue # Skip double name/summary printing
 
             can_overflow = True
             if False: pass
-            elif po.description == item:
+            elif to_utf8(po.description) == item:
                 key = _("Description : ")
                 item = self._enc(item)
-            elif po.url == item:
+            elif to_utf8(po.url) == item:
                 key = _("URL         : %s")
                 can_overflow = False
-            elif po.license == item:
+            elif to_utf8(po.license) == item:
                 key = _("License     : %s")
                 can_overflow = False
             elif item.startswith("/"):


More information about the Yum-commits mailing list