[Yum-devel] [PATCH] complete CRACK -- allow repos to be explicitly set to be skipped if for any reason they cannot be located.
Seth Vidal
skvidal at fedoraproject.org
Thu Jan 14 18:18:36 UTC 2010
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.
---
yum/config.py | 1 +
yum/repos.py | 10 ++++++++--
2 files changed, 9 insertions(+), 2 deletions(-)
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:
--
1.6.5.2
More information about the Yum-devel
mailing list