---
yum/yumRepo.py | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/yum/yumRepo.py b/yum/yumRepo.py
index 3b49f56..9f32190 100644
--- a/yum/yumRepo.py
+++ b/yum/yumRepo.py
@@ -1659,6 +1659,35 @@ Insufficient space in download directory %s
self._doneOldRepoXML()
return True
+ def _retrieveDelta(self, full):
+ """ Return the unpacked file if good, optionally retrieve and apply
+ the delta file and verify result
+ """
+
+ # there already?
+ new = self.cachedir + '/gen/%s.xml' % full
+ if not os.path.exists(new):
+ return
+ if self._checkMD(new, full, openchecksum=True, check_can_fail=True):
+ return new
+
+ # can we have delta?
+ delta = self.repoXML.getDelta(full, os.path.getmtime(new))
+ if not delta:
+ return
+ local = self._retrieveMD(delta.type, retrieve_can_fail=True)
+ if not local:
+ return
+
+ # apply delta
+ old = new + '.old.tmp'
+ os.rename(new, old)
+ if not self._applyDelta(delta):
+ os.rename(old, new)
+ return
+ os.unlink(old)
+ return new
+
def _groupLoadRepoXML(self, text=None, mdtypes=None):
""" Retrieve the new repomd.xml from the repository, then check it
and parse it. If it fails we revert to the old version and pretend
--
1.7.11.7
_______________________________________________
Yum-devel mailing list
[email protected]
http://lists.baseurl.org/mailman/listinfo/yum-devel