Bug 1125376 - RFE: allow variable subsitution in config_opts['yum.conf']
Summary: RFE: allow variable subsitution in config_opts['yum.conf']
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: mock
Version: rawhide
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Miroslav Suchý
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-07-31 16:58 UTC by Eric Schnoebelen
Modified: 2015-02-20 00:33 UTC (History)
8 users (show)

Fixed In Version: mock-1.2.6-1.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-01-21 23:08:54 UTC


Attachments (Terms of Use)
implement the desired feature request. (657 bytes, patch)
2014-07-31 16:58 UTC, Eric Schnoebelen
no flags Details | Diff
revised patch to implement the desired feature request. (924 bytes, patch)
2014-07-31 21:39 UTC, Eric Schnoebelen
no flags Details | Diff
Updated patch to allow the subsitution of resultdir into the yum.conf block (678 bytes, text/plain)
2015-01-08 20:31 UTC, Eric Schnoebelen
no flags Details

Description Eric Schnoebelen 2014-07-31 16:58:48 UTC
Created attachment 923006 [details]
implement the desired feature request.

Description of problem:
Enhancement request:

For our use of mock to build an internal product, it would be extremely useful of config_opts['yum.conf'] supported variable substitution in the fashion of config_opts['resultdir'].

Doing so allows us to start from a virgin tree, and build RPMs that have dependencies on things built earlier.  Our product tree's mixture of source RPMs and sources do not permit the use of mockchain (which does provide a similar feature.)

Version-Release number of selected component (if applicable): 1.1.41


How reproducible:

Attempt to do variable subsitution in config_opts['yum.conf'] in a mock root specification/configuration file.


Steps to Reproduce:
1. modify a configuration file to have something similar to "baseurl=file://%(resultdir)s" in config_opts['yum.conf']
2. attempt to use the configuration to build; (when an rpm needs something not in the standard repos)
3. look at the error messages (really from yum, but..)

Actual results:
failing with an ugly message.

Expected results:
Working without incident

Additional info:
The (one line) patch required to implement this feature is attached.

Comment 1 Eric Schnoebelen 2014-07-31 21:39:32 UTC
Created attachment 923036 [details]
revised patch to implement the desired feature request.

Ok, the patch I submitted worked well for the test I was using, but it didn't handle the expansion of resultdir correctly if resultdir contained macros. (I was testing with the --resultdir=<path> case.

The attached patch pushes the expanded version of resultdir back into config_opts, so it can be used in config_opts['yum.conf']

Comment 2 Miroslav Suchý 2014-10-23 13:08:58 UTC
You patch no longer apply. However I tried to rewrite it, but it is ugly.
So then I step back and thought what you are trying to achieve. If your use case is just about getting resultdir in yum.conf, then mockchain is probably what you want to use.
Mockchain will build several SRPM into resultdir and after each SRPM rebuild is created local yum repo, which is available in buildroot of next package.

Does it solve your issue?

Comment 3 Eric Schnoebelen 2014-10-29 19:36:49 UTC
Unfortunately, we're using the SCM integration in our build system, of which mock is a component.  And, as far as I can tell, mockchain has no idea how to deal with SCM based components.

I'm looking at the current mock sources from git, and will try to create a minimally intrusive patch providing the functionality my project is needing.

Comment 4 Eric Schnoebelen 2015-01-08 20:31:17 UTC
Created attachment 977936 [details]
Updated patch to allow the subsitution of resultdir into the yum.conf block

The attached patch adds the desired feature of allowing the expansion of config_opts['resultdir'] (with it's own expansions) into the yum.conf generated by mock from  the root configuration file.

Comment 5 Eric Schnoebelen 2015-01-08 20:32:03 UTC
The above patch is against the top of the git tree, branch master, as of 2015-01-07.

Comment 6 Miroslav Suchý 2015-01-12 22:46:21 UTC
I have to edit it little bit to make it work with DNF too.

But thanks for that patch.

Commited as 95a4504

Comment 7 Fedora Update System 2015-01-16 09:56:33 UTC
mock-1.2.4-1.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/mock-1.2.4-1.fc21

Comment 8 Fedora Update System 2015-01-16 09:57:12 UTC
mock-1.2.4-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/mock-1.2.4-1.fc20

Comment 9 Fedora Update System 2015-01-16 10:00:57 UTC
mock-1.2.4-1.el7 has been submitted as an update for Fedora EPEL 7.
https://admin.fedoraproject.org/updates/mock-1.2.4-1.el7

Comment 10 Fedora Update System 2015-01-16 10:01:35 UTC
mock-1.2.4-1.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/mock-1.2.4-1.el6

Comment 11 Fedora Update System 2015-01-16 19:10:14 UTC
Package mock-1.2.4-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.4-1.el7'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-EPEL-2015-0312/mock-1.2.4-1.el7
then log in and leave karma (feedback).

Comment 12 Eric Schnoebelen 2015-01-16 20:00:48 UTC
I've been tracking the git repo, building and testing. Code inspection and testing demonstrated the changes are working as desired.

Thank you.

Comment 13 Sergio Monteiro Basto 2015-01-18 03:23:56 UTC
Hi, I think I have other RFE for yum 

vi /etc/mock/site-defaults.cfg
can't set deltarpm=0 globally ?

Comment 14 Miroslav Suchý 2015-01-19 07:21:49 UTC
> Hi, I think I have other RFE for yum 

One bugzilla, one issue. Please open new BZ report.

Comment 15 Fedora Update System 2015-01-21 23:08:54 UTC
mock-1.2.4-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 2015-01-27 03:04:26 UTC
mock-1.2.4-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-28 15:20:03 UTC
mock-1.2.5-1.el7 has been submitted as an update for Fedora EPEL 7.
https://admin.fedoraproject.org/updates/mock-1.2.5-1.el7

Comment 18 Fedora Update System 2015-01-28 15:21:23 UTC
mock-1.2.5-1.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/mock-1.2.5-1.el6

Comment 19 Fedora Update System 2015-01-28 15:22:31 UTC
mock-1.2.5-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/mock-1.2.5-1.fc20

Comment 20 Fedora Update System 2015-01-28 15:23:45 UTC
mock-1.2.5-1.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/mock-1.2.5-1.fc21

Comment 21 Fedora Update System 2015-02-02 17:22:19 UTC
mock-1.2.5-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 22 Fedora Update System 2015-02-03 04:42:13 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 23 Fedora Update System 2015-02-03 04:42:49 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 24 Fedora Update System 2015-02-03 04:43:41 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 25 Fedora Update System 2015-02-03 04:44:13 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 26 Sergio Monteiro Basto 2015-02-03 17:18:37 UTC
Hi, 

Can I set deltarpm=0 globally using this feature ( config_opts['yum.conf'] ) ?

Comment 27 Fedora Update System 2015-02-09 05:29:28 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 28 Fedora Update System 2015-02-15 02:55:50 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 29 Fedora Update System 2015-02-20 00:32:36 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 30 Fedora Update System 2015-02-20 00:33:34 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.