[Yum] $releasever Issue

James Antill james-yum at and.org
Wed Mar 9 21:56:16 UTC 2011

Brian Long <brilong at cisco.com> writes:

> I'm playing with a tool called mrepo which allows one to automate the
> mounting of distro ISOs, download updates, and serve them via yum.  It
> was written before Spacewalk was available and in my limited testing
> seems to work well.
> The only issue comes with the default directory structure and yum
> variable $releasever.  If I mount the RHEL 6 Server ISO, it defaults to
> rhel6s-x86_64/disc1 and RHEL 6 Workstation goes to rhel6w-x86_64/disc1.
>  I'd like to use $releasever for the "6" so I could add support for RHEL
> 5.x in the future, but yum doesn't like "$releasevers" (notice the
> trailing s) or ${releasever}s like bash.

 This is done in varReplace() in parser.py ... which just does a
literal \w+ ... I'd thought about extending it before, to allow
$(foo)s or ${foo}s or something, but it's very rarely needed not asked
for by anyone and not super trivial, so it never got done.

>  Is there a way to get this
> working with $releasever or should I consider changing mrepo to use a
> different directory name to distinguish Server vs. Workstation?  I spend
> a few minutes trolling through yum's source code but couldn't see how
> the yum.conf was parsing releasever.

 One other thing you can do (RHEL-6+ yum) is:

echo 6s > /etc/yum/vars/releasevers
echo 6w > /etc/yum/vars/releaseverw

...and use those, but I'm not sure if that's better or worse from your

James Antill -- james at and.org

More information about the Yum mailing list