summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjcwillia <jcwillia>2006-11-21 20:11:17 +0000
committerjcwillia <jcwillia>2006-11-21 20:11:17 +0000
commit02ef2e9359892a7ff2e804a8fa0178a9282927b5 (patch)
treecf0e2e834fd714af7526e7c0205d35b6e3b5a1d9
parentd9e30f7e1028263169f7e9d61767abdd6614d0f0 (diff)
downloadmock-02ef2e9359892a7ff2e804a8fa0178a9282927b5.tar.gz
mock-02ef2e9359892a7ff2e804a8fa0178a9282927b5.tar.xz
mock-02ef2e9359892a7ff2e804a8fa0178a9282927b5.zip
added Eric Work's patch to fix bz#215168; added fixes for bz#209407 and bz#213516); removed commented out code
-rw-r--r--mock.py32
1 files changed, 14 insertions, 18 deletions
diff --git a/mock.py b/mock.py
index 3f544de..62f94e1 100644
--- a/mock.py
+++ b/mock.py
@@ -719,14 +719,6 @@ class Root:
self._build_dir_setup()
self._mount() # check it again
- # FIXME - do we need this still?
- # create /boot/kernel.h with a warning
- #self.do_chroot ("mkdir -p /boot", fatal = True)
- #self.do_chroot ("echo '#ifndef __BOOT_KERNEL_H_' > /boot/kernel.h", fatal = True)
- #self.do_chroot ("echo '#define __BOOT_KERNEL_H_' >> /boot/kernel.h", fatal = True)
- #self.do_chroot ("echo '#error This is a kernel.h generated by mock, including this indicates a build error !' >> /boot/kernel.h", fatal = True)
- #self.do_chroot ("echo '#endif /* __BOOT_KERNEL_H_ */' >> /boot/kernel.h", fatal = True)
-
def command_parse():
"""return options and args from parsing the command line"""
@@ -812,21 +804,24 @@ def set_config_opts_per_cmdline(config_opts, options):
# do some other options and stuff
if options.arch:
config_opts['target_arch'] = options.arch
-
- config_opts['clean'] = options.clean
- config_opts['debug'] = options.debug
- config_opts['quiet'] = options.quiet
- config_opts['use_cache'] = options.use_cache
- config_opts['rebuild_cache'] = options.rebuild_cache
+ if not options.clean:
+ config_opts['clean'] = options.clean
+ if options.debug:
+ config_opts['debug'] = options.debug
+ if options.quiet:
+ config_opts['quiet'] = options.quiet
+ if options.use_cache:
+ config_opts['use_cache'] = options.use_cache
+ if options.rebuild_cache:
+ config_opts['rebuild_cache'] = options.rebuild_cache
+ if config_opts['rebuild_cache']:
+ config_opts['use_cache'] = True
if config_opts['rebuild_cache']:
config_opts['use_cache'] = True
-
if options.resultdir:
config_opts['resultdir'] = options.resultdir
-
if options.statedir:
config_opts['statedir'] = options.statedir
-
if options.uniqueext:
config_opts['unique-ext'] = options.uniqueext
@@ -939,7 +934,8 @@ def main():
if os.path.exists(cfg):
execfile(cfg)
else:
- pass # not finding the defaults.cfg file is no error
+ if config_path != "/etc/mock" and os.file.exists("/etc/mock/defaults.cfg"):
+ execfile("/etc/mock/defaults.cfg")
# read in the config file by chroot name
if options.chroot.endswith('.cfg'):