diff options
author | Michael E Brown <michael_e_brown@dell.com> | 2007-12-21 13:41:03 -0600 |
---|---|---|
committer | Michael E Brown <michael_e_brown@dell.com> | 2007-12-21 13:41:03 -0600 |
commit | aefe3d7b6e7c289c84bea6865e7020b4c4637ea4 (patch) | |
tree | f0229059717ddce5dc8756872b5616b5711e5502 /py/mock | |
parent | 3ae0cfcbab2ace30d69484ef2ab267cf84176a0c (diff) | |
parent | 99e36b173e3fa707796a8a13e9b356e651544044 (diff) | |
download | mock-aefe3d7b6e7c289c84bea6865e7020b4c4637ea4.tar.gz mock-aefe3d7b6e7c289c84bea6865e7020b4c4637ea4.tar.xz mock-aefe3d7b6e7c289c84bea6865e7020b4c4637ea4.zip |
Merge branch 'master' of /var/ftp/pub/Applications/git/mock
* 'master' of /var/ftp/pub/Applications/git/mock:
/usr/sbin/mock no longer needs to be owned by group mock.
remove unused debugging code.
version bump and changelog
fix privs for yum resolvdep, needs to be root to download addl filelists.
fixup release instructions so that tags properly pushed.
update changelog prior to release.
bump version. add comment about making sure to fix both version defs.
cleanup from unit tests if they are interrupted or end prematurely.
fix resultdir for --uniqueext builds without resultdir specified. try to standardize on single-quotes for indexing hashes.
we are now noarch, fix unit tests.
add tmpfs plugin to installation list.
requires usermode due to new userhelper stuff.
fix use of tabs in spec file to make rpmlint happy.
Run rpmbuild in a login shell in the chroot.
Diffstat (limited to 'py/mock')
-rw-r--r-- | py/mock/backend.py | 57 |
1 files changed, 28 insertions, 29 deletions
diff --git a/py/mock/backend.py b/py/mock/backend.py index 66a3951..38a2abd 100644 --- a/py/mock/backend.py +++ b/py/mock/backend.py @@ -33,11 +33,10 @@ class Root(object): self.buildrootLock = None self.sharedRootName = config['root'] - root = self.sharedRootName if config.has_key('unique-ext'): - root = "%s-%s" % (root, config['unique-ext']) + config['root'] = "%s-%s" % (config['root'], config['unique-ext']) - self.basedir = os.path.join(config['basedir'], root) + self.basedir = os.path.join(config['basedir'], config['root']) self.target_arch = config['target_arch'] self._rootdir = os.path.join(self.basedir, 'root') self.homedir = config['chroothome'] @@ -76,11 +75,11 @@ class Root(object): self.pluginConf = config['plugin_conf'] self.pluginDir = config['plugin_dir'] for key in self.pluginConf.keys(): - if not key.endswith("_opts"): continue - self.pluginConf[key]["basedir"] = self.basedir - self.pluginConf[key]["cache_topdir"] = self.cache_topdir - self.pluginConf[key]["cachedir"] = self.cachedir - self.pluginConf[key]["root"] = self.sharedRootName + if not key.endswith('_opts'): continue + self.pluginConf[key]['basedir'] = self.basedir + self.pluginConf[key]['cache_topdir'] = self.cache_topdir + self.pluginConf[key]['cachedir'] = self.cachedir + self.pluginConf[key]['root'] = self.sharedRootName # mount/umount self.umountCmds = ['umount -n %s' % self.makeChrootPath('proc'), @@ -326,27 +325,27 @@ class Root(object): decorate(traceLog()) def installSrpmDeps(self, *srpms): """figure out deps from srpm. call yum to install them""" - arg_string = self.preExistingDeps - for hdr in mock.util.yieldSrpmHeaders(srpms, plainRpmOk=1): - # get text buildreqs - a = mock.util.requiresTextFromHdr(hdr) - b = mock.util.getAddtlReqs(hdr, self.more_buildreqs) - for item in mock.util.uniqReqs(a, b): - arg_string = arg_string + " '%s'" % item - - # everything exists, okay, install them all. - # pass build reqs (as strings) to installer - if arg_string != "": - output = self._yum('resolvedep %s' % arg_string, returnOutput=1) - for line in output.split('\n'): - if line.lower().find('No Package found for'.lower()) != -1: - raise mock.exception.BuildError, "Bad build req: %s. Exiting." % line - # nothing made us exit, so we continue + try: self.uidManager.becomeUser(0, 0) - try: + arg_string = self.preExistingDeps + for hdr in mock.util.yieldSrpmHeaders(srpms, plainRpmOk=1): + # get text buildreqs + a = mock.util.requiresTextFromHdr(hdr) + b = mock.util.getAddtlReqs(hdr, self.more_buildreqs) + for item in mock.util.uniqReqs(a, b): + arg_string = arg_string + " '%s'" % item + + # everything exists, okay, install them all. + # pass build reqs (as strings) to installer + if arg_string != "": + output = self._yum('resolvedep %s' % arg_string, returnOutput=1) + for line in output.split('\n'): + if line.lower().find('No Package found for'.lower()) != -1: + raise mock.exception.BuildError, "Bad build req: %s. Exiting." % line + # nothing made us exit, so we continue self._yum('install %s' % arg_string, returnOutput=1) - finally: - self.uidManager.restorePrivs() + finally: + self.uidManager.restorePrivs() # @@ -388,7 +387,7 @@ class Root(object): chrootspec = spec.replace(self.makeChrootPath(), '') # get rid of rootdir prefix # Completely/Permanently drop privs while running the following: self.doChroot( - "rpmbuild -bs --target %s --nodeps %s" % (self.target_arch, chrootspec), + "bash -l -c 'rpmbuild -bs --target %s --nodeps %s'" % (self.target_arch, chrootspec), logger=self.build_log, timeout=timeout, uidManager=self.uidManager, uid=self.chrootuid, @@ -409,7 +408,7 @@ class Root(object): self._callHooks('prebuild') self.doChroot( - "rpmbuild -bb --target %s --nodeps %s" % (self.target_arch, chrootspec), + "bash -l -c 'rpmbuild -bb --target %s --nodeps %s'" % (self.target_arch, chrootspec), logger=self.build_log, timeout=timeout, uidManager=self.uidManager, uid=self.chrootuid, |