Move arch setup to __init__.py so that it is done if
gather is not used.
This commit is contained in:
parent
a578d93a9e
commit
5c70f43906
@ -1,3 +1,6 @@
|
|||||||
|
* Mon Aug 27 2007 Jesse Keating <jkeating@redhat.com>
|
||||||
|
- Set up arch in __init__.py as it's needed for logging
|
||||||
|
|
||||||
* 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
|
||||||
- Add a cache dir for pungi (/var/cache/pungi) and a cli option to override
|
- Add a cache dir for pungi (/var/cache/pungi) and a cli option to override
|
||||||
|
@ -15,12 +15,25 @@
|
|||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import yum
|
||||||
|
import os
|
||||||
|
|
||||||
class PungiBase():
|
class PungiBase():
|
||||||
"""The base Pungi class. Set up config items and logging here"""
|
"""The base Pungi class. Set up config items and logging here"""
|
||||||
|
|
||||||
def __init__(self, config):
|
def __init__(self, config):
|
||||||
self.config = config
|
self.config = config
|
||||||
|
|
||||||
|
hostarch = os.uname()[4]
|
||||||
|
if hostarch in yum.rpmUtils.arch.getArchList('athlon'):
|
||||||
|
config.set('default', 'arch', 'i386')
|
||||||
|
elif hostarch == 'ppc':
|
||||||
|
config.set('default', 'arch', 'ppc')
|
||||||
|
elif hostarch == 'sparc':
|
||||||
|
config.set('default', 'arch', 'sparc')
|
||||||
|
else:
|
||||||
|
config.set('default', 'arch', hostarch)
|
||||||
|
|
||||||
self.doLoggerSetup()
|
self.doLoggerSetup()
|
||||||
|
|
||||||
self.workdir = os.path.join(self.config.get('default', 'destdir'),
|
self.workdir = os.path.join(self.config.get('default', 'destdir'),
|
||||||
|
@ -48,20 +48,16 @@ class PungiYum(yum.YumBase):
|
|||||||
|
|
||||||
class Gather(pypungi.PungiBase):
|
class Gather(pypungi.PungiBase):
|
||||||
def __init__(self, config, ksparser):
|
def __init__(self, config, ksparser):
|
||||||
# Set up arches, needed for log file name
|
|
||||||
hostarch = os.uname()[4]
|
arch = self.config.get('default', 'arch')
|
||||||
if hostarch in yum.rpmUtils.arch.getArchList('athlon'):
|
if arch == 'i386'
|
||||||
config.set('default', 'arch', 'i386')
|
|
||||||
yumarch = 'athlon'
|
yumarch = 'athlon'
|
||||||
elif hostarch == 'ppc':
|
elif arch == 'ppc':
|
||||||
config.set('default', 'arch', 'ppc')
|
|
||||||
yumarch = 'ppc64'
|
yumarch = 'ppc64'
|
||||||
elif hostarch == 'sparc':
|
elif arch == 'sparc':
|
||||||
config.set('default', 'arch', 'sparc')
|
|
||||||
yumarch = 'sparc64v'
|
yumarch = 'sparc64v'
|
||||||
else:
|
else:
|
||||||
config.set('default', 'arch', hostarch)
|
yumarch = arch
|
||||||
yumarch = hostarch
|
|
||||||
|
|
||||||
pypungi.PungiBase.__init__(self, config)
|
pypungi.PungiBase.__init__(self, config)
|
||||||
|
|
||||||
@ -96,6 +92,17 @@ class Gather(pypungi.PungiBase):
|
|||||||
|
|
||||||
self.ayum.cleanMetadata() # clean metadata that might be in the cache from previous runs
|
self.ayum.cleanMetadata() # 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
|
self.ayum.cleanSqlite() # clean metadata that might be in the cache from previous runs
|
||||||
|
|
||||||
|
arch = self.config.get('default', 'arch')
|
||||||
|
if arch == 'i386'
|
||||||
|
yumarch = 'athlon'
|
||||||
|
elif arch == 'ppc':
|
||||||
|
yumarch = 'ppc64'
|
||||||
|
elif arch == 'sparc':
|
||||||
|
yumarch = 'sparc64v'
|
||||||
|
else:
|
||||||
|
yumarch = arch
|
||||||
|
|
||||||
self.ayum.compatarch = yumarch
|
self.ayum.compatarch = yumarch
|
||||||
arches = yum.rpmUtils.arch.getArchList(yumarch)
|
arches = yum.rpmUtils.arch.getArchList(yumarch)
|
||||||
arches.append('src') # throw source in there, filter it later
|
arches.append('src') # throw source in there, filter it later
|
||||||
|
Loading…
Reference in New Issue
Block a user