diff options
author | Michael E Brown <mebrown@michaels-house.net> | 2007-11-17 18:58:53 -0600 |
---|---|---|
committer | Michael E Brown <mebrown@michaels-house.net> | 2007-11-17 18:58:53 -0600 |
commit | 41be2f7ec5b41e978e833f87883b92e37d42e136 (patch) | |
tree | c15f72816beabdaecc6a64e7c505248fd6c02475 | |
parent | 36ef1aca01a4acdf146f54092bbf869e95972761 (diff) | |
download | mock-41be2f7ec5b41e978e833f87883b92e37d42e136.tar.gz mock-41be2f7ec5b41e978e833f87883b92e37d42e136.tar.xz mock-41be2f7ec5b41e978e833f87883b92e37d42e136.zip |
make setarch configurable because suse doesnt have it.
-rwxr-xr-x | src/mock.py | 7 | ||||
-rw-r--r-- | src/py-libs/backend.py | 10 |
2 files changed, 13 insertions, 4 deletions
diff --git a/src/mock.py b/src/mock.py index 2668bf3..80f4f86 100755 --- a/src/mock.py +++ b/src/mock.py @@ -118,6 +118,7 @@ def setup_default_config_opts(config_opts): config_opts['build_log_fmt_name'] = "unadorned" config_opts['root_log_fmt_name'] = "detailed" config_opts['state_log_fmt_name'] = "state" + config_opts['internal_setarch'] = True # cleanup_on_* only take effect for separate --resultdir # config_opts provides fine-grained control. cmdline only has big hammer @@ -195,6 +196,10 @@ def set_config_opts_per_cmdline(config_opts, options): config_opts['cleanup_on_success'] = False config_opts['cleanup_on_failure'] = False + config_opts['setarch'] = "" + if config_opts['internal_setarch']: + config_opts['setarch'] = "setarch %s" % config_opts['target_arch'] + @traceLog(log) def warn_obsolete_config_options(config_opts): pass @@ -308,7 +313,7 @@ def main(retParams): chroot._mountall() try: cmd = ' '.join(args[1:]) - os.system("PS1='mock-chroot> ' setarch %s /usr/sbin/chroot %s %s" % (config_opts['target_arch'], chroot.rootdir, cmd)) + os.system("PS1='mock-chroot> ' %s /usr/sbin/chroot %s %s" % (config_opts['setarch'], chroot.rootdir, cmd)) finally: chroot._umountall() diff --git a/src/py-libs/backend.py b/src/py-libs/backend.py index 971b030..492e8a0 100644 --- a/src/py-libs/backend.py +++ b/src/py-libs/backend.py @@ -32,7 +32,11 @@ class Root(object): self.uidManager = uidManager self._hooks = {} self.chrootWasCleaned = False - self.preExistingDeps = "/usr/bin/setarch " + + self.preExistingDeps = "" + self.setarch = config['setarch'] + if config['internal_setarch']: + self.preExistingDeps = "/usr/bin/setarch " self.sharedRootName = config['root'] root = self.sharedRootName @@ -372,7 +376,7 @@ class Root(object): self._callHooks('prebuild') mock.util.do( - "setarch %s rpmbuild -bb --target %s --nodeps %s" % (self.target_arch, self.target_arch, chrootspec), + "%s rpmbuild -bb --target %s --nodeps %s" % (self.setarch, self.target_arch, chrootspec), chrootPath=self.rootdir, uidManager=self.uidManager, uid=self.chrootuid, @@ -440,7 +444,7 @@ class Root(object): def _yum(self, cmd, returnOutput=0): """use yum to install packages/package groups into the chroot""" # mock-helper yum --installroot=rootdir cmd - cmd = 'setarch %s %s --installroot %s %s' % (self.target_arch, self.yum_path, self.rootdir, cmd) + cmd = '%s %s --installroot %s %s' % (self.setarch, self.yum_path, self.rootdir, cmd) self.root_log.info(cmd) try: self._callHooks("preyum") |