yifengyou / rpms / yum

Forked from rpms/yum 3 years ago
Clone

Blame SOURCES/BZ-1370134-yum-check-ignore-self-conflicts.patch

5e9bef
commit 1ff69afbb78e9303a0d9859d941371eaedbb6842
5e9bef
Author: James Antill <james@and.org>
5e9bef
Date:   Mon Sep 22 16:22:42 2014 -0400
5e9bef
5e9bef
    Have "yum check" ignore self conflicts.
5e9bef
5e9bef
diff --git a/yum/rpmsack.py b/yum/rpmsack.py
5e9bef
index 2d718c1..229e1a1 100644
5e9bef
--- a/yum/rpmsack.py
5e9bef
+++ b/yum/rpmsack.py
5e9bef
@@ -1576,6 +1576,15 @@ class RPMDBPackageSack(PackageSackBase):
5e9bef
 
5e9bef
                 (req, flags, ver) = creq
5e9bef
                 res = self.getProvides(req, flags, ver)
5e9bef
+
5e9bef
+                # Filter this pkg out, as self conflicts are allowed.
5e9bef
+                nres = {}
5e9bef
+                for conflicting_po in res:
5e9bef
+                    if conflicting_po.pkgtup[0] == pkg.pkgtup[0] and conflicting_po.pkgtup[2:] == pkg.pkgtup[2:]:
5e9bef
+                        continue
5e9bef
+                    nres[conflicting_po] = res[conflicting_po]
5e9bef
+                res = nres
5e9bef
+
5e9bef
                 if not res:
5e9bef
                     continue
5e9bef
                 flags = yum.depsolve.flags.get(flags, flags)