Fix source iso building

This commit is contained in:
Jesse Keating 2007-03-26 10:39:46 -04:00 committed by Jesse Keating
parent d2c9c76a55
commit 0a0bbe6688
2 changed files with 36 additions and 20 deletions

View File

@ -1,6 +1,12 @@
* Mon Mar 26 2007 Jesse Keating <jkeating@redhat.com>
- Enable source iso building again.
* Fri Mar 23 2007 Jesse Keating <jkeating@redhat.com>
- Don't try a rescue if the script doesn't exist (prarit)
- Make sure group conditionals are enabled
* Thu Mar 22 2007 Jesse Keating <jkeating@redhat.com> * Thu Mar 22 2007 Jesse Keating <jkeating@redhat.com>
- Pass flavor off to buildinstall if it is set (wwoods) - Pass flavor off to buildinstall if it is set (wwoods)
- Don't try a rescue if the script doesn't exist (prarit)
* Fri Mar 16 2007 Jesse Keating <jkeating@redhat.com> * Fri Mar 16 2007 Jesse Keating <jkeating@redhat.com>
- Fix a logic flaw in the depsolving loop - Fix a logic flaw in the depsolving loop

View File

@ -234,6 +234,10 @@ class Pungi:
"""Use anaconda-runtime's splittree to split the srpms into appropriate """Use anaconda-runtime's splittree to split the srpms into appropriate
sized chunks.""" sized chunks."""
# non-op for only one disc
if self.config.getint('default', 'discs') == 1:
return
timber = splittree.Timber() timber = splittree.Timber()
timber.arch = self.config.get('default', 'arch') timber.arch = self.config.get('default', 'arch')
#timber.total_discs = self.config.getint('default', 'discs') #timber.total_discs = self.config.getint('default', 'discs')
@ -379,23 +383,24 @@ class Pungi:
self.writeinfo('cdset: %s' % ' '.join(isolist)) self.writeinfo('cdset: %s' % ' '.join(isolist))
isolist=[] isolist=[]
# We've asked for more than one disc, and we're not srpms, so make a DVD image # We've asked for one or more discs, so make a DVD image
if self.config.getint('default', 'discs') >= 1 and not self.config.get('default', 'arch') == 'source': if self.config.getint('default', 'discs') >= 1:
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('default', 'iso_basename'), self.config.get('default', 'version'),
self.config.get('default', 'arch')) self.config.get('default', 'arch'))
isofile = os.path.join(self.isodir, isoname) isofile = os.path.join(self.isodir, isoname)
# backup the main .discinfo to use a split one. This is an ugly hack :/ if not self.config.get('default', 'arch') == 'source':
content = open(discinfofile, 'r').readlines() # backup the main .discinfo to use a split one. This is an ugly hack :/
shutil.move(discinfofile, os.path.join(self.config.get('default', 'destdir'), content = open(discinfofile, 'r').readlines()
'.discinfo-%s' % self.config.get('default', 'arch'))) shutil.move(discinfofile, os.path.join(self.config.get('default', 'destdir'),
content[content.index('ALL\n')] = ','.join([str(x) for x in range(1, self.config.getint('default', 'discs') + 1)]) + '\n' '.discinfo-%s' % self.config.get('default', 'arch')))
open(discinfofile, 'w').writelines(content) content[content.index('ALL\n')] = ','.join([str(x) for x in range(1, self.config.getint('default', 'discs') + 1)]) + '\n'
open(discinfofile, 'w').writelines(content)
# 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
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('default', 'destdir'),
'repodata-%s' % self.config.get('default', 'arch'))) 'repodata-%s' % self.config.get('default', '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 = []
@ -418,13 +423,17 @@ class Pungi:
extraargs.append('-o') extraargs.append('-o')
extraargs.append(isofile) extraargs.append(isofile)
extraargs.append(self.topdir) if not self.config.get('default', 'arch') == 'source':
extraargs.append(self.topdir)
else:
extraargs.append(os.path.join(self.archdir, 'SRPMS'))
# run the command # run the command
self._doRunCommand(mkisofs + extraargs) self._doRunCommand(mkisofs + extraargs)
# implant md5 for mediacheck on all but source arches # implant md5 for mediacheck on all but source arches
self._doRunCommand(['/usr/lib/anaconda-runtime/implantisomd5', isofile]) if not self.config.get('default', 'arch') == 'source':
self._doRunCommand(['/usr/lib/anaconda-runtime/implantisomd5', isofile])
# shove the sha1sum into a file # shove the sha1sum into a file
sha1file = open(os.path.join(self.isodir, 'SHA1SUM'), 'a') sha1file = open(os.path.join(self.isodir, 'SHA1SUM'), 'a')
@ -432,11 +441,12 @@ class Pungi:
sha1file.close() sha1file.close()
# return the .discinfo file # return the .discinfo file
shutil.move(os.path.join(self.config.get('default', 'destdir'), '.discinfo-%s' % self.config.get('default', 'arch')), discinfofile) if not self.config.get('default', 'arch') == 'source':
shutil.move(os.path.join(self.config.get('default', 'destdir'), '.discinfo-%s' % self.config.get('default', 'arch')), discinfofile)
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('default', 'destdir'),
'repodata-%s' % self.config.get('default', 'arch')), os.path.join(self.topdir, 'repodata')) 'repodata-%s' % self.config.get('default', 'arch')), os.path.join(self.topdir, 'repodata'))
# keep track of the DVD images we've written # keep track of the DVD images we've written
isolist.append(self.mkrelative(isofile)) isolist.append(self.mkrelative(isofile))
@ -445,7 +455,7 @@ class Pungi:
self.writeinfo('dvdset: %s' % ' '.join(isolist)) self.writeinfo('dvdset: %s' % ' '.join(isolist))
# Now make rescue images # Now make rescue images
if not self.config.get('default', 'arch') == 'source' and if not self.config.get('default', 'arch') == 'source' and \
os.path.exists('/usr/lib/anaconda-runtime/mk-rescueimage.%s' % self.config.get('default', 'arch')): os.path.exists('/usr/lib/anaconda-runtime/mk-rescueimage.%s' % self.config.get('default', 'arch')):
isoname = '%s-%s-%s-rescuecd.iso' % (self.config.get('default', 'iso_basename'), isoname = '%s-%s-%s-rescuecd.iso' % (self.config.get('default', 'iso_basename'),
self.config.get('default', 'version'), self.config.get('default', 'arch')) self.config.get('default', 'version'), self.config.get('default', 'arch'))