Fix issues with $basearch and mirrorlist usage.

This commit is contained in:
Jesse Keating 2007-08-27 12:41:26 -04:00 committed by Jesse Keating
parent d5aea6b8b2
commit 1357a05145
2 changed files with 11 additions and 22 deletions

View File

@ -3,6 +3,7 @@
- Add support for $releasever in repo uris. - Add support for $releasever in repo uris.
- Set arch using rpmUtils, and do it in /usr/bin/pungi - Set arch using rpmUtils, and do it in /usr/bin/pungi
- Add a kickstart file usable for composing Fedora 8 "Fedora" - Add a kickstart file usable for composing Fedora 8 "Fedora"
- Fix bugs with $basearch and mirrorlist usage.
* Sun Aug 26 2007 Jesse Keating <jkeating@redhat.com> * Sun Aug 26 2007 Jesse Keating <jkeating@redhat.com>
- Add better support for %packages syntax using native pykickstart - Add better support for %packages syntax using native pykickstart

View File

@ -48,17 +48,6 @@ class PungiYum(yum.YumBase):
class Gather(pypungi.PungiBase): class Gather(pypungi.PungiBase):
def __init__(self, config, ksparser): def __init__(self, config, ksparser):
arch = self.config.get('default', 'arch')
if arch == 'i386'
yumarch = 'athlon'
elif arch == 'ppc':
yumarch = 'ppc64'
elif arch == 'sparc':
yumarch = 'sparc64v'
else:
yumarch = arch
pypungi.PungiBase.__init__(self, config) pypungi.PungiBase.__init__(self, config)
# Set our own logging name space # Set our own logging name space
@ -89,6 +78,7 @@ class Gather(pypungi.PungiBase):
yumconf.cache = 0 yumconf.cache = 0
yumvars = yum.config._getEnvVar() yumvars = yum.config._getEnvVar()
yumvars['releasever'] = self.config.get('default', 'version') yumvars['releasever'] = self.config.get('default', 'version')
yumvars['basearch'] = yum.rpmUtils.arch.getBaseArch(myarch=self.config.get('default', 'arch'))
yumconf.yumvar = yumvars yumconf.yumvar = yumvars
self.ayum._conf = yumconf self.ayum._conf = yumconf
self.ayum.repos.setCacheDir(self.ayum.conf.cachedir) self.ayum.repos.setCacheDir(self.ayum.conf.cachedir)
@ -97,7 +87,7 @@ class Gather(pypungi.PungiBase):
self.ayum.cleanSqlite() # clean metadata that might be in the cache from previous runs self.ayum.cleanSqlite() # clean metadata that might be in the cache from previous runs
arch = self.config.get('default', 'arch') arch = self.config.get('default', 'arch')
if arch == 'i386' if arch == 'i386':
yumarch = 'athlon' yumarch = 'athlon'
elif arch == 'ppc': elif arch == 'ppc':
yumarch = 'ppc64' yumarch = 'ppc64'
@ -117,18 +107,16 @@ class Gather(pypungi.PungiBase):
thisrepo.name = repo.name thisrepo.name = repo.name
# add excludes and such here when pykickstart gets them # add excludes and such here when pykickstart gets them
if repo.mirrorlist: if repo.mirrorlist:
thisrepo.mirrorlist = repo.mirrorlist thisrepo.mirrorlist = yum.parser.varReplace(repo.mirrorlist, self.ayum.conf.yumvar)
self.logger.info('URI for repo %s is %s' % (repo.name, repo.mirrorlist)) self.logger.info('Mirrorlist for repo %s is %s' % (thisrepo.name, thisrepo.mirrorlist))
else: else:
thisrepo.baseurl = repo.baseurl thisrepo.baseurl = yum.parser.varReplace(repo.baseurl, self.ayum.conf.yumvar)
self.logger.info('URI for repo %s is %s' % (repo.name, repo.baseurl)) self.logger.info('URL for repo %s is %s' % (thisrepo.name, thisrepo.baseurl))
thisrepo.yumvar.update(self.ayum.conf.yumvar) thisrepo.basecachedir = self.ayum.conf.cachedir
thisrepo.enablegroups = True
self.ayum.repos.add(thisrepo) self.ayum.repos.add(thisrepo)
self.ayum.repos.enableRepo(thisrepo.id)
for repo in self.ayum.repos.repos.values(): self.ayum._getRepos(thisrepo=thisrepo.id, doSetup = True)
self.logger.info('Enabling repo %s' % repo.name)
repo.enable()
repo.enablegroups = True
self.logger.info('Getting sacks for arches %s' % arches) self.logger.info('Getting sacks for arches %s' % arches)
self.ayum._getSacks(archlist=arches) self.ayum._getSacks(archlist=arches)