summaryrefslogtreecommitdiffstats
path: root/py/mock/backend.py
Commit message (Collapse)AuthorAgeFilesLines
* pass selinux status to mock.util.rmtree() function (BZ# 614440)Clark Williams2010-08-121-10/+10
| | | | | | | 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-121-0/+3
| | | | | | | | | 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>
* 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>
* 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>
* 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>
* 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)
* add utility function to detect SELinux status and use itClark Williams2010-02-191-3/+7
| | | | | | | | | 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>
* 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>
* 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' of ↵Clark Williams2009-01-081-2/+3
|\| | | | | | | | | | | 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-181-2/+3
| |/ | | | | | | friendly error message.
* / added version variable; added Mock Version banner to all logsClark Williams2008-12-191-0/+2
|/
* create BUILDROOT dir required by new rpmbuildClark Williams2008-08-291-1/+1
|
* add support for shmMichael E Brown2008-03-091-7/+12
|
* modify rootcache logic to rebuild cache if config files have newer timestampClark Williams2008-02-291-0/+1
|
* Merge branch 'master' of /var/ftp/pub/Applications/git/mockMichael E Brown2008-01-221-21/+33
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 'master' of /var/ftp/pub/Applications/git/mock: get rid of one level of shell indirection where possible. revert accidental comment-out of test cleanup that I was using to debug tar problem. add back in dropped '.' to tar cvf command that is causing root cache creation to fail. Add debug logging for running commands. convert mock.util.do() to use subprocess.Popen() rather than raw fork/exec.\nThis cleans up the code considerably. Also, start reducing the places where we use a shell in the subcommand. better unit test error message. mount everything when running chroot command. updated change log added compat symlinks version bump update manpage with new site-defaults ref. the great config file rename. some manpage clarifications and arrangements. clarify info message to make it obvious that root cache is being unpacked. cleanup trailing whitespace. cleanup trailing whitespace. add ability to conditionally enable tmpfs based on minimum ram availability. add initfailed hook so tmpfs plugin can properly unmount tmpfs on failure. make sure we call postbuild hooks even on failure.
| * get rid of one level of shell indirection where possible.Michael E Brown2008-01-201-9/+14
| |
| * convert mock.util.do() to use subprocess.Popen() rather than raw ↵Michael E Brown2008-01-201-10/+9
| | | | | | | | fork/exec.\nThis cleans up the code considerably. Also, start reducing the places where we use a shell in the subcommand.
| * add initfailed hook so tmpfs plugin can properly unmount tmpfs on failure. ↵Michael E Brown2008-01-081-2/+10
| | | | | | | | make sure we call postbuild hooks even on failure.
* | Merge branch 'master' of /var/ftp/pub/Applications/git/mockMichael E Brown2008-01-041-9/+6
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | * 'master' of /var/ftp/pub/Applications/git/mock: split up --target and --arch cmdline options. get rid of personality() calls in sub do() calls because it is set at top level now. added --print-root-path option paul howarth's request to change from -l to --login on bash invocations use the right mkdev argument Create the dev/full device, some packages use it during make check. add ia64 and alpha to personality_defs Patch from Doug Chapman <doug.chapman@hp.com> Doug Chapman's ia64 personality warning fix Roland McGrath's fix for ctypes LoadLibrary on ia64
| * split up --target and --arch cmdline options.Michael E Brown2008-01-041-3/+3
| |
| * get rid of personality() calls in sub do() calls because it is set at top ↵Michael E Brown2008-01-041-6/+2
| | | | | | | | level now.
| * paul howarth's request to change from -l to --login on bash invocationsClark Williams2008-01-041-2/+2
| |
| * use the right mkdev argumentJesse Keating2008-01-031-1/+1
| |
| * Create the dev/full device, some packages use it during make check.Jesse Keating2008-01-031-0/+1
| |
* | Merge branch 'master' of /var/ftp/pub/Applications/git/mockMichael E Brown2007-12-211-29/+28
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * '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.
| * fix privs for yum resolvdep, needs to be root to download addl filelists.Michael E Brown2007-12-201-19/+19
| |
| * fix resultdir for --uniqueext builds without resultdir specified. try to ↵Michael E Brown2007-12-191-8/+7
| | | | | | | | standardize on single-quotes for indexing hashes.
| * Run rpmbuild in a login shell in the chroot.Michael E Brown2007-12-191-2/+2
| |
* | use makeChrootPath() functionality rather than obscure string interpolationMichael E Brown2007-12-211-1/+1
|/
* add hook (currently unused) for clean.Michael E Brown2007-12-181-0/+1
|