summaryrefslogtreecommitdiffstats
path: root/py/mock.py
Commit message (Collapse)AuthorAgeFilesLines
* fix up sparc arch handlingHEADmasterDennis Gilmore2010-09-101-2/+3
|
* noarch is always a legal archPaul Howarth2010-08-121-1/+1
| | | | | | Allow "--target noarch" to be specified. Signed-off-by: Clark Williams <williams@redhat.com>
* Add i586 as a legal target archPaul Howarth2010-08-121-3/+3
| | | | | | | This is needed not only to target the legacy Fedora 11 32-bit release but also the still-current SLES-11 32-bit and possibly others too. Signed-off-by: Clark Williams <williams@redhat.com>
* add selinux pluginJan Vcelak2010-07-301-1/+3
| | | | | | | | | | | | | | | | | | | | | 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-1/+3
| | | | | | | 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>
* allow --sources to specify either single file or directory (BZ# 510409)Ricky Zhou2010-07-271-3/+4
| | | | | | | 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 i686 architectureClark Williams2010-07-271-3/+4
| | | | | | Added i686 architecture to arch checking logic in py/mock.py Signed-off-by: Clark Williams <williams@redhat.com>
* added logic to detect invalid architecture combinations (BZ# 607144)Clark Williams2010-07-271-0/+24
| | | | | | | | | 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-2/+15
| | | | | | | | | | | 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>
* Use pigz for gzipping by default (BZ# 570418).Ville Skyttä2010-03-231-1/+1
|
* Make --help etc work for non-mock users.Ville Skyttä2010-03-221-1/+3
|
* Clean up unused imports.Ville Skyttä2010-03-201-1/+0
|
* Make --with and --without set same macro values as rpmbuild does.Ville Skyttä2010-03-171-2/+4
|
* Make createrepo disabled by defaultJesse Keating2010-03-111-1/+1
|
* make createrepo command an option (skvidal)Jesse Keating2010-03-111-1/+3
|
* Revert "Revert "add configuration option to run createrepo on result rpms""Jesse Keating2010-03-111-0/+7
| | | | | | This reverts commit bc678aba383d1a6ad4ffd884ca21aa4058856e86. Revert the revert, wheee! This is appropriate for 1.1 moving forward.
* Revert "add configuration option to run createrepo on result rpms"Jesse Keating2010-03-111-7/+0
| | | | | | | This reverts commit 716d41a0090047c3e943d102537b87d86fdcbe88. We've decided to revert this feature on the 1.0.x series. We'll add it back for 1.1
* Revert "Use -N flag with useradd, but not in EPEL #495734"Jesse Keating2010-03-111-1/+1
| | | | | | | | This reverts commit e99adc9492ab1087018c630f68f75ebe79f56a76. -n still works on Fedora, and trying to override -N with -n in epel configs fails for things like koji generated configs. Falling back to -n until that stops working for us.
* Use -N flag with useradd, but not in EPEL #495734Jesse Keating2010-02-171-1/+1
| | | | | EL doesn't support -N, but uses -n instead. So use -N by default, but in the EL configs revert back to -n.
* add configuration option to run createrepo on result rpmsSeth Vidal2010-02-101-0/+7
| | | | | | | | Added patch from Seth Vidal <skvidal@fedoraproject.org> to automatically run createrepo on the generated rpms Signed-off-by: Seth Vidal <skvidal@fedoraproject.org> Signed-off-by: Clark Williams <williams@redhat.com>
* add --unpriv logic to --shellClark Williams2010-01-181-1/+5
| | | | | | | Add logic to run with unprivleged uid:gid in interactive chroot shell. (BZ# 522505) Signed-off-by: Clark Williams <williams@redhat.com>
* add IPv6 localhost entry to /etc/hosts and fix build issueClark Williams2009-12-231-2/+4
| | | | | | | | Add a default IPv6 entry for BZ545435, to fix failure in curl test suite. In addition, remove the result of gethostname(), since this causes koji to insert 'localhost' into rpms Signed-off-by: Clark Williams <williams@redhat.com>
* reworked devpts handling {BZ 510183}Clark Williams2009-11-231-0/+1
| | | | | | | | | | 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>
* added code to raise exception when --shell specified for uninitializedClark Williams2009-07-081-0/+2
| | | | | | chroot. BZ# 506288 Signed-off-by: Clark Williams <williams@redhat.com>
* Support configurable root cache compressionLubomir Rintel2009-03-271-1/+3
| | | | | | | | | | | | | 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-1/+5
| | | | | Copy /etc/hosts from host when resolver configuration is being copied, otherwise add hostname as a loopback alias.
* commented out dropPrivsForever() in copyin logicClark Williams2009-02-021-1/+1
|
* Merge branch 'master' into clarkClark Williams2009-02-011-0/+43
|\
| * Merge branch 'buildsrpm'Michael E Brown2009-01-231-0/+43
| |\ | | | | | | | | | | | | | | | | | | | | | * 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.
| | * another srpm -> spec change in buildsrpm. add state for building srpm.Michael E Brown2009-01-081-1/+1
| | |
| | * cant use srpm var, use spec file instead. its ofr info only.Michael E Brown2009-01-081-5/+5
| | |
| | * initial work to copy spec/sources and build srpm.Michael E Brown2009-01-081-0/+43
| | |
* | | set HOME environment variable to be the chroot homeClark Williams2009-02-011-1/+1
| | |
* | | Merge branch 'master' of ↵Clark Williams2009-01-081-0/+5
|\| | | | | | | | | | | 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-0/+5
| |/ | | | | | | friendly error message.
* / added version key to config options; moved cache_topdir to /var/cache/mock; ↵Clark Williams2008-12-191-2/+3
|/ | | | removed trailing slash from basedir
* Merge branch 'master' of ↵Clark Williams2008-04-141-0/+11
|\ | | | | | | git+ssh://jcwillia@git.fedoraproject.org/git/hosted/mock
| * handle idiots with grace and poise.Michael E Brown2008-03-071-0/+11
| |
* | changed default chroot_setup_cmd to be "groupinstall"Clark Williams2008-03-071-1/+1
|/
* modify rootcache logic to rebuild cache if config files have newer timestampClark Williams2008-02-291-0/+4
|
* set the current working directory in the chrootMike Bonnet2008-01-241-2/+6
| | | | | | | | | | | | | | | This patch allows you to set the current working directory (in the chroot) before running a command with --chroot. This avoids the need to pass shell snippets ('cd /some/path && /run/cmd') to mock when running a command that expects to executed from a certain directory. It's useful when using --copyin to setup the environment before running a command. >From e4071d1d41a62ccf4461dfab958f9325edf30c97 Mon Sep 17 00:00:00 2001 From: Mike Bonnet <mikeb@redhat.com> Date: Thu, 24 Jan 2008 17:09:06 -0500 Subject: [PATCH] optionally set the current working directory (in the chroot) before running command with --chroot Signed-off-by: Michael E Brown <mebrown@michaels-house.net>
* add --unpriv option to drop privileges when running a command with --chrootMike Bonnet2008-01-241-1/+7
| | | | | | | | | | | | | | | | | | | | On Thu, 2008-01-24 at 16:04 -0500, Mike Bonnet wrote: > On Thu, 2008-01-24 at 15:42 -0500, Mike Bonnet wrote: > > This patch adds a --unpriv option that will cause privileges to be > > dropped before running a command with --chroot. This can be used to > > more closely simulate the environment used when running rpmbuilds. > > Let me try that again... Ok, the attachments are getting stripped off for some reason, trying inline... >From 85e14d38aec32cf20d7f2bbdc77044d41c32a0a2 Mon Sep 17 00:00:00 2001 From: Mike Bonnet <mikeb@redhat.com> Date: Thu, 24 Jan 2008 15:37:15 -0500 Subject: [PATCH] optionally drop privileges when running a command with --chroot Signed-off-by: Michael E Brown <mebrown@michaels-house.net>
* convert mock.util.do() to use subprocess.Popen() rather than raw ↵Michael E Brown2008-01-201-10/+6
| | | | fork/exec.\nThis cleans up the code considerably. Also, start reducing the places where we use a shell in the subcommand.
* mount everything when running chroot command.Michael E Brown2008-01-181-1/+5
|
* the great config file rename.Michael E Brown2008-01-151-1/+1
|
* cleanup trailing whitespace.Michael E Brown2008-01-081-5/+5
|
* add ability to conditionally enable tmpfs based on minimum ram availability.Michael E Brown2008-01-081-1/+1
|
* update docs for --arch and --target.Michael E Brown2008-01-041-1/+1
|
* fix syntax error from personality move by using config_opt directly.Michael E Brown2008-01-041-1/+1
|
* split up --target and --arch cmdline options.Michael E Brown2008-01-041-2/+10
|