[yum-git] 5 commits - yum/__init__.py yum/yumRepo.py
James Antill
james at linux.duke.edu
Wed Jan 16 17:39:27 UTC 2008
yum/__init__.py | 3 +--
yum/yumRepo.py | 23 ++++++++++++++---------
2 files changed, 15 insertions(+), 11 deletions(-)
New commits:
commit a327e74c3b53909256878645dd81293402807511
Author: James Antill <james at and.org>
Date: Wed Jan 16 12:38:42 2008 -0500
Fix doc. comment, repomd.xml isn't usually gotten here
diff --git a/yum/__init__.py b/yum/__init__.py
index c4173a0..7a40552 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -340,8 +340,7 @@ class YumBase(depsolve.Depsolve):
return self._getRepos(thisrepo, True)
def _getRepos(self, thisrepo=None, doSetup = False):
- """grabs the repomd.xml for each enabled repository and sets up
- the basics of the repository"""
+ """ For each enabled repository set up the basics of the repository. """
self._getConfig() # touch the config class first
if doSetup:
commit 9a15e59f7bfd79c7044f78888e4fc3ba4bb4b6a7
Author: James Antill <james at and.org>
Date: Wed Jan 16 12:20:27 2008 -0500
Fix spacing
diff --git a/yum/yumRepo.py b/yum/yumRepo.py
index 9b2f4e9..fa8c58c 100644
--- a/yum/yumRepo.py
+++ b/yum/yumRepo.py
@@ -937,7 +937,7 @@ class YumRepository(Repository, config.RepoConf):
if old_repo_XML:
(omdtype, odata) = self._get_mdtype_data(mdtype,
- repoXML=old_repo_XML)
+ repoXML=old_repo_XML)
local = self._groupCheckDataMDValid(odata, omdtype, mdtype)
if local:
if omdtype == nmdtype and odata.checksum == ndata.checksum:
commit 29ed370c226a055dd5d28d01a2c2eb346f5ca4c1
Author: James Antill <james at and.org>
Date: Wed Jan 16 12:20:00 2008 -0500
Fix variable name
diff --git a/yum/yumRepo.py b/yum/yumRepo.py
index e97adca..9b2f4e9 100644
--- a/yum/yumRepo.py
+++ b/yum/yumRepo.py
@@ -908,9 +908,9 @@ class YumRepository(Repository, config.RepoConf):
if data is None:
return None
- uncompressed = (dbmdtype != mmdtype)
- local = self._get_mdtype_fname(data, uncompressed)
- if not self._checkMD(local, dbmdtype, openchecksum=uncompressed,
+ compressed = (dbmdtype != mmdtype)
+ local = self._get_mdtype_fname(data, compressed)
+ if not self._checkMD(local, dbmdtype, openchecksum=compressed,
data=data, check_can_fail=True):
return None
commit 56c1e45b48dcc06c57bf76a1443188cb649bf852
Author: James Antill <james at and.org>
Date: Wed Jan 16 12:19:43 2008 -0500
Fix function and argument names, due to usage
diff --git a/yum/yumRepo.py b/yum/yumRepo.py
index e06b389..e97adca 100644
--- a/yum/yumRepo.py
+++ b/yum/yumRepo.py
@@ -901,16 +901,17 @@ class YumRepository(Repository, config.RepoConf):
return True
return False
- def _groupCheckOldDataMDValid(self, olddata, omdtype, mdtype):
- """ Check that we already have this data, and that it's valid. """
+ def _groupCheckDataMDValid(self, data, dbmdtype, mmdtype):
+ """ Check that we already have this data, and that it's valid. Given
+ the DB mdtype and the main mdtype (no _db suffix). """
- if olddata is None:
+ if data is None:
return None
- uncompressed = (omdtype != mdtype)
- local = self._get_mdtype_fname(olddata, uncompressed)
- if not self._checkMD(local, omdtype, openchecksum=uncompressed,
- data=olddata, check_can_fail=True):
+ uncompressed = (dbmdtype != mmdtype)
+ local = self._get_mdtype_fname(data, uncompressed)
+ if not self._checkMD(local, dbmdtype, openchecksum=uncompressed,
+ data=data, check_can_fail=True):
return None
return local
@@ -937,7 +938,7 @@ class YumRepository(Repository, config.RepoConf):
if old_repo_XML:
(omdtype, odata) = self._get_mdtype_data(mdtype,
repoXML=old_repo_XML)
- local = self._groupCheckOldDataMDValid(odata, omdtype, mdtype)
+ local = self._groupCheckDataMDValid(odata, omdtype, mdtype)
if local:
if omdtype == nmdtype and odata.checksum == ndata.checksum:
continue # If they are the same do nothing
@@ -948,7 +949,7 @@ class YumRepository(Repository, config.RepoConf):
reverts.append(local)
# No old repomd data, but we might still have uncompressed MD
- if self._groupCheckOldDataMDValid(ndata, nmdtype, mdtype):
+ if self._groupCheckDataMDValid(ndata, nmdtype, mdtype):
continue
if not self._retrieveMD(nmdtype, retrieve_can_fail=True):
commit dc03fff6afb8c3f8df713570045d562c32fcdd0a
Author: James Antill <james at and.org>
Date: Wed Jan 16 12:16:06 2008 -0500
Don't re-download when we have uncompressed data
diff --git a/yum/yumRepo.py b/yum/yumRepo.py
index 6dcb1a4..e06b389 100644
--- a/yum/yumRepo.py
+++ b/yum/yumRepo.py
@@ -947,6 +947,10 @@ class YumRepository(Repository, config.RepoConf):
os.rename(local, local + '.old.tmp')
reverts.append(local)
+ # No old repomd data, but we might still have uncompressed MD
+ if self._groupCheckOldDataMDValid(ndata, nmdtype, mdtype):
+ continue
+
if not self._retrieveMD(nmdtype, retrieve_can_fail=True):
self._revertOldRepoXML()
return False
More information about the Yum-cvs-commits
mailing list