Re: reading installonlypkgs config option?
seth vidal <[email protected]>
| Newsgroups | gmane.linux.rpm.yum |
|---|---|
| Message-ID | <1175802397.19199.41.camel@cutter> |
On Thu, 2007-04-05 at 15:23 -0400, Matthew Miller wrote:
> On Thu, Apr 05, 2007 at 02:00:16PM -0400, seth vidal wrote:
> > > Okay, that'll work.
> > > > Alternatively, you'd have to parse the config file on your own.
> > > Or if I patch yum to provide config installonlypkgs in yum shell, would you
> > > apply it?
> > sure, but how would you grab the info? it doesn't let you save it, just
> > set it.
>
> Well, unless you're going to go down the road of full-scripting-language in
> yum shell :) , I'd just do something like:
>
> yum check-update yum || yum -y update yum
> P=$(echo config installpkgs|yum shell|awk '/> installpkgs:/ {print $3}')
> yum check-update $P || yum -y update $P
> yum check-update || yum -y update
>
> (except with actually checking return values and doing something with the
> output.)
so, this won't help you on older versions but on yum 3.1.X and beyond
you could do this in a script:
#!/usr/bin/python
import yum
my = yum.YumBase()
for thing in my.conf.installonlypkgs:
print thing,
print ''
which outputs:
kernel kernel-bigmem kernel-enterprise kernel-smp kernel-modules
kernel-debug kernel-unsupported kernel-source kernel-devel
on my box.
-sv