'default' is now a reserved config section. We can't use it anymore.
This commit is contained in:
parent
208fe34cc5
commit
3ca7a26682
@ -47,25 +47,25 @@ def main():
|
|||||||
ksparser.readKickstart(opts.config)
|
ksparser.readKickstart(opts.config)
|
||||||
|
|
||||||
if opts.sourceisos:
|
if opts.sourceisos:
|
||||||
config.set('default', 'arch', 'source')
|
config.set('pungi', 'arch', 'source')
|
||||||
|
|
||||||
for part in ksparser.handler.partition.partitions:
|
for part in ksparser.handler.partition.partitions:
|
||||||
if part.mountpoint == 'iso':
|
if part.mountpoint == 'iso':
|
||||||
config.set('default', 'cdsize', str(part.size))
|
config.set('pungi', 'cdsize', str(part.size))
|
||||||
|
|
||||||
config.set('default', 'force', str(opts.force))
|
config.set('pungi', 'force', str(opts.force))
|
||||||
|
|
||||||
# Set up our directories
|
# Set up our directories
|
||||||
if not os.path.exists(config.get('default', 'destdir')):
|
if not os.path.exists(config.get('pungi', 'destdir')):
|
||||||
try:
|
try:
|
||||||
os.makedirs(config.get('default', 'destdir'))
|
os.makedirs(config.get('pungi', 'destdir'))
|
||||||
except OSError, e:
|
except OSError, e:
|
||||||
print >> sys.stderr, "Error: Cannot create destination dir %s" % config.get('default', 'destdir')
|
print >> sys.stderr, "Error: Cannot create destination dir %s" % config.get('pungi', 'destdir')
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
else:
|
else:
|
||||||
print >> sys.stdout, "Warning: Reusing existing destination directory."
|
print >> sys.stdout, "Warning: Reusing existing destination directory."
|
||||||
|
|
||||||
cachedir = config.get('default', 'cachedir')
|
cachedir = config.get('pungi', 'cachedir')
|
||||||
|
|
||||||
if not os.path.exists(cachedir):
|
if not os.path.exists(cachedir):
|
||||||
try:
|
try:
|
||||||
@ -76,7 +76,7 @@ def main():
|
|||||||
|
|
||||||
# Set debuginfo flag
|
# Set debuginfo flag
|
||||||
if opts.nodebuginfo:
|
if opts.nodebuginfo:
|
||||||
config.set('default', 'debuginfo', "False")
|
config.set('pungi', 'debuginfo', "False")
|
||||||
|
|
||||||
# Actually do work.
|
# Actually do work.
|
||||||
mypungi = pypungi.Pungi(config, ksparser)
|
mypungi = pypungi.Pungi(config, ksparser)
|
||||||
@ -108,9 +108,9 @@ def main():
|
|||||||
# Do things slightly different for src.
|
# Do things slightly different for src.
|
||||||
if opts.sourceisos:
|
if opts.sourceisos:
|
||||||
# we already have all the content gathered
|
# we already have all the content gathered
|
||||||
mypungi.topdir = os.path.join(config.get('default', 'destdir'),
|
mypungi.topdir = os.path.join(config.get('pungi', 'destdir'),
|
||||||
config.get('default', 'version'),
|
config.get('pungi', 'version'),
|
||||||
config.get('default', 'flavor'),
|
config.get('pungi', 'flavor'),
|
||||||
'source', 'SRPMS')
|
'source', 'SRPMS')
|
||||||
mypungi.doCreaterepo(comps=False)
|
mypungi.doCreaterepo(comps=False)
|
||||||
if opts.do_all or opts.do_createiso:
|
if opts.do_all or opts.do_createiso:
|
||||||
@ -129,10 +129,10 @@ if __name__ == '__main__':
|
|||||||
parser = OptionParser(version="%prog 2.0.8")
|
parser = OptionParser(version="%prog 2.0.8")
|
||||||
|
|
||||||
def set_config(option, opt_str, value, parser, config):
|
def set_config(option, opt_str, value, parser, config):
|
||||||
config.set('default', option.dest, value)
|
config.set('pungi', option.dest, value)
|
||||||
# When setting name, also set the iso_basename.
|
# When setting name, also set the iso_basename.
|
||||||
if option.dest == 'name':
|
if option.dest == 'name':
|
||||||
config.set('default', 'iso_basename', value)
|
config.set('pungi', 'iso_basename', value)
|
||||||
|
|
||||||
# Pulled in from config file to be cli options as part of pykickstart conversion
|
# Pulled in from config file to be cli options as part of pykickstart conversion
|
||||||
parser.add_option("--name", dest="name", type="string",
|
parser.add_option("--name", dest="name", type="string",
|
||||||
@ -184,7 +184,7 @@ if __name__ == '__main__':
|
|||||||
parser.print_help()
|
parser.print_help()
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
if not config.get('default', 'flavor').isalnum() and not config.get('default', 'flavor') == '':
|
if not config.get('pungi', 'flavor').isalnum() and not config.get('pungi', 'flavor') == '':
|
||||||
print >> sys.stderr, "Flavor must be alphanumeric."
|
print >> sys.stderr, "Flavor must be alphanumeric."
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
@ -41,25 +41,25 @@ class PungiBase(object):
|
|||||||
|
|
||||||
self.doLoggerSetup()
|
self.doLoggerSetup()
|
||||||
|
|
||||||
self.workdir = os.path.join(self.config.get('default', 'destdir'),
|
self.workdir = os.path.join(self.config.get('pungi', 'destdir'),
|
||||||
'work',
|
'work',
|
||||||
self.config.get('default', 'flavor'),
|
self.config.get('pungi', 'flavor'),
|
||||||
self.config.get('default', 'arch'))
|
self.config.get('pungi', 'arch'))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def doLoggerSetup(self):
|
def doLoggerSetup(self):
|
||||||
"""Setup our logger"""
|
"""Setup our logger"""
|
||||||
|
|
||||||
logdir = os.path.join(self.config.get('default', 'destdir'), 'logs')
|
logdir = os.path.join(self.config.get('pungi', 'destdir'), 'logs')
|
||||||
|
|
||||||
pypungi.util._ensuredir(logdir, None, force=True) # Always allow logs to be written out
|
pypungi.util._ensuredir(logdir, None, force=True) # Always allow logs to be written out
|
||||||
|
|
||||||
if self.config.get('default', 'flavor'):
|
if self.config.get('pungi', 'flavor'):
|
||||||
logfile = os.path.join(logdir, '%s.%s.log' % (self.config.get('default', 'flavor'),
|
logfile = os.path.join(logdir, '%s.%s.log' % (self.config.get('pungi', 'flavor'),
|
||||||
self.config.get('default', 'arch')))
|
self.config.get('pungi', 'arch')))
|
||||||
else:
|
else:
|
||||||
logfile = os.path.join(logdir, '%s.log' % (self.config.get('default', 'arch')))
|
logfile = os.path.join(logdir, '%s.log' % (self.config.get('pungi', 'arch')))
|
||||||
|
|
||||||
# Create the root logger, that will log to our file
|
# Create the root logger, that will log to our file
|
||||||
logging.basicConfig(level=logging.DEBUG,
|
logging.basicConfig(level=logging.DEBUG,
|
||||||
@ -84,14 +84,14 @@ class PungiYum(yum.YumBase):
|
|||||||
def doLoggingSetup(self, debuglevel, errorlevel, syslog_ident=None, syslog_facility=None):
|
def doLoggingSetup(self, debuglevel, errorlevel, syslog_ident=None, syslog_facility=None):
|
||||||
"""Setup the logging facility."""
|
"""Setup the logging facility."""
|
||||||
|
|
||||||
logdir = os.path.join(self.pungiconfig.get('default', 'destdir'), 'logs')
|
logdir = os.path.join(self.pungiconfig.get('pungi', 'destdir'), 'logs')
|
||||||
if not os.path.exists(logdir):
|
if not os.path.exists(logdir):
|
||||||
os.makedirs(logdir)
|
os.makedirs(logdir)
|
||||||
if self.pungiconfig.get('default', 'flavor'):
|
if self.pungiconfig.get('pungi', 'flavor'):
|
||||||
logfile = os.path.join(logdir, '%s.%s.log' % (self.pungiconfig.get('default', 'flavor'),
|
logfile = os.path.join(logdir, '%s.%s.log' % (self.pungiconfig.get('pungi', 'flavor'),
|
||||||
self.pungiconfig.get('default', 'arch')))
|
self.pungiconfig.get('pungi', 'arch')))
|
||||||
else:
|
else:
|
||||||
logfile = os.path.join(logdir, '%s.log' % (self.pungiconfig.get('default', 'arch')))
|
logfile = os.path.join(logdir, '%s.log' % (self.pungiconfig.get('pungi', 'arch')))
|
||||||
|
|
||||||
yum.logging.basicConfig(level=yum.logging.DEBUG, filename=logfile)
|
yum.logging.basicConfig(level=yum.logging.DEBUG, filename=logfile)
|
||||||
|
|
||||||
@ -115,20 +115,20 @@ class Pungi(pypungi.PungiBase):
|
|||||||
console.setLevel(logging.INFO)
|
console.setLevel(logging.INFO)
|
||||||
self.logger.addHandler(console)
|
self.logger.addHandler(console)
|
||||||
|
|
||||||
self.destdir = self.config.get('default', 'destdir')
|
self.destdir = self.config.get('pungi', 'destdir')
|
||||||
self.archdir = os.path.join(self.destdir,
|
self.archdir = os.path.join(self.destdir,
|
||||||
self.config.get('default', 'version'),
|
self.config.get('pungi', 'version'),
|
||||||
self.config.get('default', 'flavor'),
|
self.config.get('pungi', 'flavor'),
|
||||||
self.config.get('default', 'arch'))
|
self.config.get('pungi', 'arch'))
|
||||||
|
|
||||||
self.topdir = os.path.join(self.archdir, 'os')
|
self.topdir = os.path.join(self.archdir, 'os')
|
||||||
self.isodir = os.path.join(self.archdir, self.config.get('default','isodir'))
|
self.isodir = os.path.join(self.archdir, self.config.get('pungi','isodir'))
|
||||||
|
|
||||||
pypungi.util._ensuredir(self.workdir, self.logger, force=True)
|
pypungi.util._ensuredir(self.workdir, self.logger, force=True)
|
||||||
|
|
||||||
self.common_files = []
|
self.common_files = []
|
||||||
self.infofile = os.path.join(self.config.get('default', 'destdir'),
|
self.infofile = os.path.join(self.config.get('pungi', 'destdir'),
|
||||||
self.config.get('default', 'version'),
|
self.config.get('pungi', 'version'),
|
||||||
'.composeinfo')
|
'.composeinfo')
|
||||||
|
|
||||||
self.ksparser = ksparser
|
self.ksparser = ksparser
|
||||||
@ -148,20 +148,20 @@ class Pungi(pypungi.PungiBase):
|
|||||||
yumconf = yum.config.YumConf()
|
yumconf = yum.config.YumConf()
|
||||||
yumconf.debuglevel = 6
|
yumconf.debuglevel = 6
|
||||||
yumconf.errorlevel = 6
|
yumconf.errorlevel = 6
|
||||||
yumconf.cachedir = self.config.get('default', 'cachedir')
|
yumconf.cachedir = self.config.get('pungi', 'cachedir')
|
||||||
yumconf.persistdir = os.path.join(self.workdir, 'yumlib')
|
yumconf.persistdir = os.path.join(self.workdir, 'yumlib')
|
||||||
yumconf.installroot = os.path.join(self.workdir, 'yumroot')
|
yumconf.installroot = os.path.join(self.workdir, 'yumroot')
|
||||||
yumconf.uid = os.geteuid()
|
yumconf.uid = os.geteuid()
|
||||||
yumconf.cache = 0
|
yumconf.cache = 0
|
||||||
yumconf.failovermethod = 'priority'
|
yumconf.failovermethod = 'priority'
|
||||||
yumvars = yum.config._getEnvVar()
|
yumvars = yum.config._getEnvVar()
|
||||||
yumvars['releasever'] = self.config.get('default', 'version')
|
yumvars['releasever'] = self.config.get('pungi', 'version')
|
||||||
yumvars['basearch'] = yum.rpmUtils.arch.getBaseArch(myarch=self.config.get('default', 'arch'))
|
yumvars['basearch'] = yum.rpmUtils.arch.getBaseArch(myarch=self.config.get('pungi', '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)
|
||||||
|
|
||||||
arch = self.config.get('default', 'arch')
|
arch = self.config.get('pungi', 'arch')
|
||||||
if arch == 'i386':
|
if arch == 'i386':
|
||||||
yumarch = 'athlon'
|
yumarch = 'athlon'
|
||||||
elif arch == 'ppc':
|
elif arch == 'ppc':
|
||||||
@ -455,9 +455,9 @@ class Pungi(pypungi.PungiBase):
|
|||||||
downloads.sort()
|
downloads.sort()
|
||||||
self.logger.info("Download list: %s" % downloads)
|
self.logger.info("Download list: %s" % downloads)
|
||||||
|
|
||||||
pkgdir = os.path.join(self.config.get('default', 'destdir'),
|
pkgdir = os.path.join(self.config.get('pungi', 'destdir'),
|
||||||
self.config.get('default', 'version'),
|
self.config.get('pungi', 'version'),
|
||||||
self.config.get('default', 'flavor'),
|
self.config.get('pungi', 'flavor'),
|
||||||
relpkgdir)
|
relpkgdir)
|
||||||
|
|
||||||
# Ensure the pkgdir exists, force if requested, and make sure we clean it out
|
# Ensure the pkgdir exists, force if requested, and make sure we clean it out
|
||||||
@ -465,7 +465,7 @@ class Pungi(pypungi.PungiBase):
|
|||||||
# Since we share source dirs with other arches don't clean, but do allow us to use it
|
# Since we share source dirs with other arches don't clean, but do allow us to use it
|
||||||
pypungi.util._ensuredir(pkgdir, self.logger, force=True, clean=False)
|
pypungi.util._ensuredir(pkgdir, self.logger, force=True, clean=False)
|
||||||
else:
|
else:
|
||||||
pypungi.util._ensuredir(pkgdir, self.logger, force=self.config.getboolean('default', 'force'), clean=True)
|
pypungi.util._ensuredir(pkgdir, self.logger, force=self.config.getboolean('pungi', 'force'), clean=True)
|
||||||
|
|
||||||
probs = self.ayum.downloadPkgs(polist)
|
probs = self.ayum.downloadPkgs(polist)
|
||||||
|
|
||||||
@ -497,14 +497,14 @@ class Pungi(pypungi.PungiBase):
|
|||||||
"""Download the package objects obtained in getPackageObjects()."""
|
"""Download the package objects obtained in getPackageObjects()."""
|
||||||
|
|
||||||
self._downloadPackageList(self.polist,
|
self._downloadPackageList(self.polist,
|
||||||
os.path.join(self.config.get('default', 'arch'),
|
os.path.join(self.config.get('pungi', 'arch'),
|
||||||
self.config.get('default', 'osdir'),
|
self.config.get('pungi', 'osdir'),
|
||||||
self.config.get('default', 'product_path')))
|
self.config.get('pungi', 'product_path')))
|
||||||
|
|
||||||
def makeCompsFile(self):
|
def makeCompsFile(self):
|
||||||
"""Gather any comps files we can from repos and merge them into one."""
|
"""Gather any comps files we can from repos and merge them into one."""
|
||||||
|
|
||||||
ourcompspath = os.path.join(self.workdir, '%s-%s-comps.xml' % (self.config.get('default', 'name'), self.config.get('default', 'version')))
|
ourcompspath = os.path.join(self.workdir, '%s-%s-comps.xml' % (self.config.get('pungi', 'name'), self.config.get('pungi', 'version')))
|
||||||
|
|
||||||
ourcomps = open(ourcompspath, 'w')
|
ourcomps = open(ourcompspath, 'w')
|
||||||
|
|
||||||
@ -546,7 +546,7 @@ class Pungi(pypungi.PungiBase):
|
|||||||
download them."""
|
download them."""
|
||||||
|
|
||||||
# do the downloads
|
# do the downloads
|
||||||
self._downloadPackageList(self.debuginfolist, os.path.join(self.config.get('default', 'arch'),
|
self._downloadPackageList(self.debuginfolist, os.path.join(self.config.get('pungi', 'arch'),
|
||||||
'debug'))
|
'debug'))
|
||||||
|
|
||||||
def writeinfo(self, line):
|
def writeinfo(self, line):
|
||||||
@ -560,7 +560,7 @@ class Pungi(pypungi.PungiBase):
|
|||||||
def mkrelative(self, subfile):
|
def mkrelative(self, subfile):
|
||||||
"""Return the relative path for 'subfile' underneath the version dir."""
|
"""Return the relative path for 'subfile' underneath the version dir."""
|
||||||
|
|
||||||
basedir = os.path.join(self.destdir, self.config.get('default', 'version'))
|
basedir = os.path.join(self.destdir, self.config.get('pungi', 'version'))
|
||||||
if subfile.startswith(basedir):
|
if subfile.startswith(basedir):
|
||||||
return subfile.replace(basedir + os.path.sep, '')
|
return subfile.replace(basedir + os.path.sep, '')
|
||||||
|
|
||||||
@ -617,29 +617,29 @@ class Pungi(pypungi.PungiBase):
|
|||||||
|
|
||||||
compsfile = None
|
compsfile = None
|
||||||
if comps:
|
if comps:
|
||||||
compsfile = os.path.join(self.workdir, '%s-%s-comps.xml' % (self.config.get('default', 'name'), self.config.get('default', 'version')))
|
compsfile = os.path.join(self.workdir, '%s-%s-comps.xml' % (self.config.get('pungi', 'name'), self.config.get('pungi', 'version')))
|
||||||
|
|
||||||
# setup the cache dirs
|
# setup the cache dirs
|
||||||
for target in ['createrepocache', 'repoviewcache']:
|
for target in ['createrepocache', 'repoviewcache']:
|
||||||
pypungi.util._ensuredir(os.path.join(self.config.get('default', 'cachedir'),
|
pypungi.util._ensuredir(os.path.join(self.config.get('pungi', 'cachedir'),
|
||||||
target),
|
target),
|
||||||
self.logger,
|
self.logger,
|
||||||
force=True)
|
force=True)
|
||||||
|
|
||||||
repoviewtitle = '%s %s - %s' % (self.config.get('default', 'name'),
|
repoviewtitle = '%s %s - %s' % (self.config.get('pungi', 'name'),
|
||||||
self.config.get('default', 'version'),
|
self.config.get('pungi', 'version'),
|
||||||
self.config.get('default', 'arch'))
|
self.config.get('pungi', 'arch'))
|
||||||
|
|
||||||
cachedir = self.config.get('default', 'cachedir')
|
cachedir = self.config.get('pungi', 'cachedir')
|
||||||
|
|
||||||
# setup the createrepo call
|
# setup the createrepo call
|
||||||
self._makeMetadata(self.topdir, cachedir, compsfile, repoview=True, repoviewtitle=repoviewtitle)
|
self._makeMetadata(self.topdir, cachedir, compsfile, repoview=True, repoviewtitle=repoviewtitle)
|
||||||
|
|
||||||
# create repodata for debuginfo
|
# create repodata for debuginfo
|
||||||
if self.config.getboolean('default', 'debuginfo'):
|
if self.config.getboolean('pungi', 'debuginfo'):
|
||||||
path = os.path.join(self.archdir, 'debug')
|
path = os.path.join(self.archdir, 'debug')
|
||||||
if not os.path.isdir(path):
|
if not os.path.isdir(path):
|
||||||
self.logger.debug("No debuginfo for %s" % self.config.get('default', 'arch'))
|
self.logger.debug("No debuginfo for %s" % self.config.get('pungi', 'arch'))
|
||||||
return
|
return
|
||||||
self._makeMetadata(path, cachedir, repoview=False)
|
self._makeMetadata(path, cachedir, repoview=False)
|
||||||
|
|
||||||
@ -652,21 +652,21 @@ class Pungi(pypungi.PungiBase):
|
|||||||
#buildinstall.append('TMPDIR=%s' % self.workdir) # TMPDIR broken in buildinstall
|
#buildinstall.append('TMPDIR=%s' % self.workdir) # TMPDIR broken in buildinstall
|
||||||
|
|
||||||
buildinstall.append('--product')
|
buildinstall.append('--product')
|
||||||
buildinstall.append(self.config.get('default', 'name'))
|
buildinstall.append(self.config.get('pungi', 'name'))
|
||||||
|
|
||||||
if not self.config.get('default', 'flavor') == "":
|
if not self.config.get('pungi', 'flavor') == "":
|
||||||
buildinstall.append('--variant')
|
buildinstall.append('--variant')
|
||||||
buildinstall.append(self.config.get('default', 'flavor'))
|
buildinstall.append(self.config.get('pungi', 'flavor'))
|
||||||
|
|
||||||
buildinstall.append('--version')
|
buildinstall.append('--version')
|
||||||
buildinstall.append(self.config.get('default', 'version'))
|
buildinstall.append(self.config.get('pungi', 'version'))
|
||||||
|
|
||||||
buildinstall.append('--release')
|
buildinstall.append('--release')
|
||||||
buildinstall.append('%s %s' % (self.config.get('default', 'name'), self.config.get('default', 'version')))
|
buildinstall.append('%s %s' % (self.config.get('pungi', 'name'), self.config.get('pungi', 'version')))
|
||||||
|
|
||||||
if self.config.has_option('default', 'bugurl'):
|
if self.config.has_option('pungi', 'bugurl'):
|
||||||
buildinstall.append('--bugurl')
|
buildinstall.append('--bugurl')
|
||||||
buildinstall.append(self.config.get('default', 'bugurl'))
|
buildinstall.append(self.config.get('pungi', 'bugurl'))
|
||||||
|
|
||||||
buildinstall.append('--output')
|
buildinstall.append('--output')
|
||||||
buildinstall.append(self.topdir)
|
buildinstall.append(self.topdir)
|
||||||
@ -722,7 +722,7 @@ class Pungi(pypungi.PungiBase):
|
|||||||
os.path.walk(os.path.join(self.topdir, 'images'), getsum, self.topdir + '/')
|
os.path.walk(os.path.join(self.topdir, 'images'), getsum, self.topdir + '/')
|
||||||
|
|
||||||
# Capture PPC images
|
# Capture PPC images
|
||||||
if self.config.get('default', 'arch') == 'ppc':
|
if self.config.get('pungi', 'arch') == 'ppc':
|
||||||
os.path.walk(os.path.join(self.topdir, 'ppc'), getsum, self.topdir + '/')
|
os.path.walk(os.path.join(self.topdir, 'ppc'), getsum, self.topdir + '/')
|
||||||
|
|
||||||
# Get a checksum of repomd.xml since it has within it sums for other files
|
# Get a checksum of repomd.xml since it has within it sums for other files
|
||||||
@ -747,13 +747,13 @@ class Pungi(pypungi.PungiBase):
|
|||||||
"""Run anaconda-runtime's pkgorder on the tree, used for splitting media."""
|
"""Run anaconda-runtime's pkgorder on the tree, used for splitting media."""
|
||||||
|
|
||||||
|
|
||||||
pkgorderfile = open(os.path.join(self.workdir, 'pkgorder-%s' % self.config.get('default', 'arch')), 'w')
|
pkgorderfile = open(os.path.join(self.workdir, 'pkgorder-%s' % self.config.get('pungi', 'arch')), 'w')
|
||||||
# setup the command
|
# setup the command
|
||||||
pkgorder = ['/usr/bin/pkgorder']
|
pkgorder = ['/usr/bin/pkgorder']
|
||||||
#pkgorder.append('TMPDIR=%s' % self.workdir)
|
#pkgorder.append('TMPDIR=%s' % self.workdir)
|
||||||
pkgorder.append(self.topdir)
|
pkgorder.append(self.topdir)
|
||||||
pkgorder.append(self.config.get('default', 'arch'))
|
pkgorder.append(self.config.get('pungi', 'arch'))
|
||||||
pkgorder.append(self.config.get('default', 'product_path'))
|
pkgorder.append(self.config.get('pungi', 'product_path'))
|
||||||
|
|
||||||
# run the command
|
# run the command
|
||||||
pypungi.util._doRunCommand(pkgorder, self.logger, output=pkgorderfile)
|
pypungi.util._doRunCommand(pkgorder, self.logger, output=pkgorderfile)
|
||||||
@ -765,20 +765,20 @@ class Pungi(pypungi.PungiBase):
|
|||||||
|
|
||||||
|
|
||||||
docsdir = os.path.join(self.workdir, 'docs')
|
docsdir = os.path.join(self.workdir, 'docs')
|
||||||
relnoterpms = self.config.get('default', 'relnotepkgs').split()
|
relnoterpms = self.config.get('pungi', 'relnotepkgs').split()
|
||||||
|
|
||||||
fileres = []
|
fileres = []
|
||||||
for pattern in self.config.get('default', 'relnotefilere').split():
|
for pattern in self.config.get('pungi', 'relnotefilere').split():
|
||||||
fileres.append(re.compile(pattern))
|
fileres.append(re.compile(pattern))
|
||||||
|
|
||||||
dirres = []
|
dirres = []
|
||||||
for pattern in self.config.get('default', 'relnotedirre').split():
|
for pattern in self.config.get('pungi', 'relnotedirre').split():
|
||||||
dirres.append(re.compile(pattern))
|
dirres.append(re.compile(pattern))
|
||||||
|
|
||||||
pypungi.util._ensuredir(docsdir, self.logger, force=self.config.getboolean('default', 'force'), clean=True)
|
pypungi.util._ensuredir(docsdir, self.logger, force=self.config.getboolean('pungi', 'force'), clean=True)
|
||||||
|
|
||||||
# Expload the packages we list as relnote packages
|
# Expload the packages we list as relnote packages
|
||||||
pkgs = os.listdir(os.path.join(self.topdir, self.config.get('default', 'product_path')))
|
pkgs = os.listdir(os.path.join(self.topdir, self.config.get('pungi', 'product_path')))
|
||||||
|
|
||||||
rpm2cpio = ['/usr/bin/rpm2cpio']
|
rpm2cpio = ['/usr/bin/rpm2cpio']
|
||||||
cpio = ['cpio', '-imud']
|
cpio = ['cpio', '-imud']
|
||||||
@ -787,7 +787,7 @@ class Pungi(pypungi.PungiBase):
|
|||||||
pkgname = pkg.rsplit('-', 2)[0]
|
pkgname = pkg.rsplit('-', 2)[0]
|
||||||
for relnoterpm in relnoterpms:
|
for relnoterpm in relnoterpms:
|
||||||
if pkgname == relnoterpm:
|
if pkgname == relnoterpm:
|
||||||
extraargs = [os.path.join(self.topdir, self.config.get('default', 'product_path'), pkg)]
|
extraargs = [os.path.join(self.topdir, self.config.get('pungi', 'product_path'), pkg)]
|
||||||
try:
|
try:
|
||||||
p1 = subprocess.Popen(rpm2cpio + extraargs, cwd=docsdir, stdout=subprocess.PIPE)
|
p1 = subprocess.Popen(rpm2cpio + extraargs, cwd=docsdir, stdout=subprocess.PIPE)
|
||||||
(out, err) = subprocess.Popen(cpio, cwd=docsdir, stdin=p1.stdout, stdout=subprocess.PIPE,
|
(out, err) = subprocess.Popen(cpio, cwd=docsdir, stdin=p1.stdout, stdout=subprocess.PIPE,
|
||||||
@ -823,16 +823,16 @@ class Pungi(pypungi.PungiBase):
|
|||||||
|
|
||||||
|
|
||||||
timber = splittree.Timber()
|
timber = splittree.Timber()
|
||||||
timber.arch = self.config.get('default', 'arch')
|
timber.arch = self.config.get('pungi', 'arch')
|
||||||
timber.disc_size = self.config.getfloat('default', 'cdsize')
|
timber.disc_size = self.config.getfloat('pungi', 'cdsize')
|
||||||
timber.total_discs = self.config.getint('default', 'discs')
|
timber.total_discs = self.config.getint('pungi', 'discs')
|
||||||
timber.bin_discs = self.config.getint('default', 'discs')
|
timber.bin_discs = self.config.getint('pungi', 'discs')
|
||||||
timber.src_discs = 0
|
timber.src_discs = 0
|
||||||
timber.release_str = '%s %s' % (self.config.get('default', 'name'), self.config.get('default', 'version'))
|
timber.release_str = '%s %s' % (self.config.get('pungi', 'name'), self.config.get('pungi', 'version'))
|
||||||
timber.package_order_file = os.path.join(self.workdir, 'pkgorder-%s' % self.config.get('default', 'arch'))
|
timber.package_order_file = os.path.join(self.workdir, 'pkgorder-%s' % self.config.get('pungi', 'arch'))
|
||||||
timber.dist_dir = self.topdir
|
timber.dist_dir = self.topdir
|
||||||
timber.src_dir = os.path.join(self.config.get('default', 'destdir'), self.config.get('default', 'version'), 'source', 'SRPMS')
|
timber.src_dir = os.path.join(self.config.get('pungi', 'destdir'), self.config.get('pungi', 'version'), 'source', 'SRPMS')
|
||||||
timber.product_path = self.config.get('default', 'product_path')
|
timber.product_path = self.config.get('pungi', 'product_path')
|
||||||
timber.common_files = self.common_files
|
timber.common_files = self.common_files
|
||||||
timber.comps_size = 0
|
timber.comps_size = 0
|
||||||
#timber.reserve_size =
|
#timber.reserve_size =
|
||||||
@ -849,22 +849,22 @@ class Pungi(pypungi.PungiBase):
|
|||||||
|
|
||||||
|
|
||||||
timber = splittree.Timber()
|
timber = splittree.Timber()
|
||||||
timber.arch = self.config.get('default', 'arch')
|
timber.arch = self.config.get('pungi', 'arch')
|
||||||
timber.target_size = self.config.getfloat('default', 'cdsize') * 1024 * 1024
|
timber.target_size = self.config.getfloat('pungi', 'cdsize') * 1024 * 1024
|
||||||
#timber.total_discs = self.config.getint('default', 'discs')
|
#timber.total_discs = self.config.getint('pungi', 'discs')
|
||||||
#timber.bin_discs = self.config.getint('default', 'discs')
|
#timber.bin_discs = self.config.getint('pungi', 'discs')
|
||||||
timber.src_discs = self.config.getint('default', 'discs')
|
timber.src_discs = self.config.getint('pungi', 'discs')
|
||||||
#timber.release_str = '%s %s' % (self.config.get('default', 'name'), self.config.get('default', 'version'))
|
#timber.release_str = '%s %s' % (self.config.get('pungi', 'name'), self.config.get('pungi', 'version'))
|
||||||
#timber.package_order_file = os.path.join(self.config.get('default', 'destdir'), 'pkgorder-%s' % self.config.get('default', 'arch'))
|
#timber.package_order_file = os.path.join(self.config.get('pungi', 'destdir'), 'pkgorder-%s' % self.config.get('pungi', 'arch'))
|
||||||
timber.dist_dir = os.path.join(self.config.get('default', 'destdir'),
|
timber.dist_dir = os.path.join(self.config.get('pungi', 'destdir'),
|
||||||
self.config.get('default', 'version'),
|
self.config.get('pungi', 'version'),
|
||||||
self.config.get('default', 'flavor'),
|
self.config.get('pungi', 'flavor'),
|
||||||
'source', 'SRPMS')
|
'source', 'SRPMS')
|
||||||
timber.src_dir = os.path.join(self.config.get('default', 'destdir'),
|
timber.src_dir = os.path.join(self.config.get('pungi', 'destdir'),
|
||||||
self.config.get('default', 'version'),
|
self.config.get('pungi', 'version'),
|
||||||
self.config.get('default', 'flavor'),
|
self.config.get('pungi', 'flavor'),
|
||||||
'source', 'SRPMS')
|
'source', 'SRPMS')
|
||||||
#timber.product_path = self.config.get('default', 'product_path')
|
#timber.product_path = self.config.get('pungi', 'product_path')
|
||||||
#timber.reserve_size =
|
#timber.reserve_size =
|
||||||
# Set this ourselves, for creating our dirs ourselves
|
# Set this ourselves, for creating our dirs ourselves
|
||||||
timber.src_list = range(1, timber.src_discs + 1)
|
timber.src_list = range(1, timber.src_discs + 1)
|
||||||
@ -873,7 +873,7 @@ class Pungi(pypungi.PungiBase):
|
|||||||
for i in range(timber.src_list[0], timber.src_list[-1] + 1):
|
for i in range(timber.src_list[0], timber.src_list[-1] + 1):
|
||||||
pypungi.util._ensuredir('%s-disc%d/SRPMS' % (timber.dist_dir, i),
|
pypungi.util._ensuredir('%s-disc%d/SRPMS' % (timber.dist_dir, i),
|
||||||
self.logger,
|
self.logger,
|
||||||
force=self.config.getboolean('default', 'force'),
|
force=self.config.getboolean('pungi', 'force'),
|
||||||
clean=True)
|
clean=True)
|
||||||
timber.linkFiles(timber.dist_dir,
|
timber.linkFiles(timber.dist_dir,
|
||||||
"%s-disc%d" %(timber.dist_dir, i),
|
"%s-disc%d" %(timber.dist_dir, i),
|
||||||
@ -890,7 +890,7 @@ class Pungi(pypungi.PungiBase):
|
|||||||
discinfo = open(os.path.join(self.topdir, '.discinfo'), 'r').readlines()
|
discinfo = open(os.path.join(self.topdir, '.discinfo'), 'r').readlines()
|
||||||
mediaid = discinfo[0].rstrip('\n')
|
mediaid = discinfo[0].rstrip('\n')
|
||||||
|
|
||||||
compsfile = os.path.join(self.workdir, '%s-%s-comps.xml' % (self.config.get('default', 'name'), self.config.get('default', 'version')))
|
compsfile = os.path.join(self.workdir, '%s-%s-comps.xml' % (self.config.get('pungi', 'name'), self.config.get('pungi', 'version')))
|
||||||
|
|
||||||
if not split:
|
if not split:
|
||||||
pypungi.util._ensuredir('%s-disc1' % self.topdir, self.logger,
|
pypungi.util._ensuredir('%s-disc1' % self.topdir, self.logger,
|
||||||
@ -901,11 +901,11 @@ class Pungi(pypungi.PungiBase):
|
|||||||
path = '%s-disc1' % self.topdir
|
path = '%s-disc1' % self.topdir
|
||||||
basedir = path
|
basedir = path
|
||||||
split=[]
|
split=[]
|
||||||
for disc in range(1, self.config.getint('default', 'discs') + 1):
|
for disc in range(1, self.config.getint('pungi', 'discs') + 1):
|
||||||
split.append('%s-disc%s' % (self.topdir, disc))
|
split.append('%s-disc%s' % (self.topdir, disc))
|
||||||
|
|
||||||
# set up the process
|
# set up the process
|
||||||
self._makeMetadata(path, self.config.get('default', 'cachedir'), compsfile, repoview=False,
|
self._makeMetadata(path, self.config.get('pungi', 'cachedir'), compsfile, repoview=False,
|
||||||
baseurl='media://%s' % mediaid,
|
baseurl='media://%s' % mediaid,
|
||||||
output='%s-disc1' % self.topdir,
|
output='%s-disc1' % self.topdir,
|
||||||
basedir=basedir, split=split, update=False)
|
basedir=basedir, split=split, update=False)
|
||||||
@ -919,7 +919,7 @@ mediaid=%s
|
|||||||
metadata_expire=-1
|
metadata_expire=-1
|
||||||
gpgcheck=0
|
gpgcheck=0
|
||||||
cost=500
|
cost=500
|
||||||
""" % (self.config.get('default', 'name'), self.config.get('default', 'version'), mediaid)
|
""" % (self.config.get('pungi', 'name'), self.config.get('pungi', 'version'), mediaid)
|
||||||
|
|
||||||
repofile.write(repocontent)
|
repofile.write(repocontent)
|
||||||
repofile.close()
|
repofile.close()
|
||||||
@ -950,7 +950,7 @@ cost=500
|
|||||||
discinfofile = os.path.join(self.topdir, '.discinfo') # we use this a fair amount
|
discinfofile = os.path.join(self.topdir, '.discinfo') # we use this a fair amount
|
||||||
|
|
||||||
pypungi.util._ensuredir(self.isodir, self.logger,
|
pypungi.util._ensuredir(self.isodir, self.logger,
|
||||||
force=self.config.getboolean('default', 'force'),
|
force=self.config.getboolean('pungi', 'force'),
|
||||||
clean=True) # This is risky...
|
clean=True) # This is risky...
|
||||||
|
|
||||||
# setup the base command
|
# setup the base command
|
||||||
@ -976,73 +976,73 @@ cost=500
|
|||||||
|
|
||||||
# Check the size of the tree
|
# Check the size of the tree
|
||||||
# This size checking method may be bunk, accepting patches...
|
# This size checking method may be bunk, accepting patches...
|
||||||
if not self.config.get('default', 'arch') == 'source':
|
if not self.config.get('pungi', 'arch') == 'source':
|
||||||
treesize = int(subprocess.Popen(mkisofs + ['-print-size', '-quiet', self.topdir], stdout=subprocess.PIPE).communicate()[0])
|
treesize = int(subprocess.Popen(mkisofs + ['-print-size', '-quiet', self.topdir], stdout=subprocess.PIPE).communicate()[0])
|
||||||
else:
|
else:
|
||||||
srcdir = os.path.join(self.config.get('default', 'destdir'), self.config.get('default', 'version'),
|
srcdir = os.path.join(self.config.get('pungi', 'destdir'), self.config.get('pungi', 'version'),
|
||||||
self.config.get('default', 'flavor'), 'source', 'SRPMS')
|
self.config.get('pungi', 'flavor'), 'source', 'SRPMS')
|
||||||
|
|
||||||
treesize = int(subprocess.Popen(mkisofs + ['-print-size', '-quiet', srcdir], stdout=subprocess.PIPE).communicate()[0])
|
treesize = int(subprocess.Popen(mkisofs + ['-print-size', '-quiet', srcdir], stdout=subprocess.PIPE).communicate()[0])
|
||||||
# Size returned is 2KiB clusters or some such. This translates that to MiB.
|
# Size returned is 2KiB clusters or some such. This translates that to MiB.
|
||||||
treesize = treesize * 2048 / 1024 / 1024
|
treesize = treesize * 2048 / 1024 / 1024
|
||||||
|
|
||||||
cdsize = self.config.getfloat('default', 'cdsize')
|
cdsize = self.config.getfloat('pungi', 'cdsize')
|
||||||
|
|
||||||
# Do some math to figure out how many discs we'd need
|
# Do some math to figure out how many discs we'd need
|
||||||
if treesize < cdsize or not split:
|
if treesize < cdsize or not split:
|
||||||
self.config.set('default', 'discs', '1')
|
self.config.set('pungi', 'discs', '1')
|
||||||
else:
|
else:
|
||||||
discs = int(treesize / cdsize + 1)
|
discs = int(treesize / cdsize + 1)
|
||||||
self.config.set('default', 'discs', str(discs))
|
self.config.set('pungi', 'discs', str(discs))
|
||||||
|
|
||||||
if not self.config.get('default', 'arch') == 'source':
|
if not self.config.get('pungi', 'arch') == 'source':
|
||||||
self.doCreateMediarepo(split=False)
|
self.doCreateMediarepo(split=False)
|
||||||
|
|
||||||
if treesize > 700: # we're larger than a 700meg CD
|
if treesize > 700: # we're larger than a 700meg CD
|
||||||
isoname = '%s-%s-%s-DVD.iso' % (self.config.get('default', 'iso_basename'), self.config.get('default', 'version'),
|
isoname = '%s-%s-%s-DVD.iso' % (self.config.get('pungi', 'iso_basename'), self.config.get('pungi', 'version'),
|
||||||
self.config.get('default', 'arch'))
|
self.config.get('pungi', 'arch'))
|
||||||
else:
|
else:
|
||||||
isoname = '%s-%s-%s.iso' % (self.config.get('default', 'iso_basename'), self.config.get('default', 'version'),
|
isoname = '%s-%s-%s.iso' % (self.config.get('pungi', 'iso_basename'), self.config.get('pungi', 'version'),
|
||||||
self.config.get('default', 'arch'))
|
self.config.get('pungi', 'arch'))
|
||||||
|
|
||||||
isofile = os.path.join(self.isodir, isoname)
|
isofile = os.path.join(self.isodir, isoname)
|
||||||
|
|
||||||
if not self.config.get('default', 'arch') == 'source':
|
if not self.config.get('pungi', 'arch') == 'source':
|
||||||
# move the main repodata out of the way to use the split repodata
|
# move the main repodata out of the way to use the split repodata
|
||||||
if os.path.isdir(os.path.join(self.config.get('default', 'destdir'),
|
if os.path.isdir(os.path.join(self.config.get('pungi', 'destdir'),
|
||||||
'repodata-%s' % self.config.get('default', 'arch'))):
|
'repodata-%s' % self.config.get('pungi', 'arch'))):
|
||||||
shutil.rmtree(os.path.join(self.config.get('default', 'destdir'),
|
shutil.rmtree(os.path.join(self.config.get('pungi', 'destdir'),
|
||||||
'repodata-%s' % self.config.get('default', 'arch')))
|
'repodata-%s' % self.config.get('pungi', 'arch')))
|
||||||
|
|
||||||
shutil.move(os.path.join(self.topdir, 'repodata'), os.path.join(self.config.get('default', 'destdir'),
|
shutil.move(os.path.join(self.topdir, 'repodata'), os.path.join(self.config.get('pungi', 'destdir'),
|
||||||
'repodata-%s' % self.config.get('default', 'arch')))
|
'repodata-%s' % self.config.get('pungi', 'arch')))
|
||||||
shutil.copytree('%s-disc1/repodata' % self.topdir, os.path.join(self.topdir, 'repodata'))
|
shutil.copytree('%s-disc1/repodata' % self.topdir, os.path.join(self.topdir, 'repodata'))
|
||||||
|
|
||||||
# setup the extra mkisofs args
|
# setup the extra mkisofs args
|
||||||
extraargs = []
|
extraargs = []
|
||||||
|
|
||||||
if self.config.get('default', 'arch') == 'i386' or self.config.get('default', 'arch') == 'x86_64':
|
if self.config.get('pungi', 'arch') == 'i386' or self.config.get('pungi', 'arch') == 'x86_64':
|
||||||
extraargs.extend(x86bootargs)
|
extraargs.extend(x86bootargs)
|
||||||
elif self.config.get('default', 'arch') == 'ia64':
|
elif self.config.get('pungi', 'arch') == 'ia64':
|
||||||
extraargs.extend(ia64bootargs)
|
extraargs.extend(ia64bootargs)
|
||||||
elif self.config.get('default', 'arch') == 'ppc':
|
elif self.config.get('pungi', 'arch') == 'ppc':
|
||||||
extraargs.extend(ppcbootargs)
|
extraargs.extend(ppcbootargs)
|
||||||
extraargs.append(os.path.join(self.topdir, "ppc/mac"))
|
extraargs.append(os.path.join(self.topdir, "ppc/mac"))
|
||||||
elif self.config.get('default', 'arch') == 'sparc':
|
elif self.config.get('pungi', 'arch') == 'sparc':
|
||||||
extraargs.extend(sparcbootargs)
|
extraargs.extend(sparcbootargs)
|
||||||
|
|
||||||
extraargs.append('-V')
|
extraargs.append('-V')
|
||||||
if treesize > 700:
|
if treesize > 700:
|
||||||
extraargs.append('%s %s %s DVD' % (self.config.get('default', 'name'),
|
extraargs.append('%s %s %s DVD' % (self.config.get('pungi', 'name'),
|
||||||
self.config.get('default', 'version'), self.config.get('default', 'arch')))
|
self.config.get('pungi', 'version'), self.config.get('pungi', 'arch')))
|
||||||
else:
|
else:
|
||||||
extraargs.append('%s %s %s' % (self.config.get('default', 'name'),
|
extraargs.append('%s %s %s' % (self.config.get('pungi', 'name'),
|
||||||
self.config.get('default', 'version'), self.config.get('default', 'arch')))
|
self.config.get('pungi', 'version'), self.config.get('pungi', 'arch')))
|
||||||
|
|
||||||
extraargs.append('-o')
|
extraargs.append('-o')
|
||||||
extraargs.append(isofile)
|
extraargs.append(isofile)
|
||||||
|
|
||||||
if not self.config.get('default', 'arch') == 'source':
|
if not self.config.get('pungi', 'arch') == 'source':
|
||||||
extraargs.append(self.topdir)
|
extraargs.append(self.topdir)
|
||||||
else:
|
else:
|
||||||
extraargs.append(os.path.join(self.archdir, 'SRPMS'))
|
extraargs.append(os.path.join(self.archdir, 'SRPMS'))
|
||||||
@ -1051,7 +1051,7 @@ cost=500
|
|||||||
pypungi.util._doRunCommand(mkisofs + extraargs, self.logger)
|
pypungi.util._doRunCommand(mkisofs + extraargs, self.logger)
|
||||||
|
|
||||||
# implant md5 for mediacheck on all but source arches
|
# implant md5 for mediacheck on all but source arches
|
||||||
if not self.config.get('default', 'arch') == 'source':
|
if not self.config.get('pungi', 'arch') == 'source':
|
||||||
pypungi.util._doRunCommand(['/usr/bin/implantisomd5', isofile], self.logger)
|
pypungi.util._doRunCommand(['/usr/bin/implantisomd5', isofile], self.logger)
|
||||||
|
|
||||||
# shove the sha1sum into a file
|
# shove the sha1sum into a file
|
||||||
@ -1059,47 +1059,47 @@ cost=500
|
|||||||
self._doIsoSha1(isofile, sha1file)
|
self._doIsoSha1(isofile, sha1file)
|
||||||
|
|
||||||
# return the .discinfo file
|
# return the .discinfo file
|
||||||
if not self.config.get('default', 'arch') == 'source':
|
if not self.config.get('pungi', 'arch') == 'source':
|
||||||
shutil.rmtree(os.path.join(self.topdir, 'repodata')) # remove our copied repodata
|
shutil.rmtree(os.path.join(self.topdir, 'repodata')) # remove our copied repodata
|
||||||
shutil.move(os.path.join(self.config.get('default', 'destdir'),
|
shutil.move(os.path.join(self.config.get('pungi', 'destdir'),
|
||||||
'repodata-%s' % self.config.get('default', 'arch')), os.path.join(self.topdir, 'repodata'))
|
'repodata-%s' % self.config.get('pungi', 'arch')), os.path.join(self.topdir, 'repodata'))
|
||||||
|
|
||||||
# Move the unified disk out
|
# Move the unified disk out
|
||||||
if not self.config.get('default', 'arch') == 'source':
|
if not self.config.get('pungi', 'arch') == 'source':
|
||||||
shutil.rmtree(os.path.join(self.workdir, 'os-unified'), ignore_errors=True)
|
shutil.rmtree(os.path.join(self.workdir, 'os-unified'), ignore_errors=True)
|
||||||
shutil.move('%s-disc1' % self.topdir, os.path.join(self.workdir, 'os-unified'))
|
shutil.move('%s-disc1' % self.topdir, os.path.join(self.workdir, 'os-unified'))
|
||||||
|
|
||||||
# Write out a line describing the media
|
# Write out a line describing the media
|
||||||
self.writeinfo('media: %s' % self.mkrelative(isofile))
|
self.writeinfo('media: %s' % self.mkrelative(isofile))
|
||||||
|
|
||||||
if self.config.getint('default', 'discs') > 1:
|
if self.config.getint('pungi', 'discs') > 1:
|
||||||
if self.config.get('default', 'arch') == 'source':
|
if self.config.get('pungi', 'arch') == 'source':
|
||||||
self.doSplitSRPMs()
|
self.doSplitSRPMs()
|
||||||
else:
|
else:
|
||||||
self.doPackageorder()
|
self.doPackageorder()
|
||||||
self.doSplittree()
|
self.doSplittree()
|
||||||
self.doCreateMediarepo(split=True)
|
self.doCreateMediarepo(split=True)
|
||||||
for disc in range(1, self.config.getint('default', 'discs') + 1): # cycle through the CD isos
|
for disc in range(1, self.config.getint('pungi', 'discs') + 1): # cycle through the CD isos
|
||||||
isoname = '%s-%s-%s-disc%s.iso' % (self.config.get('default', 'iso_basename'), self.config.get('default', 'version'),
|
isoname = '%s-%s-%s-disc%s.iso' % (self.config.get('pungi', 'iso_basename'), self.config.get('pungi', 'version'),
|
||||||
self.config.get('default', 'arch'), disc)
|
self.config.get('pungi', 'arch'), disc)
|
||||||
isofile = os.path.join(self.isodir, isoname)
|
isofile = os.path.join(self.isodir, isoname)
|
||||||
|
|
||||||
extraargs = []
|
extraargs = []
|
||||||
|
|
||||||
if disc == 1: # if this is the first disc, we want to set boot flags
|
if disc == 1: # if this is the first disc, we want to set boot flags
|
||||||
if self.config.get('default', 'arch') == 'i386' or self.config.get('default', 'arch') == 'x86_64':
|
if self.config.get('pungi', 'arch') == 'i386' or self.config.get('pungi', 'arch') == 'x86_64':
|
||||||
extraargs.extend(x86bootargs)
|
extraargs.extend(x86bootargs)
|
||||||
elif self.config.get('default', 'arch') == 'ia64':
|
elif self.config.get('pungi', 'arch') == 'ia64':
|
||||||
extraargs.extend(ia64bootargs)
|
extraargs.extend(ia64bootargs)
|
||||||
elif self.config.get('default', 'arch') == 'ppc':
|
elif self.config.get('pungi', 'arch') == 'ppc':
|
||||||
extraargs.extend(ppcbootargs)
|
extraargs.extend(ppcbootargs)
|
||||||
extraargs.append(os.path.join('%s-disc%s' % (self.topdir, disc), "ppc/mac"))
|
extraargs.append(os.path.join('%s-disc%s' % (self.topdir, disc), "ppc/mac"))
|
||||||
elif self.config.get('default', 'arch') == 'sparc':
|
elif self.config.get('pungi', 'arch') == 'sparc':
|
||||||
extraargs.extend(sparcbootargs)
|
extraargs.extend(sparcbootargs)
|
||||||
|
|
||||||
extraargs.append('-V')
|
extraargs.append('-V')
|
||||||
extraargs.append('%s %s %s Disc %s' % (self.config.get('default', 'name'),
|
extraargs.append('%s %s %s Disc %s' % (self.config.get('pungi', 'name'),
|
||||||
self.config.get('default', 'version'), self.config.get('default', 'arch'), disc))
|
self.config.get('pungi', 'version'), self.config.get('pungi', 'arch'), disc))
|
||||||
|
|
||||||
extraargs.append('-o')
|
extraargs.append('-o')
|
||||||
extraargs.append(isofile)
|
extraargs.append(isofile)
|
||||||
@ -1110,7 +1110,7 @@ cost=500
|
|||||||
pypungi.util._doRunCommand(mkisofs + extraargs, self.logger)
|
pypungi.util._doRunCommand(mkisofs + extraargs, self.logger)
|
||||||
|
|
||||||
# implant md5 for mediacheck on all but source arches
|
# implant md5 for mediacheck on all but source arches
|
||||||
if not self.config.get('default', 'arch') == 'source':
|
if not self.config.get('pungi', 'arch') == 'source':
|
||||||
pypungi.util._doRunCommand(['/usr/bin/implantisomd5', isofile], self.logger)
|
pypungi.util._doRunCommand(['/usr/bin/implantisomd5', isofile], self.logger)
|
||||||
|
|
||||||
# shove the sha1sum into a file
|
# shove the sha1sum into a file
|
||||||
@ -1124,10 +1124,10 @@ cost=500
|
|||||||
self.writeinfo('mediaset: %s' % ' '.join(isolist))
|
self.writeinfo('mediaset: %s' % ' '.join(isolist))
|
||||||
|
|
||||||
# Now link the boot iso
|
# Now link the boot iso
|
||||||
if not self.config.get('default', 'arch') == 'source' and \
|
if not self.config.get('pungi', 'arch') == 'source' and \
|
||||||
os.path.exists(os.path.join(self.topdir, 'images', 'boot.iso')):
|
os.path.exists(os.path.join(self.topdir, 'images', 'boot.iso')):
|
||||||
isoname = '%s-%s-%s-netinst.iso' % (self.config.get('default', 'iso_basename'),
|
isoname = '%s-%s-%s-netinst.iso' % (self.config.get('pungi', 'iso_basename'),
|
||||||
self.config.get('default', 'version'), self.config.get('default', 'arch'))
|
self.config.get('pungi', 'version'), self.config.get('pungi', 'arch'))
|
||||||
isofile = os.path.join(self.isodir, isoname)
|
isofile = os.path.join(self.isodir, isoname)
|
||||||
|
|
||||||
# link the boot iso to the iso dir
|
# link the boot iso to the iso dir
|
||||||
|
@ -22,24 +22,24 @@ class Config(SafeConfigParser):
|
|||||||
def __init__(self):
|
def __init__(self):
|
||||||
SafeConfigParser.__init__(self)
|
SafeConfigParser.__init__(self)
|
||||||
|
|
||||||
self.add_section('default')
|
self.add_section('pungi')
|
||||||
|
|
||||||
self.set('default', 'osdir', 'os')
|
self.set('pungi', 'osdir', 'os')
|
||||||
self.set('default', 'sourcedir', 'source')
|
self.set('pungi', 'sourcedir', 'source')
|
||||||
self.set('default', 'debugdir', 'debug')
|
self.set('pungi', 'debugdir', 'debug')
|
||||||
self.set('default', 'isodir', 'iso')
|
self.set('pungi', 'isodir', 'iso')
|
||||||
self.set('default', 'relnotefilere', 'GPL README-BURNING-ISOS-en_US.txt ^RPM-GPG')
|
self.set('pungi', 'relnotefilere', 'GPL README-BURNING-ISOS-en_US.txt ^RPM-GPG')
|
||||||
self.set('default', 'relnotedirre', '')
|
self.set('pungi', 'relnotedirre', '')
|
||||||
self.set('default', 'relnotepkgs', 'fedora-release fedora-release-notes')
|
self.set('pungi', 'relnotepkgs', 'fedora-release fedora-release-notes')
|
||||||
self.set('default', 'product_path', 'Packages')
|
self.set('pungi', 'product_path', 'Packages')
|
||||||
self.set('default', 'cachedir', '/var/cache/pungi')
|
self.set('pungi', 'cachedir', '/var/cache/pungi')
|
||||||
self.set('default', 'arch', yum.rpmUtils.arch.getBaseArch(os.uname()[4]))
|
self.set('pungi', 'arch', yum.rpmUtils.arch.getBaseArch(os.uname()[4]))
|
||||||
self.set('default', 'name', 'Fedora')
|
self.set('pungi', 'name', 'Fedora')
|
||||||
self.set('default', 'iso_basename', 'Fedora')
|
self.set('pungi', 'iso_basename', 'Fedora')
|
||||||
self.set('default', 'version', time.strftime('%Y%m%d', time.localtime()))
|
self.set('pungi', 'version', time.strftime('%Y%m%d', time.localtime()))
|
||||||
self.set('default', 'flavor', '')
|
self.set('pungi', 'flavor', '')
|
||||||
self.set('default', 'destdir', os.getcwd())
|
self.set('pungi', 'destdir', os.getcwd())
|
||||||
self.set('default', 'bugurl', 'https://bugzilla.redhat.com')
|
self.set('pungi', 'bugurl', 'https://bugzilla.redhat.com')
|
||||||
self.set('default', 'cdsize', '695.0')
|
self.set('pungi', 'cdsize', '695.0')
|
||||||
self.set('default', 'debuginfo', "True")
|
self.set('pungi', 'debuginfo', "True")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user