Bug 1187727 - mock unnecessarily requires site-defaults.cfg
Summary: mock unnecessarily requires site-defaults.cfg
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: mock
Version: 21
Hardware: All
OS: All
unspecified
unspecified
Target Milestone: ---
Assignee: Miroslav Suchý
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-01-30 18:28 UTC by Martin Sebor
Modified: 2015-02-20 00:33 UTC (History)
7 users (show)

Fixed In Version: mock-1.2.6-1.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-02-09 05:29:22 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
patch 1: no error if site-default.cfg does not exist (2.93 KB, patch)
2015-01-31 10:27 UTC, Mikhail Campos
no flags Details | Diff
use default ligging cfg if non-default does not exist (2.10 KB, patch)
2015-01-31 10:28 UTC, Mikhail Campos
no flags Details | Diff

Description Martin Sebor 2015-01-30 18:28:26 UTC
Mock fails with the ERROR below when the mock config directory doesn't contain a site-defaults.cfg file.  The tool does, however, succeed when the file exists but is empty.  Requiring that an empty file exist unnecessarily complicates Mock setup and makes it harder to use than it needs to be.  The command should treat a missing site-defaults.cfg the same as an empty file.

The following steps show the Mock failure and the steps required to make it work with a non-default config directory.  (Copying the logging.ini file is also inconvenient.  It would make it easier if Mock fell back to the same or some other reasonable defaults when the logging.ini file didn't exist.)

$ (dir=$PWD/mock-config; mkdir -p $dir && cp /etc/mock/logging.ini $dir/logging.ini && rhpkg mock-config > $dir/$(basename $PWD).cfg)
...
$ mock --configdir=$PWD/mock-config --no-cleanup-after -r patchutils --resultdir mock-results --rebuild $(rhpkg srpm | sed -n "s/^ *Wrote: *\(.*\)/\1/p")
ERROR: Could not find required config file: /home/msebor/rhel/patchutils/mock-config/site-defaults.cfg
ERROR:   If you're trying to specify a path, include the .cfg extension, e.g. -r ./target.cfg
...
$ : > mock-config/site-defaults.cfgpatchutils$ mock --configdir=$PWD/mock-config --no-cleanup-after -r patchutils --resultdir mock-results --rebuild $(rhpkg srpm | sed -n "s/^ *Wrote: *\(.*\)/\1/p")
INFO: mock.py version 1.2.4 starting (python version = 2.7.8)...
INFO: Start: init plugins
INFO: selinux enabled
INFO: Finish: init plugins
INFO: Start: run
INFO: Start(/home/msebor/rhel/patchutils/patchutils-0.3.3-4.el7.src.rpm)  Config(rhel-7.1-candidate-x86_64)
INFO: Start: clean chroot
...

Comment 1 Mikhail Campos 2015-01-31 10:27:59 UTC
Created attachment 986401 [details]
patch 1: no error if site-default.cfg does not exist

Comment 2 Mikhail Campos 2015-01-31 10:28:39 UTC
Created attachment 986402 [details]
use default ligging cfg if non-default does not exist

Comment 3 Miroslav Suchý 2015-02-02 08:30:22 UTC
Commited as:
* 8c72ad5 use default logging.ini if non-default does not exist [RHBZ#1187727]
* 098b901 simplify condition
* d91c76f no error when site-default.cfg does not exist [RHBZ#1187727]

Thanks for contribution.

Comment 4 Fedora Update System 2015-02-03 04:42:07 UTC
mock-1.2.6-1.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/mock-1.2.6-1.el6

Comment 5 Fedora Update System 2015-02-03 04:42:44 UTC
mock-1.2.6-1.el7 has been submitted as an update for Fedora EPEL 7.
https://admin.fedoraproject.org/updates/mock-1.2.6-1.el7

Comment 6 Fedora Update System 2015-02-03 04:43:36 UTC
mock-1.2.6-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/mock-1.2.6-1.fc20

Comment 7 Fedora Update System 2015-02-03 04:44:08 UTC
mock-1.2.6-1.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/mock-1.2.6-1.fc21

Comment 8 Fedora Update System 2015-02-03 19:31:53 UTC
Package mock-1.2.6-1.el7:
* should fix your issue,
* was pushed to the Fedora EPEL 7 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=epel-testing mock-1.2.6-1.el7'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-EPEL-2015-0617/mock-1.2.6-1.el7
then log in and leave karma (feedback).

Comment 9 Fedora Update System 2015-02-09 05:29:22 UTC
mock-1.2.6-1.fc21 has been pushed to the Fedora 21 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 10 Fedora Update System 2015-02-15 02:55:44 UTC
mock-1.2.6-1.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 11 Fedora Update System 2015-02-20 00:32:29 UTC
mock-1.2.6-1.el7 has been pushed to the Fedora EPEL 7 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 12 Fedora Update System 2015-02-20 00:33:27 UTC
mock-1.2.6-1.el6 has been pushed to the Fedora EPEL 6 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.