diff options
-rw-r--r-- | Makefile.am | 1 | ||||
-rw-r--r-- | configure.ac | 7 | ||||
-rw-r--r-- | docs/release-instructions.txt | 5 | ||||
-rwxr-xr-x | docs/runtests.sh | 16 | ||||
-rw-r--r-- | mock.spec.in | 20 | ||||
-rwxr-xr-x | py/mock.py | 8 | ||||
-rw-r--r-- | py/mock/backend.py | 57 |
7 files changed, 62 insertions, 52 deletions
diff --git a/Makefile.am b/Makefile.am index 284070e..89bbb72 100644 --- a/Makefile.am +++ b/Makefile.am @@ -43,6 +43,7 @@ plugins_PYTHON = \ py/mock/plugins/bind_mount.py \ py/mock/plugins/ccache.py \ py/mock/plugins/root_cache.py \ + py/mock/plugins/tmpfs.py \ py/mock/plugins/yum_cache.py pkgpython_PYTHON = \ diff --git a/configure.ac b/configure.ac index 91407cd..9aca48f 100644 --- a/configure.ac +++ b/configure.ac @@ -3,15 +3,14 @@ # Process this file with autoconf to produce a configure script. #################################### -# change version here. -AC_INIT([mock],[0.9.2]) +# change version here. --> BOTH PLACES PLEASE! +AC_INIT([mock],[0.9.5]) temp_RELEASE_NAME=mock temp_RELEASE_MAJOR=0 temp_RELEASE_MINOR=9 -temp_RELEASE_SUBLEVEL=3 +temp_RELEASE_SUBLEVEL=5 temp_RELEASE_EXTRALEVEL= - #################################### AC_PREREQ(2.61) diff --git a/docs/release-instructions.txt b/docs/release-instructions.txt index cffb38a..f33b881 100644 --- a/docs/release-instructions.txt +++ b/docs/release-instructions.txt @@ -25,8 +25,9 @@ In the git tree: $ git commit -m 'version bump' configure.ac 11) tag the git tree: $ git tag -u <your key> mock-<version> - 12) push to main git repo: - $ git push + 12) push to main git repo (only from master branch): + # substitute 'master' with branch name if on another branch + $ git push --tags origin master ===================================================================== diff --git a/docs/runtests.sh b/docs/runtests.sh index 0c8330a..08cb656 100755 --- a/docs/runtests.sh +++ b/docs/runtests.sh @@ -33,6 +33,8 @@ outdir=${CURDIR}/mock-unit-test MOCKCMD="sudo ./py/mock.py --resultdir=$outdir --uniqueext=$uniqueext -r $testConfig $MOCK_EXTRA_ARGS" CHROOT=/var/lib/mock/${testConfig}-$uniqueext/root +trap '$MOCKCMD --clean' INT HUP QUIT EXIT TERM + # clear out root cache so we get at least run without root cache present #sudo rm -rf /var/lib/mock/cache/${testConfig}/root_cache @@ -90,8 +92,8 @@ fi # Test offline build as well as tmpfs # time $MOCKCMD --offline --enable-plugin=tmpfs --rebuild $MOCKSRPM -if [ ! -e $outdir/mock-*.x86_64.rpm ]; then - echo "rebuild test FAILED. could not find $outdir/mock-*.x86_64.rpm" +if [ ! -e $outdir/mock-*.noarch.rpm ]; then + echo "rebuild test FAILED. could not find $outdir/mock-*.noarch.rpm" exit 1 fi @@ -163,12 +165,18 @@ if [ ! -e $CHROOT/usr/bin/ccache ]; then fi # +# clean up from first round of tests +# +time $MOCKCMD --offline --clean + +# # Test build all configs we ship. # for i in $(ls etc/mock | grep .cfg | grep -v default | grep -v ppc); do + MOCKCMD="sudo ./py/mock.py --resultdir=$outdir --uniqueext=$uniqueext -r $(basename $i .cfg) $MOCK_EXTRA_ARGS" # test tmpfs and normal - time sudo ./py/mock.py --resultdir=$outdir --uniqueext=$uniqueext --enable-plugin=tmpfs --rebuild $MOCKSRPM -r $(basename $i .cfg) $MOCK_EXTRA_ARGS - time sudo ./py/mock.py --resultdir=$outdir --uniqueext=$uniqueext rebuild $MOCKSRPM -r $(basename $i .cfg) $MOCK_EXTRA_ARGS + time $MOCKCMD --enable-plugin=tmpfs --rebuild $MOCKSRPM + time $MOCKCMD --rebuild $MOCKSRPM done diff --git a/mock.spec.in b/mock.spec.in index 6b61ec4..413f4dc 100644 --- a/mock.spec.in +++ b/mock.spec.in @@ -18,7 +18,7 @@ Source: http://fedoraproject.org/projects/mock/releases/%{name}-%{version}.tar.g URL: http://fedoraproject.org/wiki/Projects/Mock BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch -Requires: python >= 2.4, yum >= 2.4, tar, gzip, python-ctypes, python-decoratortools +Requires: python >= 2.4, yum >= 2.4, tar, gzip, python-ctypes, python-decoratortools, usermode Requires(pre): shadow-utils BuildRequires: python-devel @@ -71,6 +71,16 @@ fi %attr(02775, root, mock) %dir /var/lib/mock %changelog +* Thu Dec 20 2007 Michael Brown <mebrown@michaels-house.net> - 0.9.5-1 +- really fix file-based BuildRequires + +* Wed Dec 19 2007 Michael Brown <mebrown@michaels-house.net> - 0.9.4-1 +- Result dir was not honoring --uniqueext= +- make rpmbuild run under a chroot login shell +- mock is now noarch due to drop of all binary components +- add tmpfs plugin (disabled by default) +- slightly more friendly logs. + * Fri Dec 14 2007 Clark Williams <williams@redhat.com> - 0.9.3-1 - added '--copyin' and '--copyout' modes - added makeChrootPath() method to Root @@ -124,10 +134,10 @@ fi * Thu Nov 29 2007 Clark Williams <williams@redhat.com> - 0.8.11-1 - fixes from mebrown: -- added back -q and -v flags -- print yum output by default -- added --offline option -- cleaned up uid handling +- added back -q and -v flags +- print yum output by default +- added --offline option +- cleaned up uid handling * Mon Nov 26 2007 Michael Brown <mebrown@michaels-house.net> - 0.8.10-1 - fix 'shell' command @@ -374,12 +374,6 @@ def main(ret): unprivUid = os.getuid() unprivGid = os.getgid() - #DEBUG - #import mock.uid - #print("UID: %s %s" % (repr(mock.uid.getresuid()), repr(mock.uid.getresgid()))) - #for k, v in os.environ.items(): - # print " %s: %s" % (k, v) - # sudo if os.environ.get("SUDO_UID") is not None: unprivUid = int(os.environ['SUDO_UID']) @@ -387,7 +381,6 @@ def main(ret): groups = [ g[2] for g in grp.getgrall() if username in g[3]] os.setgroups(groups) unprivGid = int(os.environ['SUDO_GID']) - #print "SUDO_UID activated: %s %s" % (unprivUid, unprivGid) # consolehelper if os.environ.get("USERHELPER_UID") is not None: @@ -396,7 +389,6 @@ def main(ret): groups = [ g[2] for g in grp.getgrall() if username in g[3]] os.setgroups(groups) unprivGid = pwd.getpwuid(unprivUid)[3] - #print "USERHELPER_UID activated: %s %s" % (unprivUid, unprivGid) uidManager = mock.uid.uidManager(unprivUid, unprivGid) uidManager._becomeUser(unprivUid, unprivGid) diff --git a/py/mock/backend.py b/py/mock/backend.py index 80b223f..d4d0eb4 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, |