Blame SOURCES/BZ-1361609-improve-exactarchlist-opt.patch

d2a170
diff -up yum-3.4.3/docs/yum.conf.5.orig yum-3.4.3/docs/yum.conf.5
d2a170
--- yum-3.4.3/docs/yum.conf.5.orig	2017-10-31 17:11:01.730922455 +0100
d2a170
+++ yum-3.4.3/docs/yum.conf.5	2017-10-31 17:14:00.544379686 +0100
d2a170
@@ -221,6 +221,18 @@ List of package names that are kernels.
d2a170
 updating of kernel packages and should be removed out in the yum 2.1 series.
d2a170
 
d2a170
 .IP
d2a170
+\fBexactarchlist\fR
d2a170
+List of packages that should never change archs in an update.
d2a170
+That means, if a package has a newer version available which is for a different
d2a170
+compatible arch, yum will not consider that version an update if the package
d2a170
+name is in this list.
d2a170
+For example, on x86_64, foo-1.x86_64 won't be updated to foo-2.i686 if foo is
d2a170
+in this list.
d2a170
+Kernels in particular fall into this category.
d2a170
+Shell globs using wildcards (eg. * and ?) are allowed.
d2a170
+Default is an empty list.
d2a170
+
d2a170
+.IP
d2a170
 \fBshowdupesfromrepos\fR
d2a170
 Either `0' or `1'. Set to `1' if you wish to show any duplicate packages from
d2a170
 any repository, from package listings like the info or list commands. Set
d2a170
diff -up yum-3.4.3/yum/config.py.orig yum-3.4.3/yum/config.py
d2a170
--- yum-3.4.3/yum/config.py.orig	2017-10-31 17:11:01.729922458 +0100
d2a170
+++ yum-3.4.3/yum/config.py	2017-10-31 17:12:46.513604398 +0100
d2a170
@@ -42,6 +42,7 @@ import rpmUtils.miscutils
d2a170
 import Errors
d2a170
 import types
d2a170
 from misc import get_uuid, read_in_items_from_dot_dir
d2a170
+import fnmatch
d2a170
 
d2a170
 # Alter/patch these to change the default checking...
d2a170
 __pkgs_gpgcheck_default__ = False
d2a170
@@ -284,6 +285,20 @@ class UrlListOption(ListOption):
d2a170
         return out
d2a170
 
d2a170
 
d2a170
+class WildListOption(ListOption):
d2a170
+    """An option containing a list of strings that supports shell-style
d2a170
+    wildcard matching in membership test operations."""
d2a170
+
d2a170
+    def parse(self, s):
d2a170
+        class WildList(list):
d2a170
+            def __contains__(self, item):
d2a170
+                if not isinstance(item, basestring):
d2a170
+                    return False
d2a170
+                return any(fnmatch.fnmatch(item, p) for p in self)
d2a170
+        patterns = super(WildListOption, self).parse(s)
d2a170
+        return WildList(patterns)
d2a170
+
d2a170
+
d2a170
 class IntOption(Option):
d2a170
     """An option representing an integer value."""
d2a170
 
d2a170
@@ -769,7 +784,7 @@ class YumConf(StartupConf):
d2a170
                                           names_of_0=["0", "<off>"])
d2a170
     kernelpkgnames = ListOption(['kernel','kernel-smp', 'kernel-enterprise',
d2a170
             'kernel-bigmem', 'kernel-BOOT', 'kernel-PAE', 'kernel-PAE-debug'])
d2a170
-    exactarchlist = ListOption(__exactarchlist_default__)
d2a170
+    exactarchlist = WildListOption(__exactarchlist_default__)
d2a170
     tsflags = ListOption()
d2a170
     override_install_langs = Option()
d2a170