From 5d46c0c53baea814ecca19761bfa1f01f12a1a85 Mon Sep 17 00:00:00 2001 From: wwoods@metroid.rdu.redhat.com <> Date: Feb 13 2007 16:06:35 +0000 Subject: merge from jesse's branch --- diff --git a/.hgtags b/.hgtags index 7efcb84..5ef1910 100644 --- a/.hgtags +++ b/.hgtags @@ -15,7 +15,3 @@ ebfe0e963db6d7b652f63f99aaec121e7ff19074 pungi-0.2.1-1 769a8e08d77a2234295449282b16ca38ff4d846e pungi-0.2.2-1 ba049c3454d5dae9326d8050bb0d7d8116982ca4 f7-test1 780520383876b76dd06fa013e1a41ddd6bf0901e pungi-0.2.3-1 -158bd9a170892b43645caed12bddc3602ef3be4d pungi-0.2.3-1 -6659955ccfdf29ecd6027bd3770f80d815720af0 pungi-0.2.3-1 -9f7b5877c32c533d00ea6baa67057ce424a40a61 pungi-0.2.3-1 -7ea08753383766ce36bb49fef6d4fcf44158ad26 pungi-0.2.3-1 diff --git a/Authors b/Authors index 5aad5f5..3a2217f 100644 --- a/Authors +++ b/Authors @@ -1,8 +1 @@ -Authors: - Jesse Keating - -Contributors: - -Will Woods -sien Ita Essien diff --git a/Changelog b/Changelog index d162911..cf4cbbe 100644 --- a/Changelog +++ b/Changelog @@ -1,8 +1,3 @@ -* Tue Feb 13 2007 Jesse Keating -- Fix part of the patch from Essien -- Add Contributors to the Authors file -- Adjust the Makefile so that srpm doesn't cause a tag - * Mon Feb 12 2007 Jesse Keating - Add new Make targets (Essien Ita Essien) - Add runtime flags for doing specific stages of the compose (Essien Ita Essien) diff --git a/Makefile b/Makefile index ba0a1b2..8e01e6c 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,7 @@ tag: @hg tag -m "$(HGTAG)" $(HGTAG) # @hg push -archive: +archive: tag @rm -rf ${PKGNAME}-$(VERSION)/ @python setup.py sdist > /dev/null @echo "The archive is in dist/${PKGNAME}-$(VERSION).tar.gz" @@ -27,7 +27,7 @@ srpm: archive @rpmbuild -bs ${PKGRPMFLAGS} ${PKGNAME}.spec @echo "The srpm is in $(SRPM)" -rpm: archive tag +rpm: archive @rpmbuild --clean -bb ${PKGRPMFLAGS} ${PKGNAME}.spec @echo "The rpm is in $(RPM)" diff --git a/pungi b/pungi index da335d4..c2c547d 100755 --- a/pungi +++ b/pungi @@ -114,7 +114,7 @@ def main(): mypungi.doSplittree() if opts.do_all or opts.do_createiso: mypungi.doCreateSplitrepo() - mypungi.doCreateIsos() + mypungi.doCreateIsos(config.get('default', 'iso_dir')) # Do things slightly different for src. if config.get('default', 'arch') == 'source': diff --git a/pypungi/gather.py b/pypungi/gather.py index 2d1c0dc..5b24c0c 100755 --- a/pypungi/gather.py +++ b/pypungi/gather.py @@ -190,7 +190,9 @@ class Gather(yum.YumBase): if not self.config.has_option('default', 'quiet'): self.logger.info("%s already exists and appears to be complete" % local) - os.link(local, os.path.join(pkgdir, os.path.basename(remote))) + target=os.path.join(pkgdir, os.path.basename(remote)) + os.remove(target) # avoid traceback after interrupted download + os.link(local, target) continue # Disable cache otherwise things won't download diff --git a/pypungi/pungi.py b/pypungi/pungi.py index 537d20a..94c849b 100755 --- a/pypungi/pungi.py +++ b/pypungi/pungi.py @@ -40,7 +40,19 @@ class Pungi: os.makedirs(self.workdir) self.common_files = [] + self.infofile = os.path.join(self.config.get('default','destdir'), + '.composeinfo') + def writeinfo(self,line): + '''Append a line to the infofile in self.infofile''' + f=open(self.infofile,"a+") + 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 doBuildinstall(self): # buildinstall looks for a comps file in base/ for now, copy it into place @@ -55,6 +67,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)) def doPackageorder(self): os.system('/usr/lib/anaconda-runtime/pkgorder %s %s %s > %s' % (self.topdir, self.config.get('default', 'arch'), @@ -171,6 +184,7 @@ class Pungi: ia64bootargs = '-b images/boot.img -no-emul-boot' ppcbootargs = '-part -hfs -r -l -sysid PPC -map %s -magic %s -no-desktop -allow-multidot -chrp-boot -hfs-bless' % (os.path.join(anaruntime, 'mapping'), os.path.join(anaruntime, 'magic')) os.makedirs(self.isodir) + isolist=[] for disc in range(1, self.config.getint('default', 'discs') + 1): # cycle through the CD isos volname = '"%s %s %s Disc %s"' % (self.config.get('default', 'product_name'), self.config.get('default', 'version'), self.config.get('default', 'arch'), disc) # hacky :/ @@ -186,18 +200,23 @@ class Pungi: else: bootargs = '' # clear out any existing bootargs - os.system('mkisofs %s %s %s -o %s/%s %s' % (mkisofsargs, + isofile=os.path.join(self.isodir, isoname) + os.system('mkisofs %s %s %s -o %s %s' % (mkisofsargs, volname, bootargs, - self.isodir, - isoname, + isofile, os.path.join('%s-disc%s' % (self.topdir, disc)))) # implant md5 for mediacheck on all but source arches if not self.config.get('default', 'arch') == 'source': - os.system('/usr/lib/anaconda-runtime/implantisomd5 %s' % os.path.join(self.isodir, isoname)) + os.system('/usr/lib/anaconda-runtime/implantisomd5 %s' % isofile) # 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)) + # Write out a line describing the CD set + 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 if self.config.getint('default', 'discs') > 1 and not self.config.get('default', 'arch') == 'source': # backup the main .discinfo to use a split one. This is an ugly hack :/ @@ -226,20 +245,25 @@ class Pungi: else: bootargs = '' # clear out any existing bootargs + isofile=os.path.join(self.isodir, isoname) os.system('mkisofs %s %s %s -o %s/%s %s' % (mkisofsargs, volname, bootargs, - self.isodir, - isoname, + isofile, self.topdir)) os.system('cd %s; sha1sum %s >> SHA1SUM' % (self.isodir, isoname)) - os.system('/usr/lib/anaconda-runtime/implantisomd5 %s' % os.path.join(self.isodir, isoname)) + os.system('/usr/lib/anaconda-runtime/implantisomd5 %s' % isofile) 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.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)) + + # Write out a line describing the DVD set + self.writeinfo('dvdset=%s' % ' '.join(isolist)) # Now make rescue images if not self.config.get('default', 'arch') == 'source':