diff options
author | Chris Lumens <clumens@redhat.com> | 2006-09-05 20:04:47 +0000 |
---|---|---|
committer | Chris Lumens <clumens@redhat.com> | 2006-09-05 20:04:47 +0000 |
commit | 2d832778d874b1a68d6f27504006ae14fc78e927 (patch) | |
tree | 7dae61ab7d08a1f7cf5dc2815eed8451ffadcca7 /yuminstall.py | |
parent | 2123c11450a6e07ec89d37fcbcba2605929a3116 (diff) | |
download | anaconda-2d832778d874b1a68d6f27504006ae14fc78e927.tar.gz anaconda-2d832778d874b1a68d6f27504006ae14fc78e927.tar.xz anaconda-2d832778d874b1a68d6f27504006ae14fc78e927.zip |
Log when duplicate repositories are added instead of crashing.
Diffstat (limited to 'yuminstall.py')
-rw-r--r-- | yuminstall.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/yuminstall.py b/yuminstall.py index b04a8e81c..dce218975 100644 --- a/yuminstall.py +++ b/yuminstall.py @@ -385,8 +385,13 @@ class AnacondaYum(YumSorter): repoid=ksrepo.name) repo.name = name repo.enable() - self.repos.add(repo) - log.info("added repository %s with with source URL %s" % (ksrepo.name, ksrepo.baseurl or ksrepo.mirrorlist)) + + try: + self.repos.add(repo) + log.info("added repository %s with with source URL %s" % (ksrepo.name, ksrepo.baseurl or ksrepo.mirrorlist)) + except yum.Errors.DuplicateRepoError, e: + log.warning("ignoring duplicate repository %s with source URL %s" % (ksrepo.name, ksrepo.baseurl or ksrepo.mirrorlist)) + self.repos.setCacheDir('/tmp/cache') def getDownloadPkgs(self): |