[Yum-devel] [PATCH] Fail reverts of repomd.xml when we aren't doing timestamp checks. BZ 665919.

James Antill james at and.org
Tue May 31 20:02:57 UTC 2011


---
 yum/yumRepo.py |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/yum/yumRepo.py b/yum/yumRepo.py
index 6ba058c..cfc6581 100644
--- a/yum/yumRepo.py
+++ b/yum/yumRepo.py
@@ -1067,6 +1067,14 @@ class YumRepository(Repository, config.RepoConf):
 
     def _revertOldRepoXML(self):
         """ If we have older data available, revert to it. """
+
+        #  If we can't do a timestamp check, then we can be looking at a
+        # completely different repo. from last time ... ergo. we can't revert.
+        #  We still want the old data, so we don't download twice. So we
+        # pretend everything is good until the revert.
+        if self.timestamp_check:
+            raise Errors.RepoError, "Can't download or revert repomd.xml"
+
         if 'old_repo_XML' not in self._oldRepoMDData:
             self._oldRepoMDData = {}
             return
-- 
1.7.5.2



More information about the Yum-devel mailing list