diff --git a/Changelog b/Changelog index 6519eede..24363a80 100644 --- a/Changelog +++ b/Changelog @@ -1,3 +1,6 @@ +* Thu Nov 29 2007 Jesse Keating +- Add a split option to the doCreateIsos call + * Wed Nov 28 2007 Jesse Keating - Figure out number of isos on the fly, based on tree size - Add command line option to disable creation of split media diff --git a/pungi b/pungi index 3d074f00..18be2312 100755 --- a/pungi +++ b/pungi @@ -82,7 +82,7 @@ def main(): mypungi.doGetRelnotes() if opts.do_all or opts.do_createiso: - mypungi.doCreateIsos() + mypungi.doCreateIsos(split=opts.nosplitmedia) # Do things slightly different for src. if opts.sourceisos: @@ -93,7 +93,7 @@ def main(): config.get('default', 'flavor'), 'source', 'SRPM') if opts.do_all or opts.do_createiso: - mypungi.doCreateIsos() + mypungi.doCreateIsos(split=opts.nosplitmedia) print "All done!" @@ -134,7 +134,7 @@ if __name__ == '__main__': help='the number of discs you want to create (defaults to 1)') parser.add_option("--nosource", action="store_true", dest="nosource", help='disable gathering of source packages (optional)') - parser.add_option("--nosplitmedia", action="store_true", dest="nosplitmedia", + parser.add_option("--nosplitmedia", action="store_true", dest="nosplitmedia", default=False, help='disable creation of split media (optional)') parser.add_option("--sourceisos", default=False, action="store_true", dest="sourceisos", help='Create the source isos (other arch runs must be done)') diff --git a/pypungi/pungi.py b/pypungi/pungi.py index 4e7337e2..e7d4a372 100755 --- a/pypungi/pungi.py +++ b/pypungi/pungi.py @@ -336,7 +336,7 @@ cost=500 repofile.write(repocontent) repofile.close() - def doCreateIsos(self): + def doCreateIsos(self, split=True): """Create isos of the tree, optionally splitting the tree for split media.""" @@ -369,20 +369,25 @@ cost=500 # Check the size of the tree # This size checking method may be bunk, accepting patches... - treesize = int(subprocess.Popen(mkisofs + ['-print-size', '-quiet', self.topdir], stdout=subprocess.PIPE).communicate()[0]) + if not self.config.get('default', 'arch') == 'source': + treesize = int(subprocess.Popen(mkisofs + ['-print-size', '-quiet', self.topdir], stdout=subprocess.PIPE).communicate()[0]) + else: + srcdir = os.path.join(self.config.get('default', 'destdir'), self.config.get('default', 'version'), 'source', 'SRPMS') + + 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. treesize = treesize * 2048 / 1024 / 1024 cdsize = self.config.getfloat('default', 'cdsize') # Do some math to figure out how many discs we'd need - if treesize < cdsize or self.config.has_option('default', 'nosplitmedia'): + if treesize < cdsize or not split: self.config.set('default', 'discs', '1') else: discs = int(treesize / cdsize + 1) self.config.set('default', 'discs', str(discs)) if self.config.get('default', 'arch') == 'source': - self.doSplitSRPMS() + self.doSplitSRPMs() else: self.doPackageorder() self.doSplittree()