Minor number changes to the DBVERSION are intended to produce sqlite files
readable by yum versions which support the same major number DBVERSION. Add
this behaviour.
---
 yum/yumRepo.py |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/yum/yumRepo.py b/yum/yumRepo.py
index e31360d..71989a8 100644
--- a/yum/yumRepo.py
+++ b/yum/yumRepo.py
@@ -195,8 +195,20 @@ class YumPackageSack(packageSack.PackageSack):
         return result
         
     def _check_db_version(self, repo, mdtype):
+        """
+        Check if the metadata database version is compatible.
+
+        Major numbers are not compatible (10 vs 11). Minor numbers in the same
+        major version are, so long as the larger number is the repository's
+        database version.
+
+        Return True if compatible, False if not.
+        """
         if repo.repoXML.repoData.has_key(mdtype):
-            if DBVERSION == repo.repoXML.repoData[mdtype].dbversion:
+            ourver = float(DBVERSION)
+            repover = float(repo.repoXML.repoData[mdtype].dbversion)
+            if int(ourver) == int(repover) and ourver <= repover and \
+                    repover - ourver <= 1 :
                 return True
         return False
         
-- 
1.5.3.rc0.790.g0537d

Attachment: pgpiAiai0cUP3.pgp
Description: PGP signature

_______________________________________________
Yum-devel mailing list
[email protected]
https://lists.dulug.duke.edu/mailman/listinfo/yum-devel

Reply via email to