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

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