Red Hat Bugzilla – Bug 869758
custom repos available at install time containing var (ie $basearch)
Last modified: 2013-01-16 23:35:00 EST
Created attachment 632918 [details]
Description of problem:
Adding custom repos in a recipeset xml $basearch is not interpreted correclty by Beaker during install. The resulting URL during install is invalid.
Only a problem w/ RHEL6 because of snippet used in RHEL6 kickstart template to make available custom repos during install.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. add the following line or similar containing $basearch to your recipeset
<repo name="rt-devel" url="http://download.devel.redhat.com/rel-eng/repos/mrg-rt-2.0-rhel-6-devel/\$basearch"/>
2. Provision RHEL 6 via Beaker
3. Provision will hang.
Provision will hang because of a invalid URL. Seen in the apache access_log on target web server. (Attached)
Cannot retrieve repository metadata (repomd.xml) for repository: mrg-rhel6-optional. Please verify its path and try again
('custom', ['_Exit installer', 'Edit', '_Retry', '_Continue'])
$basearch will be expanded correctly and used to build the kickstart resulting in valid repo URL during install
It would be nice if Beaker could substitute $basearch and $releasever and put the right URL into the repo command for Anaconda. But there's no way we can do that correctly. Yum has a *lot* of complicated logic for figuring out $basearch  and $releasever comes from whatever RPM provides redhat-release or whatever. So there's no practical way for Beaker to figure this stuff out for you.
I think the best we can do here is to exclude any repos with a $ variable from Anaconda, so that it doesn't get confused and hang the installation.
I'm also not sure why you have escaped the $ in your repo URL? Is that to work around an escaping bug in Beaker? If so I would like to fix that.
(In reply to comment #1)
> I'm also not sure why you have escaped the $ in your repo URL? Is that to
> work around an escaping bug in Beaker? If so I would like to fix that.
The extract you refer to is from our XSLT template. In XSLT, you need to escape the $ character, otherwise it's considered a local XSLT variable. Running '\$basearch' through an XSLT processor results in '$basearch' in the XML output.
(In reply to comment #3)
Right, Beaker uses a bash heredoc like <<EOF to write out the repo configurations to /etc/yum.repos.d/ so $basearch is interpreted as a shell variable. We should be using <<"EOF" instead. I will clone a new bug for that.
(In reply to comment #4)
> I will clone a new bug for that.
On Gerrit: http://gerrit.beaker-project.org/1514
Beaker 0.11.0 has been released.