On 3/9/11 4:56 PM, James Antill wrote: > Brian Long <brilong@xxxxxxxxx> 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 > POV. > Thanks for the ideas, Seth and James. It turns out I overlooked something simple. I've been playing with CentOS so long, I forgot RHEL's $releasever includes the "Server" or "Workstation" string. I changed my mrepo config to create "rhel6Server-x86_64" and "rhel6Workstation-x86_64" and the yum $releasever works great in that case (i.e. "rhel$releasever-$basearch"). /Brian/ -- Brian Long | | Corporate Security Programs Org . | | | . | | | . ' ' C I S C O _______________________________________________ Yum mailing list Yum@xxxxxxxxxxxxxxxxx http://lists.baseurl.org/mailman/listinfo/yum