Bug 1126117

Summary: Mock should accept paths to target definition files
Product: [Fedora] Fedora Reporter: Craig Ringer <craig>
Component: mockAssignee: Miroslav Suchý <msuchy>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: 20CC: jdisnard, mebrown, msimacek, msuchy, praiskup, williams
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: mock-1.2.3-1.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-12-12 04:08:02 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
Add support for target paths to mock none

Description Craig Ringer 2014-08-02 01:01:54 UTC
$ mock --version
1.1.41


Mock's -r argument requires that the value be the name of a target, sans .cfg, which is looked up in /etc/mock or, if specified, the --configdir .

This is very inconvenient when doing builds with non-default targets, especially if those targets are managed in an SCM. While --configdir works, using it has two issues:

- Mock requires site-defaults.cfg to be in --configdir so you can't keep the targets separate from site-specific configuration that involves local paths; and

- You can't use stock targets from /etc/mock as well as those in a different location

Both these issues would be resolved if mock checked the value of -r to see if it ends in .cfg and if so, treat it as a path.

Any objections? I'll see if I can put together a patch anyway.

Comment 1 Miroslav Suchý 2014-08-03 20:31:21 UTC
Sounds reasonable to me.

Comment 2 Craig Ringer 2014-08-04 03:53:36 UTC
Here we go then.

https://github.com/ringerc/mock/pull/1

Patch attached.

Comment 3 Craig Ringer 2014-08-04 03:54:16 UTC
Created attachment 923731 [details]
Add support for target paths to mock

Patch to add suggested feature

Comment 4 Craig Ringer 2014-08-14 02:23:22 UTC
Any thoughts on merging this?

Comment 5 Craig Ringer 2014-08-14 03:09:43 UTC
See also #1129932 which might be useful for users of this option.

Comment 6 Miroslav Suchý 2014-10-21 10:32:34 UTC
Commited as 72683cc.

Because it does not apply clean any more, I had to rewrite it little bit. And I edited man page to describe this feature.

Thanks for contribution.

Comment 7 Fedora Update System 2014-11-16 17:37:27 UTC
mock-1.2.1-1.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/mock-1.2.1-1.fc21

Comment 8 Fedora Update System 2014-11-16 17:38:49 UTC
mock-1.2.1-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/mock-1.2.1-1.fc20

Comment 9 Fedora Update System 2014-11-16 17:39:41 UTC
mock-1.2.1-1.el7 has been submitted as an update for Fedora EPEL 7.
https://admin.fedoraproject.org/updates/mock-1.2.1-1.el7

Comment 10 Fedora Update System 2014-11-16 17:40:41 UTC
mock-1.2.1-1.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/mock-1.2.1-1.el6

Comment 11 Fedora Update System 2014-11-17 06:29:47 UTC
Package mock-1.2.1-1.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing mock-1.2.1-1.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-15217/mock-1.2.1-1.fc20
then log in and leave karma (feedback).

Comment 12 Fedora Update System 2014-12-04 12:07:05 UTC
mock-1.2.3-1.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/mock-1.2.3-1.fc21

Comment 13 Fedora Update System 2014-12-04 12:10:34 UTC
mock-1.2.3-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/mock-1.2.3-1.fc20

Comment 14 Fedora Update System 2014-12-04 12:11:31 UTC
mock-1.2.3-1.el7 has been submitted as an update for Fedora EPEL 7.
https://admin.fedoraproject.org/updates/mock-1.2.3-1.el7

Comment 15 Fedora Update System 2014-12-12 04:08:02 UTC
mock-1.2.3-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 16 Fedora Update System 2014-12-17 04:43:04 UTC
mock-1.2.3-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 17 Fedora Update System 2015-01-06 02:06:49 UTC
mock-1.2.3-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.