[yum-commits] Branch 'yum-3_2_X' - 2 commits - yum/config.py yum/repos.py
skvidal at osuosl.org
skvidal at osuosl.org
Thu Jan 14 22:17:28 UTC 2010
yum/config.py | 1 +
yum/repos.py | 11 +++++++++--
2 files changed, 10 insertions(+), 2 deletions(-)
New commits:
commit 0ff54c5ae55843b526799b52148cff363ac8fc6d
Author: Seth Vidal <skvidal at fedoraproject.org>
Date: Thu Jan 14 16:48:05 2010 -0500
make sure we're only skipping the exception if we are doing
a primary or global setup of the repos/sacks and disable it
if it falls over.
diff --git a/yum/repos.py b/yum/repos.py
index e0c0452..248753e 100644
--- a/yum/repos.py
+++ b/yum/repos.py
@@ -277,8 +277,9 @@ class RepoStorage:
try:
sack.populate(repo, mdtype, callback, cacheonly)
except Errors.RepoError, e:
- if not repo.skip_if_unavailable:
-
+ if mdtype in ['all', 'metadata'] and repo.skip_if_unavailable:
+ self.disableRepo(repo.id)
+ else:
raise
else:
self.pkgSack.addSack(repo.id, sack)
commit 034b652de55a2dcf06fba5871a0118d4d6eae361
Author: Seth Vidal <skvidal at fedoraproject.org>
Date: Thu Jan 14 13:17:09 2010 -0500
complete CRACK -- allow repos to be explicitly set to be skipped if for any
reason they cannot be located.
I know I know - I said I would never do this but I gave up on it given how
horribly broken a number of commonly enabled repos are.
diff --git a/yum/config.py b/yum/config.py
index 7e2d781..b43ce7c 100644
--- a/yum/config.py
+++ b/yum/config.py
@@ -790,6 +790,7 @@ class RepoConf(BaseConfig):
sslclientcert = Inherit(YumConf.sslclientcert)
sslclientkey = Inherit(YumConf.sslclientkey)
+ skip_if_unavailable = BoolOption(False)
class VersionGroupConf(BaseConfig):
pkglist = ListOption()
diff --git a/yum/repos.py b/yum/repos.py
index 246c33c..e0c0452 100644
--- a/yum/repos.py
+++ b/yum/repos.py
@@ -274,8 +274,14 @@ class RepoStorage:
for repo in myrepos:
sack = repo.getPackageSack()
- sack.populate(repo, mdtype, callback, cacheonly)
- self.pkgSack.addSack(repo.id, sack)
+ try:
+ sack.populate(repo, mdtype, callback, cacheonly)
+ except Errors.RepoError, e:
+ if not repo.skip_if_unavailable:
+
+ raise
+ else:
+ self.pkgSack.addSack(repo.id, sack)
class Repository:
More information about the Yum-commits
mailing list