Bug 214942 - mock --configdir=<somewhere> doesn't read /etc/mock/defaults.cfg
mock --configdir=<somewhere> doesn't read /etc/mock/defaults.cfg
Status: CLOSED NEXTRELEASE
Product: Fedora Hosted Projects
Classification: Retired
Component: mock (Show other bugs)
unspecified
All Linux
medium Severity medium
: ---
: ---
Assigned To: Clark Williams
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-11-10 01:39 EST by Ralf Corsepius
Modified: 2013-01-09 23:07 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-11-21 15:18:09 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Ralf Corsepius 2006-11-10 01:39:59 EST
Description of problem:
Mock doesn't read system defaults (/etc/mock/defaults.cfg)
if using "mock --configdir=<somewhere>"

Version-Release number of selected component (if applicable):
mock-0.6.8-4.fc6

How reproducible:
Always.

Steps to Reproduce:
As a normal user (member of mock group), perform the following steps:
1. mkdir tmp
2. cp /etc/mock/fedora-6-i386-core.cfg tmp
3. mock --configdir=$(pwd)/tmp -r fedora-6-i386-core init

  
Actual results:
# mock --configdir=$(pwd)/tmp -r fedora-6-i386-core init
init
clean
prep
This may take a while
Traceback (most recent call last):
  File "/usr/bin/mock", line 995, in ?
    main()
  File "/usr/bin/mock", line 966, in main
    do_clean(config_opts, init=1)
  File "/usr/bin/mock", line 837, in do_clean
    if init: my.prep()
  File "/usr/bin/mock", line 252, in prep
    self._prep_build()
  File "/usr/bin/mock", line 719, in _prep_build
    self._build_dir_setup()
  File "/usr/bin/mock", line 711, in _build_dir_setup
    rpmmacros = open(macrofile_out, 'w')
IOError: [Errno 13] Permission denied:
'/var/lib/mock/fedora-6-i386-core/root/builddir/.rpmmacros'


Expected results:
function.


Additional info:
mock should consider to search for defaults.cfg on a PATH (e.g.
"configdir:/etc/mock") or (IMO: better) to use hard-coded internal defaults.

The current way the defaults.cfg mechanism is implemented, forces users wanting
to use a custom "*.cfg" to copy /etc/mock/defaults.cfg into their custom
configdir or to cut'n'paste a system's /etc/mock/defaults.cfg into their custom
*.cfg.

As /etc/mock/defaults.cfg can vary between hosts, both approaches void
"defaults.cfg" role as a "host's defaults".
Comment 1 Clark Williams 2006-11-21 15:18:09 EST
Added code to run /etc/mock/defaults.cfg if the config_path isn't /etc/mock and
it exists.


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