fix up .composeinfo/mkrelative stuff

This commit is contained in:
wwoods@kraid.test.redhat.com 2007-02-13 13:23:00 -05:00 committed by Jesse Keating
parent e2e81e481c
commit 8bb0495b63

View File

@ -23,7 +23,8 @@ class Pungi:
def __init__(self, config): def __init__(self, config):
self.config = config self.config = config
self.prodpath = 'Fedora' # Probably should be defined elsewhere self.prodpath = 'Fedora' # Probably should be defined elsewhere
self.archdir = os.path.join(self.config.get('default', 'destdir'), self.destdir = self.config.get('default', 'destdir')
self.archdir = os.path.join(self.destdir,
self.config.get('default', 'version'), self.config.get('default', 'version'),
self.config.get('default', 'flavor'), self.config.get('default', 'flavor'),
self.config.get('default', 'arch')) self.config.get('default', 'arch'))
@ -49,10 +50,10 @@ class Pungi:
f.write(line.strip()+"\n") f.write(line.strip()+"\n")
f.close() f.close()
def mkrelative(self,dir,subfile): def mkrelative(self,subfile):
'''Return the relative path for 'subfile' underneath 'dir'.''' '''Return the relative path for 'subfile' underneath 'self.destdir'.'''
if subfile.startswith(dir): if subfile.startswith(self.destdir):
return subfile.replace(dir+os.path.sep,'') return subfile.replace(self.destdir+os.path.sep,'')
def doBuildinstall(self): def doBuildinstall(self):
# buildinstall looks for a comps file in base/ for now, copy it into place # buildinstall looks for a comps file in base/ for now, copy it into place
@ -67,7 +68,7 @@ class Pungi:
self.config.get('default', 'version')), self.config.get('default', 'product_path'), self.config.get('default', 'version')), self.config.get('default', 'product_path'),
bugurl, self.topdir) bugurl, self.topdir)
os.system('/usr/lib/anaconda-runtime/buildinstall %s' % args) os.system('/usr/lib/anaconda-runtime/buildinstall %s' % args)
self.writeinfo('tree: %s' % self.mkrelative(self.destdir,self.topdir)) self.writeinfo('tree: %s' % self.mkrelative(self.topdir))
def doPackageorder(self): def doPackageorder(self):
os.system('/usr/lib/anaconda-runtime/pkgorder %s %s %s > %s' % (self.topdir, self.config.get('default', 'arch'), os.system('/usr/lib/anaconda-runtime/pkgorder %s %s %s > %s' % (self.topdir, self.config.get('default', 'arch'),
@ -212,9 +213,9 @@ class Pungi:
# shove the sha1sum into a file # shove the sha1sum into a file
os.system('cd %s; sha1sum %s >> SHA1SUM' % (self.isodir, isoname)) os.system('cd %s; sha1sum %s >> SHA1SUM' % (self.isodir, isoname))
# keep track of the CD images we've written # keep track of the CD images we've written
isolist.append(self.mkrelative(self.destdir,isofile)) isolist.append(self.mkrelative(isofile))
# Write out a line describing the CD set # Write out a line describing the CD set
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 more than one disc, and we're not srpms, so make a DVD image
@ -246,7 +247,7 @@ class Pungi:
bootargs = '' # clear out any existing bootargs bootargs = '' # clear out any existing bootargs
isofile=os.path.join(self.isodir, isoname) isofile=os.path.join(self.isodir, isoname)
os.system('mkisofs %s %s %s -o %s/%s %s' % (mkisofsargs, os.system('mkisofs %s %s %s -o %s %s' % (mkisofsargs,
volname, volname,
bootargs, bootargs,
isofile, isofile,
@ -260,10 +261,10 @@ class Pungi:
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(self.destdir,isofile)) isolist.append(self.mkrelative(isofile))
# Write out a line describing the DVD set # Write out a line describing the DVD set
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': if not self.config.get('default', 'arch') == 'source':