FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 05-09-2012, 08:43 PM
David Lehman
 
Default Smooth out some rough edges with base repo switching.

Remove cache dirs for "anaconda" repo when resetting since that repo
name can apply to any base repo configured manually by the user.

Disable all built-in repos when setup of user-specified base repo fails
and we were instructed not to fall back on the on-disk repo configs.
---
pyanaconda/packaging/yumpayload.py | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/pyanaconda/packaging/yumpayload.py b/pyanaconda/packaging/yumpayload.py
index 0c7d028..5e48e93 100644
--- a/pyanaconda/packaging/yumpayload.py
+++ b/pyanaconda/packaging/yumpayload.py
@@ -145,11 +145,17 @@ class YumPayload(PackagePayload):

def _resetYum(self, root=None):
""" Delete and recreate the payload's YumBase instance. """
+ import shutil
if root is None:
root = self._root_dir

with _yum_lock:
if self._yum:
+ for repo in self._yum.repos.listEnabled():
+ if repo.name == BASE_REPO_NAME and
+ os.path.isdir(repo.cachedir):
+ shutil.rmtree(repo.cachedir)
+
del self._yum

self._yum = yum.YumBase()
@@ -317,10 +323,10 @@ reposdir=%s
try:
self._configureBaseRepo(storage)
except PayloadError as e:
- log.error("failed to set up base repo: %s" % e)
if not fallback:
- # XXX this leaves the configuration exactly as specified in the
- # on-disk yum configuration
+ for repo in self._yum.repos.repos.values():
+ if repo.enabled:
+ self.disableRepo(repo.id)
raise

# this preserves the method details while disabling it
@@ -499,6 +505,8 @@ reposdir=%s
self._addYumRepo(BASE_REPO_NAME, url,
proxy=proxy, sslverify=sslverify)
except MetadataError as e:
+ log.error("base repo (%s/%s) not valid -- removing it"
+ % (method.method, url))
self._removeYumRepo(BASE_REPO_NAME)
raise

--
1.7.7.6

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 10:10 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org