From 5c9d28dc9ff3fa66be5c2ebc10b1f31b37501c5d Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Wed, 23 Jul 2014 07:41:10 -0500 Subject: [PATCH] fix up some issues with --no-dvd and --workbasedir --- src/bin/pungi.py | 4 ++++ src/pypungi/__init__.py | 16 ++++++++-------- src/pypungi/config.py | 2 +- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/bin/pungi.py b/src/bin/pungi.py index 9c34d946..746e49d2 100755 --- a/src/bin/pungi.py +++ b/src/bin/pungi.py @@ -52,6 +52,8 @@ def main(): config.set('pungi', 'force', str(opts.force)) + if config.get('pungi', 'workdirbase') == '/work': + config.set('pungi', 'workdirbase', "%s/work" % config.get('pungi', 'destdir')) # Set up our directories if not os.path.exists(config.get('pungi', 'destdir')): try: @@ -104,6 +106,8 @@ def main(): config.set('pungi', 'multilib', " ".join(opts.multilib)) if opts.lookaside_repos: config.set('pungi', 'lookaside_repos', " ".join(opts.lookaside_repos)) + if opts.no_dvd: + config.set('pungi', 'no_dvd', "True") config.set("pungi", "fulltree", str(bool(opts.fulltree))) config.set("pungi", "selfhosting", str(bool(opts.selfhosting))) config.set("pungi", "nosource", str(bool(opts.nosource))) diff --git a/src/pypungi/__init__.py b/src/pypungi/__init__.py index 67c70226..2bf7107f 100644 --- a/src/pypungi/__init__.py +++ b/src/pypungi/__init__.py @@ -1619,17 +1619,17 @@ class Pungi(pypungi.PungiBase): else: extraargs.append(os.path.join(self.archdir, 'SRPMS')) - if not self.config.get('pungi', 'no_dvd'): + if self.config.get('pungi', 'no_dvd') == "False": # run the command pypungi.util._doRunCommand(mkisofs + extraargs, self.logger) - # Run isohybrid on the iso as long as its not the source iso - if os.path.exists("/usr/bin/isohybrid") and not self.tree_arch == 'source': - pypungi.util._doRunCommand(isohybrid, self.logger) + # Run isohybrid on the iso as long as its not the source iso + if os.path.exists("/usr/bin/isohybrid") and not self.tree_arch == 'source': + pypungi.util._doRunCommand(isohybrid, self.logger) - # implant md5 for mediacheck on all but source arches - if not self.tree_arch == 'source': - pypungi.util._doRunCommand(['/usr/bin/implantisomd5', isofile], self.logger) + # implant md5 for mediacheck on all but source arches + if not self.tree_arch == 'source': + pypungi.util._doRunCommand(['/usr/bin/implantisomd5', isofile], self.logger) # shove the checksum into a file csumfile = os.path.join(self.isodir, '%s-%s-%s-CHECKSUM' % ( @@ -1641,7 +1641,7 @@ class Pungi(pypungi.PungiBase): file = open(csumfile, 'w') file.write('# The image checksum(s) are generated with sha256sum.\n') file.close() - if not self.config.get('pungi', 'no_dvd'): + if self.config.get('pungi', 'no_dvd') == "False": self._doIsoChecksum(isofile, csumfile) # Write out a line describing the media diff --git a/src/pypungi/config.py b/src/pypungi/config.py index edfc2cf2..4305d4fa 100644 --- a/src/pypungi/config.py +++ b/src/pypungi/config.py @@ -40,7 +40,7 @@ class Config(SafeConfigParser): self.set('pungi', 'version', time.strftime('%Y%m%d', time.localtime())) self.set('pungi', 'flavor', '') self.set('pungi', 'destdir', os.getcwd()) - self.set('pungi', 'workdirbase', "%s/work" % self.get('pungi', 'destdir')) + self.set('pungi', 'workdirbase', "/work") self.set('pungi', 'bugurl', 'https://bugzilla.redhat.com') self.set('pungi', 'cdsize', '695.0') self.set('pungi', 'debuginfo', "True")