summaryrefslogtreecommitdiffstats
path: root/py/mock
Commit message (Collapse)AuthorAgeFilesLines
* pass selinux status to mock.util.rmtree() function (BZ# 614440)Clark Williams2010-08-122-12/+17
| | | | | | | Pass in boolean 'selinux' via keyword arguments that tells rmtree whether to do retry logic with selinux attributes Signed-off-by: Clark Williams <williams@redhat.com>
* Update packages after unpacking root cachePaul Howarth2010-08-122-2/+5
| | | | | | | | | Fix problem introduced in commit 3bc5fb958deb809fc04d6a74ce6688e093f5831a where the buildroot is no longer updated after unpacking the root cache. http://bugzilla.redhat.com/557526 Signed-off-by: Clark Williams <williams@redhat.com>
* Exclude bind-mounted cache dirs from root cachePaul Howarth2010-08-121-0/+2
| | | | | | | | | Including the ccache directory /tmp/ccache and the yum cache directory /var/cache/yum in the root cache is unnecessary and can lead to the root cache tarball being an order of magnitude larger and taking 10 minutes or more to tar and compress even on a fast PC. Signed-off-by: Clark Williams <williams@redhat.com>
* Retain order of umountCmdsPaul Howarth2010-08-121-0/+2
| | | | | | | | | | | | | | The order of execution of umounts is the reverse of the order of the mounts, so as to deal with a hierarchy of mounts correctly. The ordering is reversed by _umountall but was being left in the reversed state so that the next time _umountall was called, it attempted to unmount filesystems in the wrong order, leading to build failures due to being unable to unmount for example /proc whilst /proc/filesystems was still mounted. This change reverses the order of umount commands back again before _umountall exits so as to maintain the ordering. Signed-off-by: Clark Williams <williams@redhat.com>
* set state correctly for SELinux (BZ# 620143)Clark Williams2010-08-031-2/+8
| | | | | | | | | The new selinux plugin fakes SELinux being turned *off* in the chroot by bind-mounting a fake /proc/filesystems in the chroot. If this plugin is enabled, we should *not* do any SELinux attribute operations in the chroot. Setup this state correctly at init time. Signed-off-by: Clark Williams <williams@redhat.com>
* append rather than insert umount of /proc/filesystems (BZ# 620825)Clark Williams2010-08-031-1/+1
| | | | | | | | since the umount commands are reversed before being executed, just append the umount of /proc/filesystems in the selinux plugin so that it will happen in the correct order. Signed-off-by: Clark Williams <williams@redhat.com>
* add selinux pluginJan Vcelak2010-07-301-0/+97
| | | | | | | | | | | | | | | | | | | | | This patch adds an selinux plugin that sets up an environment with selinux turned *off* in the build chroot. How does this work? From the author's description: It is done the same as the patch sent by Thomas Liu in bz 614440 does. Actually, this proceeding was suggested by Dan Walsh in bz 573111. 1.) Fake /proc/filesystems is created in conf["cachedir"]. It includes the same content as the same file in host environment, except line with selinuxfs. This file is bind mounted into build environment. 2.) Option '--setopt=tsflags=nocontext' is added to yum commands. This is done by wrapping mock.util.do with _selinuxDoYum in "preyum" hook. This function just adds the option and passes the command to original mock.util.do function. The wrapping is removed in "postyum" hook. I didn't find cleaner method, without modifying main code. Signed-off-by: Clark Williams <williams@redhat.com>
* patch that allows specifying max tmpfs size to tmpfs pluginKalev Lember2010-07-301-2/+7
| | | | | | | Add a 'max_fs_size' parameter to the tmpfs plugin that allows specification of sizes greater than default (50% of RAM). Signed-off-by: Clark Williams <williams@redhat.com>
* fixed indentation typo in py/mock/backend.pyClark Williams2010-07-271-3/+3
| | | | Signed-off-by: Clark Williams <williams@redhat.com>
* allow --sources to specify either single file or directory (BZ# 510409)Ricky Zhou2010-07-271-2/+12
| | | | | | | Mock originally takes just a directory for the argument to --sources; expand this to allow for a single file or a directory. Signed-off-by: Clark Williams <williams@redhat.com>
* added symlink from /proc/self/fd to /dev/fd in the chroot (BZ# 526414)Clark Williams2010-07-271-0/+4
| | | | | | | | Added a symlink in the chroot from /proc/self/fd to /dev/fd. Only do this for EPEL5+ and FC hosts since the 2.6.9 kernel for EPEL4 does not support this. Signed-off-by: Clark Williams <williams@redhat.com>
* fix cachefile generation filtering logicClark Williams2010-07-271-3/+3
| | | | | | | | | The original fix to generating a cache file without /proc, /sys, and /dev entries failed due to the --exclude=sys filtering out /usr/include/sys (a bad thing). Changed the filtering excludes to include a './' prefix to avoid that little problem. Signed-off-by: Clark Williams <williams@redhat.com>
* moved rpmdb clean block so that it works with --offlineClark Williams2010-07-271-7/+7
| | | | | | | previous fix for rpmdb issues was under a "if online:" block. Move it out so rpmdb cleanup occurs in both cases. Signed-off-by: Clark Williams <williams@redhat.com>
* filter out proc,sys,and dev from cache file creationClark Williams2010-07-271-0/+3
| | | | | | | Added --excludes to tar comand line to exclude proc, sys and dev files when creating root cache. Signed-off-by: Clark Williams <williams@redhat.com>
* added logic to detect invalid architecture combinations (BZ# 607144)Clark Williams2010-07-271-0/+7
| | | | | | | | | Modified py/mock.py to dectect invalid build combinations (e.g. trying to build x86_64 packages on an i386 host) and to throw an InvalidArchitecture exception when detected. Added the above exception to py/mock/execption.py Signed-off-by: Clark Williams <williams@redhat.com>
* add the --scrub option for cleaning up cache (BZ# 450726)Paul B. Schroeder2010-07-271-15/+41
| | | | | | | | | | | Added the command line option: --scrub=[all,chroot,cache,root-cache,c-cache,yum-cache] which allows selective cleanup of the various cache's maintained by mock (on on mock's behalf). Also added logic to umountall() to umount in reverse order of mount. Signed-off-by: Clark Williams <williams@redhat.com>
* yum made/makes an rpmdb cache dir in $cachedir/installed for a whileSeth Vidal2010-05-091-0/+9
| | | | | things can go wrong in a specific mock case if this happened. So just nuke the installed dir and the files in it. Problem solved.
* Create missing directories for config_opts['files'] elementsPaul Howarth2010-05-051-1/+3
| | | | | | | | | | Without this fix, only files within directories pre-created as part of the chroot "skeleton" can be created using config_opts['files'], as the attempt to create the file fails with "No such file or directory". This patch allows for creation of files in arbitrary directories. Signed-off-by: Clark Williams <williams@redhat.com> (cherry picked from commit 0c4254573261bd1c9144b9fd03693572eb3ba036)
* correct mispelling of sqlite extension in yum_cache.pyClark Williams2010-05-051-1/+1
| | | | | | | | Yum uses .sqlite files, but the plugin was looking for .sqllite. Remove one 'l'. Reported-by: Seth Vidal <skvidal@fedoraproject.org> Signed-off-by: Clark Williams <williams@redhat.com>
* Check SELinux state from /selinux/enforce instead of /usr/sbin/getenforce.Ville Skyttä2010-04-261-8/+7
| | | | | Cleans up an error message when getenforce is not installed, and fixes wrong outcome from selinuxEnabled() when SELinux is additionally disabled.
* Clean up unused imports.Ville Skyttä2010-03-205-6/+2
|
* add utility function to detect SELinux status and use itClark Williams2010-02-192-3/+18
| | | | | | | | | Add a utility function selinuxEnabled() that returns true if SELinux is enabled on the host and false otherwise. Use this in _setupDev() method of the Root object to avoid shelling out unnecessarily to 'chcon'. Signed-off-by: Clark Williams <williams@redhat.com>
* handle distro differences for /dev/pts in chrootmock-1.0.2Clark Williams2009-12-231-4/+13
| | | | | | | | EPEL distros are older and have different behavior of the /dev/pts filesystem than newer kernels in Fedora. Deal with that when setting up devices. Signed-off-by: Clark Williams <williams@redhat.com>
* fix intermittent problems generating root cache tarball (BZ# 540997)Clark Williams2009-11-251-5/+12
| | | | | | | | | Patch submitted by Paul Howarth <paul@city-fan.org> to prevent race condition when creating root cache tarballs and to remove partial tarballs on error. Signed-off-by: Clark Williams <williams@redhat.com> CC: Paul Howarth <paul@city-fan.org>
* reworked devpts handling {BZ 510183}Clark Williams2009-11-231-2/+4
| | | | | | | | | | changed setup of devpts inside chroot so that /dev/ptmx is a symlink to /dev/pty/ptmx and that it's mounted with all read/write permissions so that pty's are usable inside the chroot. Also called devSetup when running interactive shell, so that shell chroot matches build chroot environment. Signed-off-by: Clark Williams <williams@redhat.com>
* conditionalize import of uuid package and avoid dependent code ifClark Williams2009-11-091-9/+15
| | | | import fails (as it will on RHEL5)
* Don't automatically update the chroot in a --no-clean scenarioJesse Keating2009-08-111-3/+2
| | | | | | This causes largely unnecessary yum runs and delays builds. The new behavior would just skip the yum call all together, unless the chroot was cleaned, in which case the setup command is called.
* fixed stupid typo in last updateClark Williams2009-07-081-1/+1
| | | | Signed-off-by: Clark Williams <williams@redhat.com>
* reworked /dev/pts mount command to lookup 'tty' group id andClark Williams2009-07-081-1/+6
| | | | | | | to use the 'newinstance' mount option if the kernel version is >= 2.6.29 Signed-off-by: Clark Williams <williams@redhat.com>
* Add directory and infrastructure that will allow dbus to start in chroot.Clark Williams2009-07-081-0/+11
| | | | | | BZ# 460574 Signed-off-by: Clark Williams <williams@redhat.com>
* Patch from Jakub Jelinek (jakub@redhat.com) to fix incorrect mode andClark Williams2009-07-081-1/+1
| | | | | | group for /dev/pts mounted in chroot (BZ# 510183) Signed-off-by: Clark Williams <williams@redhat.com>
* Support configurable root cache compressionLubomir Rintel2009-03-271-3/+9
| | | | | | | | | | | | | This patch adds configuration options that influence how is the root cache compressed: config_opts['plugin_conf']['root_cache_opts']['compress_program'] = "gzip" config_opts['plugin_conf']['root_cache_opts']['extension'] = ".gz" Motivation to do this was to be able to use lzma compression. While it takes a long time to compress, for me it was more than two times faster than gzip when decompressing. Since I only seldom regenerate the root cache while doing a lot of builds, I was able to gain a considerable speed up.
* Be able to resolve hostnameLubomir Rintel2009-03-271-6/+12
| | | | | Copy /etc/hosts from host when resolver configuration is being copied, otherwise add hostname as a loopback alias.
* Copy the hosts tzdata (/etc/localtime) into the chrootJesse Keating2009-02-051-0/+7
|
* buildsrpm: some additional sanity checking, and removing an unnecessary globMike Bonnet2009-02-011-6/+6
|
* HOME environment variable is now set globally to match chroot homedirMike Bonnet2009-02-011-1/+0
|
* Merge branch 'master' into clarkClark Williams2009-02-011-0/+59
|\
| * Merge branch 'buildsrpm'Michael E Brown2009-01-231-0/+59
| |\ | | | | | | | | | | | | | | | | | | | | | * buildsrpm: unlink->rmdir another srpm -> spec change in buildsrpm. add state for building srpm. cant use srpm var, use spec file instead. its ofr info only. initial work to copy spec/sources and build srpm.
| | * unlink->rmdirMichael E Brown2009-01-081-1/+1
| | |
| | * another srpm -> spec change in buildsrpm. add state for building srpm.Michael E Brown2009-01-081-0/+1
| | |
| | * initial work to copy spec/sources and build srpm.Michael E Brown2009-01-081-0/+58
| | |
* | | set HOME environment variable to be the chroot homeClark Williams2009-02-011-2/+0
| | |
* | | Merge branch 'master' into clarkClark Williams2009-02-013-3/+19
|\ \ \
| * | | Merge branch 'master' of ↵Clark Williams2009-01-082-2/+17
| |\| | | | | | | | | | | | | | git+ssh://jcwillia@git.fedoraproject.org/git/hosted/mock
| | * | add new exception for result dir not being accessible and print nice ↵Michael E Brown2008-11-182-2/+17
| | |/ | | | | | | | | | friendly error message.
| * | removed import of popen2 from py/mock/util.py (gets rid of deprecated warning)Clark Williams2008-12-191-1/+0
| | |
| * | added version variable; added Mock Version banner to all logsClark Williams2008-12-191-0/+2
| |/
* / Signed-off-by: Mike McLean <mikem redhat com>Mike McLean2008-11-111-2/+10
|/
* added panu's fix for strange rpm behaviorClark Williams2008-10-151-2/+4
|
* internal setarch support for s390/s390xMike McLean2008-10-141-0/+1
| | | | Signed-off-by: Mike McLean <mikem@redhat.com>