Bug 1056039

Summary: [PATCH] $releasever in Repos field is not expanded
Product: [Fedora] Fedora Reporter: Jan Kaluža <jkaluza>
Component: mockAssignee: Clark Williams <williams>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 20CC: ignatenko, mebrown, msuchy, williams
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: mock-1.1.38-1.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-02-08 05:02:58 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:
Embargoed:
Attachments:
Description Flags
[PATCH] unquote repos
none
First approach to fix the problem
none
Final patch, which fix this issue. none

Description Jan Kaluža 2014-01-21 12:56:44 UTC
Hi,

I'm trying to add sclo-build into my buildroot for httpd24 SCL built in Copr. I have added following repository into Repos field on Edit page:

http://copr-be.cloud.fedoraproject.org/results/msuchy/sclo-build/fedora-$releasever-$basearch/

When I start building packages later, I see following error in root.log:

DEBUG util.py:281:  http://copr-be.cloud.fedoraproject.org/results/msuchy/sclo-build/fedora-%24releasever-i386/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - 

Full log file is here:
http://copr-be.cloud.fedoraproject.org/results/jkaluza/httpd24/fedora-20-i386/httpd24-1-10.el7/root.log

Comment 1 Igor Gnatenko 2014-01-21 19:49:40 UTC
Created attachment 853431 [details]
[PATCH] unquote repos

I've not tested it.

Miroslav, test this patch and let me know if it wrong ;)

Comment 2 Miroslav Suchý 2014-01-22 21:38:41 UTC
The problem is not in copr. You can see from log:

1390295406.79:executing: u"/usr/bin/mockchain -r fedora-20-i386 -l /var/tmp/mockremote-KPMUj/build/ -a 'http://copr-be.cloud.fedoraproject.org/results/msuchy/sclo-build/fedora-$releasever-$basearch/' -a http://copr-be.cloud.fedoraproject.org/results/jkaluza/httpd24//fedora-20-i386 -m '--define=copr_username jkaluza' -m '--define=copr_projectname httpd24' http://jkaluza.fedorapeople.org/httpd24-1-10.el7.src.rpm"

that the url is passed correctly. So this is problem of mockchain.

Steps to reproduce:

1. Run:
/usr/bin/mockchain -r fedora-19-x86_64 -l /var/tmp/mockremote-ZAPFX/build/ -a 'http://copr-be.cloud.fedoraproject.org/results/msuchy/sclo-build/fedora-$releasever-$basearch/' -a http://copr-be-dev.cloud.fedoraproject.org/results/msuchy/afsdagfd//fedora-19-i386 http://copr-be.cloud.fedoraproject.org/results/msuchy/sclo-build/fedora-19-x86_64/sclo-build-4-1.fc20/sclo-build-4-1.fc19.src.rpm

2) grep ERROR /var/tmp/mockremote-ZAPFX/build/results/fedora-19-x86_64/sclo-build-4-1.fc19/root.log

Actual output:
DEBUG util.py:281:  http://copr-be.cloud.fedoraproject.org/results/msuchy/sclo-build/fedora-%24releasever-x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"

Expected output:
no error

Note: you have to do that with mock-1.1.36 because otherwise this repo will not be considered at all due bug 1034805

Note2: It is strange. Notice that $basearch have been correctly substituted, while $releasever was instead escaped.

Comment 3 Miroslav Suchý 2014-01-22 21:39:24 UTC
Comment on attachment 853431 [details]
[PATCH] unquote repos

This patch is not relevant.

Comment 4 Miroslav Suchý 2014-01-22 22:06:01 UTC
Hmm /var/tmp/mockremote-ZAPFX/build/configs/fedora-19-i386/fedora-19-i386.cfg contains:
config_opts['yum.conf'] = '....[coprbecloudfedoraprojectorg_results_msuchy_sclobuild_fedorareleaseverbasearch_]\nname=http://copr-be.cloud.fedoraproject.org/results/msuchy/sclo-build/fedora-$releasever-$basearch/\nbaseurl=http://copr-be.cloud.fedoraproject.org/results/msuchy/sclo-build/fedora-$releasever-$basearch/\nenabled=1...'

which is correct. So it seems to be problem in mock itself rather then mockchain.

And /var/lib/mock/fedora-19-i386-root-3935/root//etc/yum.conf contain:

[coprbecloudfedoraprojectorg_results_msuchy_sclobuild_fedorareleaseverbasearch_]
name=http://copr-be.cloud.fedoraproject.org/results/msuchy/sclo-build/fedora-$releasever-$basearch/
baseurl=http://copr-be.cloud.fedoraproject.org/results/msuchy/sclo-build/fedora-$releasever-$basearch/
enabled=1
skip_if_unavailable=1
metadata_expire=30
cost=1

This seems to be ok as well. Hmpf - who is responsible for setting value of $releasever?

Comment 6 Miroslav Suchý 2014-01-22 22:40:39 UTC
Well. Setting distroverpkg=19 in config_opts['yum.conf'] does not help. Which is strange even if we use system yum. That is probably worth another BZ.

But for our case we should stick with this part from "man yum"

--releasever=version
  Pretend the current release version is the given string. This is very useful when combined with --installroot. You can  also  use --releasever=/ to take the releasever information from outside the installroot.  Note that with the default upstream cachedir, of /var/cache/yum, using this option will corrupt your cache (and you can use $releasever in your  cachedir  configuration  to  stop this).

And what is actually run is:
 6035 pts/0    S+     0:00  |           \_ /usr/bin/python -tt /usr/sbin/mock --configdir /var/tmp/mockremote-ZAPFX/build/configs/fedora-19-i386 --resultdir /var/tmp/mockremote-ZAPFX/build/results/fedora-19-i386/sclo-build-4-1.fc19 --uniqueext root-6033 -r fedora-19-i386 --define=copr_username msuchy --define=copr_projectname afsdagfd --define=vendor Fedora Project COPR (msuchy/afsdagfd) /tmp/tmpVo7q5H/sclo-build-4-1.fc19.src.rpm
 6058 ?        Rs     0:03  |               \_ /usr/bin/python /usr/bin/yum --installroot /var/lib/mock/fedora-19-i386-root-6033/root/ groupinstall buildsys-build --setopt=tsflags=nocontexts

i.e mock does not pass --releasever to yum, which is then clueless.

Comment 7 Miroslav Suchý 2014-01-22 22:54:26 UTC
Created attachment 854105 [details]
First approach to fix the problem

I believe that this can fix the problem (however I did not test it yet - will do next day).
If it will work I will add that new variable to all mock configs.

Comment 8 Miroslav Suchý 2014-01-23 12:09:18 UTC
I can confirm that this fix the problem and $releasever is substituted. I will prepare clean and final patch.

Comment 9 Miroslav Suchý 2014-01-23 21:37:52 UTC
Created attachment 854608 [details]
Final patch, which fix this issue.

Comment 10 Miroslav Suchý 2014-01-24 08:42:04 UTC
BTW regarding the original report: I build the patched version in:
  http://copr.fedoraproject.org/coprs/msuchy/Mock/
and this patched version is now used by Copr. So this issue on Copr should be fixed now.

Comment 11 Fedora Update System 2014-02-06 02:09:18 UTC
mock-1.1.36-1.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/mock-1.1.36-1.fc19

Comment 12 Fedora Update System 2014-02-06 02:11:00 UTC
mock-1.1.36-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/mock-1.1.36-1.fc20

Comment 13 Fedora Update System 2014-02-06 02:12:30 UTC
mock-1.1.36-1.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/mock-1.1.36-1.el6

Comment 14 Fedora Update System 2014-02-06 21:08:28 UTC
Package mock-1.1.36-1.el6:
* should fix your issue,
* was pushed to the Fedora EPEL 6 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=epel-testing mock-1.1.36-1.el6'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-EPEL-2014-0467/mock-1.1.36-1.el6
then log in and leave karma (feedback).

Comment 15 Fedora Update System 2014-02-08 05:02:58 UTC
mock-1.1.36-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 16 Fedora Update System 2014-03-25 20:25:13 UTC
mock-1.1.37-1.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/mock-1.1.37-1.fc19

Comment 17 Fedora Update System 2014-03-25 20:27:38 UTC
mock-1.1.37-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/mock-1.1.37-1.fc20

Comment 18 Fedora Update System 2014-03-25 20:29:38 UTC
mock-1.1.37-1.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/mock-1.1.37-1.el6

Comment 19 Fedora Update System 2014-03-27 17:48:14 UTC
mock-1.1.37-2.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/mock-1.1.37-2.fc20

Comment 20 Fedora Update System 2014-03-27 17:50:08 UTC
mock-1.1.37-2.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/mock-1.1.37-2.fc19

Comment 21 Fedora Update System 2014-03-27 17:51:59 UTC
mock-1.1.37-2.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/mock-1.1.37-2.el6

Comment 22 Fedora Update System 2014-03-31 19:04:52 UTC
mock-1.1.38-1.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/mock-1.1.38-1.fc19

Comment 23 Fedora Update System 2014-03-31 19:07:10 UTC
mock-1.1.38-1.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/mock-1.1.38-1.el6

Comment 24 Fedora Update System 2014-03-31 19:09:08 UTC
mock-1.1.38-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/mock-1.1.38-1.fc20

Comment 25 Fedora Update System 2014-04-09 13:19:11 UTC
mock-1.1.38-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 26 Fedora Update System 2014-04-18 15:38:05 UTC
mock-1.1.38-1.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 27 Fedora Update System 2014-04-19 09:20:21 UTC
mock-1.1.38-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.