[yum-commits] Branch 'yum-3_2_X' - 3 commits - yum/update_md.py yum/yumRepo.py
James Antill
james at osuosl.org
Sat Jun 13 14:07:24 UTC 2009
yum/update_md.py | 4 ++++
yum/yumRepo.py | 34 ++++++++++++++++++++++------------
2 files changed, 26 insertions(+), 12 deletions(-)
New commits:
commit 9987aae8951797604da34f98d878ff613cf808e7
Author: James Antill <james at and.org>
Date: Sat Jun 13 09:58:35 2009 -0400
Cleanup metadataCurrent.
diff --git a/yum/yumRepo.py b/yum/yumRepo.py
index 2f67752..06f0701 100644
--- a/yum/yumRepo.py
+++ b/yum/yumRepo.py
@@ -820,19 +820,28 @@ class YumRepository(Repository, config.RepoConf):
age of the cookie is less than metadata_expire time then return true
else return False. This result is cached, so that metalink/repomd.xml
are synchronized."""
- if self._metadataCurrent is None:
- self._hack_mirrorlist_for_anaconda()
- mlfn = self.cachedir + '/' + 'metalink.xml'
- if self.metalink and not os.path.exists(mlfn):
- self._metadataCurrent = False
- if self._metadataCurrent is None:
- repomdfn = self.cachedir + '/' + 'repomd.xml'
- if not os.path.exists(repomdfn):
- self._metadataCurrent = False
- if self._metadataCurrent is None:
- self._metadataCurrent = self.withinCacheAge(self.metadata_cookie,
- self.metadata_expire)
- return self._metadataCurrent
+ if self._metadataCurrent is not None:
+ return self._metadataCurrent
+
+ mC_def = self.withinCacheAge(self.metadata_cookie, self.metadata_expire)
+ if not mC_def: # Normal path...
+ self._metadataCurrent = mC_def
+ return mC_def
+
+ # Edge cases, both repomd.xml and metalink (if used). Must exist.
+ repomdfn = self.cachedir + '/' + 'repomd.xml'
+ if not os.path.exists(repomdfn):
+ self._metadataCurrent = False
+ return False
+
+ self._hack_mirrorlist_for_anaconda()
+ mlfn = self.cachedir + '/' + 'metalink.xml'
+ if self.metalink and not os.path.exists(mlfn):
+ self._metadataCurrent = False
+ return False
+
+ self._metadataCurrent = True
+ return True
# The metalink _shouldn't_ be newer than the repomd.xml or the checksums
# will be off, but we only really care when we are downloading the
commit 0da3bead23d1910d0bee3047f14b6c9025e261a0
Author: James Antill <james at and.org>
Date: Sat Jun 13 09:55:56 2009 -0400
Do metalink cache check when using metalink as mirrorlist, BZ#484537
diff --git a/yum/yumRepo.py b/yum/yumRepo.py
index 94e352c..2f67752 100644
--- a/yum/yumRepo.py
+++ b/yum/yumRepo.py
@@ -821,6 +821,7 @@ class YumRepository(Repository, config.RepoConf):
else return False. This result is cached, so that metalink/repomd.xml
are synchronized."""
if self._metadataCurrent is None:
+ self._hack_mirrorlist_for_anaconda()
mlfn = self.cachedir + '/' + 'metalink.xml'
if self.metalink and not os.path.exists(mlfn):
self._metadataCurrent = False
commit 39d994015f54457c716324328ebec60c43040f38
Author: James Antill <james at and.org>
Date: Fri Jun 12 18:42:57 2009 -0400
Add comment about UpdateNoticeExceptions
diff --git a/yum/update_md.py b/yum/update_md.py
index dc8f585..12f9a30 100644
--- a/yum/update_md.py
+++ b/yum/update_md.py
@@ -380,6 +380,10 @@ class UpdateMetadata(object):
try:
un = UpdateNotice(elem)
except UpdateNoticeException, e:
+ # Note that this isn't really accurate, it's just been
+ # very common for Fedora rel-eng to produce data with no
+ # IDs. Seth didn't want me to change the message, so blame
+ # him :p~
print >> sys.stderr, "An update notice lacks ID tag, skipping."
# what else should we do?
continue
More information about the Yum-commits
mailing list