Re: How to use /etc/yum/vars/* ?

James Antill <[email protected]>
Newsgroups gmane.linux.rpm.yum
Message-ID <[email protected]>
Chris Albertson <[email protected]> writes:

> In the man page for yum.conf there is a note that reads..
>
>   "As of 3.2.28, any file in /etc/yum/vars is turned into a variable named
>    after the filename (or overrides any of the above variables)."
>
> How do I use this?  I'm guessing that maybe I make a file called
> /etc/yum/vars/FOOBAR and have it output a string to stdout
>  and then inside yum.conf  I can use a macro called $FOOBAR
>
> Is this documented any place other then what I quoted above?
> If I figure this out I'll be happy to submit a man page patch.


 There's the following two paragraphs, but as an example let's say you
want something like $release but for "myapp". The way you could do
this is ship a config. file called "/etc/yum/vars/myapp_release" with
"3" in it and then you can have your myapp.repo file look like:

[myapp]
name = Myapp. repo. for version $myapp_release
baseurl = http://example.com/myapp/$myapp_release/$basearch

...the filename (key) can be "anything", but the config. file
processor only looks for the Regexp "[$]\w+". The contents of the file
(value) can also be anything, but yum will only read the first line
(and then removes the \n) ... also yum doesn't do any escaping, so if
you make the contents of "myapp_release" "foo&bar" then the url part
is going to be wrong.


-- 
James Antill -- [email protected]
http://www.and.org/and-httpd/ -- $2,000 security guarantee
http://www.and.org/ustr/
http://www.and.org/vstr/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.