Now we get very long skip-broken transaction listings with -d9

SKIPBROKEN:  update      : ocaml-runtime-3.12.0-3.fc15.x86_64
SKIPBROKEN:                   dependson : coccinelle-0.2.5-0.rc1.2.fc15.x86_64
SKIPBROKEN:                   dependson : coccinelle-0.2.5-0.rc1.2.fc15.x86_64
SKIPBROKEN:                   dependson : coccinelle-0.2.5-0.rc1.2.fc15.x86_64
SKIPBROKEN:                   dependson : coccinelle-0.2.5-0.rc1.2.fc15.x86_64
SKIPBROKEN:                   dependson : coccinelle-0.2.5-0.rc1.2.fc15.x86_64
SKIPBROKEN:                   dependson : coccinelle-0.2.5-0.rc1.2.fc15.x86_64
SKIPBROKEN:                   dependson : coccinelle-0.2.5-0.rc1.2.fc15.x86_64
SKIPBROKEN:                   dependson : coccinelle-0.2.5-0.rc1.2.fc15.x86_64
SKIPBROKEN:                   dependson : coccinelle-0.2.5-0.rc1.2.fc15.x86_64
SKIPBROKEN:                   dependson : coccinelle-0.2.5-0.rc1.2.fc15.x86_64

after this patch we will only get

SKIPBROKEN:  update      : ocaml-runtime-3.12.0-3.fc15.x86_64
SKIPBROKEN:                   dependson : coccinelle-0.2.5-0.rc1.2.fc15.x86_64
---
 test/skipbroken-tests.py |   32 ++++++++++++++++++++++++++++++++
 yum/__init__.py          |    2 +-
 2 files changed, 33 insertions(+), 1 deletions(-)

diff --git a/test/skipbroken-tests.py b/test/skipbroken-tests.py
index 9f09e87..7d2aa9c 100644
--- a/test/skipbroken-tests.py
+++ b/test/skipbroken-tests.py
@@ -638,6 +638,38 @@ class SkipBrokenTests(DepsolveTests):
         self.tsInfo.addUpdate(u1, oldpo=i1)
         self.assertEquals('empty', *self.resolveCode(skip=True))
         self.assertResult([i1,i2])
+
+    def testTransactionOutput(self):
+        '''  
+        Test that skip-broken transaction dump output dont show the 
+        dependon: xxx once.
+        '''
+        i1 = self.repoPackage('bar1', '1')
+        i1.addRequires('foo1', 'EQ', ('0', '1', '0'))
+        i1.addRequires('foo2', 'EQ', ('0', '1', '0'))
+        i1.addRequires('foo3', 'EQ', ('0', '1', '0'))
+        i1.addRequires('foo4', 'EQ', ('0', '1', '0'))
+        i1.addRequires('foo5', 'EQ', ('0', '1', '0'))
+        i1.addRequires('foo6', 'EQ', ('0', '1', '0'))
+        i2 = self.repoPackage('fooA', '1')
+        i2.addProvides('foo1', 'EQ', ('0', '1', '0'))
+        i3 = self.repoPackage('fooB', '1')
+        i3.addProvides('foo2', 'EQ', ('0', '1', '0'))
+        i4 = self.repoPackage('fooC', '1')
+        i4.addProvides('foo3', 'EQ', ('0', '1', '0'))
+        i5 = self.repoPackage('fooD', '1')
+        i5.addProvides('foo4', 'EQ', ('0', '1', '0'))
+        i6 = self.repoPackage('fooE', '1')
+        i6.addProvides('foo5', 'EQ', ('0', '1', '0'))
+        i7 = self.instPackage('fooF', '1')
+        i7.addProvides('foo6', 'EQ', ('0', '1', '0'))
+        u7 = self.instPackage('fooF', '2')
+        u7.addProvides('foo6', 'EQ', ('0', '2', '0'))
+        self.tsInfo.addInstall(i1)
+        self.tsInfo.addUpdate(u7, oldpo=i7)
+        self.assertEquals('ok', *self.resolveCode(skip=True))
+        # uncomment this line and the test will fail and you can see the output
+        #self.assertResult([i1])
         
     
     
diff --git a/yum/__init__.py b/yum/__init__.py
index 39ed0db..d8c5c3f 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -1289,7 +1289,7 @@ class YumBase(depsolve.Depsolve):
         for txmbr in sorted(self.tsInfo):
             msg = "SKIPBROKEN:  %-11s : %s " % 
(state[txmbr.output_state],txmbr.po)
             self.verbose_logger.log(logginglevels.DEBUG_2, msg)
-            for po,rel in sorted(txmbr.relatedto):
+            for po,rel in set(sorted(txmbr.relatedto)):
                 msg = "SKIPBROKEN:                   %s : %s" % (rel,po)
                 self.verbose_logger.log(logginglevels.DEBUG_2, msg)
         self.verbose_logger.log(logginglevels.DEBUG_2,"SKIPBROKEN:%s" % (60 * 
"="))
-- 
1.7.3.4

_______________________________________________
Yum-devel mailing list
[email protected]
http://lists.baseurl.org/mailman/listinfo/yum-devel

Reply via email to