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 > Debian > Debian User

LinkBack Thread Tools
Old 08-04-2008, 12:43 PM
Alexander Todorov
Default write yum repos used during install under /etc/yum.repo.d/

Hash: SHA512

Good afternoon list,
I've seen people asking for this feature from time to time. The code below comes
from the RHEL5 branch but was commented out. Last time I've
tested it with RHEL5 it was breaking.

I did some slight modifications to the original code and tested this with F9 and
it works for me. As you can see only http(s) and ftp repos are written to config

- ---
~ yuminstall.py | 19 +++++++++++++++++++
~ 1 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/yuminstall.py b/yuminstall.py
index ad7615a..dcff552 100644
- --- a/yuminstall.py
+++ b/yuminstall.py
@@ -1952,6 +1952,25 @@
~ f.write("-%s
" % pkg)

~ def writeConfiguration(self):
+ emptyRepoConf = yum.config.RepoConf()
+ compulsorySettings = [ 'enabled', 'cost' ]
+ for repo in self.ayum.repos.listEnabled():
+ for url in repo.urls:
+ if url.startswith('http://') or url.startswith('https://') or
+ fn = "%s/etc/yum.repos.d/%s.repo" % (self.instPath, repo.id)
+ f = open(fn , 'w')
+ f.write('[%s]
' % (repo.id,))
+ for k, v in emptyRepoConf.iteritems():
+ repoval = repo.getAttribute(k)
+ if not (k in compulsorySettings):
+ if not repoval or (repoval == v):
+ # continue the k, v loop
+ continue
+ val = emptyRepoConf.optionobj(k).tostring(repoval)
+ f.write("%s=%s
" % (k,val))
+ f.close()
+ # break out of the urls loop
+ break
~ return

~ def getRequiredMedia(self):

Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with Red Hat - http://enigmail.mozdev.org

iD8DBQFIlvlXhmd3WOiFct4RCl03AKCzpSSu8vPREYlri0miio SKoXTjKwCfVney

Anaconda-devel-list mailing list
Old 08-26-2008, 07:00 PM
Jeremy Katz
Default write yum repos used during install under /etc/yum.repo.d/

On Mon, 2008-08-25 at 16:26 +0200, Radek Vykydal wrote:
> > Good morning,
> > anyone to review and comment on this patch please?
> The patch seems OK to me, but the policy of preference of repos
> after installation should be thought about. I think
> that the added install repos shouldn't be the preferred one -
> I'd rather even disable it by default because disabled repo wouldn't
> do any harm, and yet it could be useful.

Actually, I thought that this all became moot with Chris's changes to
use the repo files, etc in git master? The "default" case is you end up
using one of the repos from a repo file. If you disable/add a repo/etc,
then we were going to carry that over into the installed system iirc.


Anaconda-devel-list mailing list

Thread Tools

All times are GMT. The time now is 11:01 AM.

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