Blame SOURCES/BZ-1002977-use-the-provide-version.patch

5e9bef
commit 3a0bad67e16c391b57cf26bc68c8c61f96b5b077
5e9bef
Author: Zdenek Pavlas <zpavlas@redhat.com>
5e9bef
Date:   Wed Nov 20 13:32:13 2013 +0100
5e9bef
5e9bef
    _getsysver(): use the version of the provide.
5e9bef
    
5e9bef
    Use it as-is (no stripping or rewriting)
5e9bef
5e9bef
diff --git a/yum/config.py b/yum/config.py
5e9bef
index ecb8490..8f8e654 100644
5e9bef
--- a/yum/config.py
5e9bef
+++ b/yum/config.py
5e9bef
@@ -1210,11 +1210,8 @@ def _getsysver(installroot, distroverpkg):
5e9bef
         flag = rpmUtils.miscutils.flagToString(flag)
5e9bef
         ver  = hdr[getattr(rpm, 'RPMTAG_PROVIDEVERSION')][off]
5e9bef
         if flag == 'EQ' and ver:
5e9bef
-            releasever = rpmUtils.miscutils.stringToVersion(releasever)
5e9bef
-            if releasever[2]:
5e9bef
-                releasever = "%s-%s" % (releasever[1], releasever[2]) # No epoch
5e9bef
-            else:
5e9bef
-                releasever = releasever[1] # No epoch or release, just version
5e9bef
+            # override the package version
5e9bef
+            releasever = ver
5e9bef
 
5e9bef
         del hdr
5e9bef
     del idx
5e9bef
diff --git a/yum/config.py b/yum/config.py
5e9bef
index cdad4bc..cb5243f 100644
5e9bef
--- a/yum/config.py
5e9bef
+++ b/yum/config.py
5e9bef
@@ -1213,8 +1213,9 @@ def _getsysver(installroot, distroverpkg):
5e9bef
         flag = rpmUtils.miscutils.flagToString(flag)
5e9bef
         ver  = hdr[getattr(rpm, 'RPMTAG_PROVIDEVERSION')][off]
5e9bef
         if flag == 'EQ' and ver:
5e9bef
-            # override the package version
5e9bef
-            releasever = ver
5e9bef
+            if hdr['name'] != distroverpkg_prov:
5e9bef
+                # override the package version
5e9bef
+                releasever = ver
5e9bef
 
5e9bef
         del hdr
5e9bef
     del idx