brange merge from upstream

This commit is contained in:
wwoods@kraid.test.redhat.com 2007-02-13 13:23:44 -05:00 committed by Jesse Keating
commit d21d767336
2 changed files with 18 additions and 16 deletions

View File

@ -191,6 +191,7 @@ class Gather(yum.YumBase):
if not self.config.has_option('default', 'quiet'):
self.logger.info("%s already exists and appears to be complete" % local)
target=os.path.join(pkgdir, os.path.basename(remote))
if os.path.exists(target):
os.remove(target) # avoid traceback after interrupted download
os.link(local, target)
continue

View File

@ -23,7 +23,8 @@ class Pungi:
def __init__(self, config):
self.config = config
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', 'flavor'),
self.config.get('default', 'arch'))
@ -49,10 +50,10 @@ class Pungi:
f.write(line.strip()+"\n")
f.close()
def relativize(self,dir,subfile):
'''Get the relative path for subfile underneath dir.'''
if subfile.startswith(dir):
return subfile.replace(dir+os.path.sep,'')
def mkrelative(self,subfile):
'''Return the relative path for 'subfile' underneath 'self.destdir'.'''
if subfile.startswith(self.destdir):
return subfile.replace(self.destdir+os.path.sep,'')
def doBuildinstall(self):
# 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'),
bugurl, self.topdir)
os.system('/usr/lib/anaconda-runtime/buildinstall %s' % args)
self.writeinfo('tree: %s' % relativize(self.destdir,self.topdir))
self.writeinfo('tree: %s' % self.mkrelative(self.topdir))
def doPackageorder(self):
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
os.system('cd %s; sha1sum %s >> SHA1SUM' % (self.isodir, isoname))
# keep track of the CD images we've written
isolist.append(relativize(self.destdir,isofile))
isolist.append(self.mkrelative(isofile))
# Write out a line describing the CD set
self.writeinfo('cdset=%s' % ' '.join(isolist))
self.writeinfo('cdset: %s' % ' '.join(isolist))
isolist=[]
# 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
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,
bootargs,
isofile,
@ -260,10 +261,10 @@ class Pungi:
shutil.move(os.path.join(self.config.get('default', 'destdir'),
'repodata-%s' % self.config.get('default', 'arch')), os.path.join(self.topdir, 'repodata'))
# keep track of the DVD images we've written
isolist.append(relativize(self.destdir,isofile))
isolist.append(self.mkrelative(isofile))
# Write out a line describing the DVD set
self.writeinfo('dvdset=%s' % ' '.join(isolist))
self.writeinfo('dvdset: %s' % ' '.join(isolist))
# Now make rescue images
if not self.config.get('default', 'arch') == 'source':