help-cfengine
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: method to check for package installation


From: Chip Seraphine
Subject: Re: method to check for package installation
Date: Wed, 28 Apr 2004 08:01:38 -0500
User-agent: KMail/1.5.4

Be careful if you are using the latest versions.... ReturnsZero() has not been 
working lately for me (and some others on the list).


On Wednesday 28 April 2004 07:17, Christian Pearce wrote:
> Graham,
> 
> I have been doing this for years.
> 
> control:
>  
>     logwatch_rev     = ( "5.1-1" )
>     logwatch_package = ( "logwatch-$(logwatch_rev).noarch.rpm" )
> 
> groups:
>     # Test to see if logwatch is installed.
>     logwatch_installed = ( ReturnsZero(${rpm} -q --quiet logwatch) )
>  
>     # Test to see if logwatch is upgraded to the latest version.
>     logwatch_upgraded = ( ReturnsZero(${rpm} -q --quiet
> logwatch-${logwatch_rev}) )
>  
> 
> 
> On Tue, 2004-04-27 at 20:38, Graham Allan wrote:
> > I'm trying to write a method file to check if a particular RPM package
> > is installed, and if not, install it.
> > 
> > So far I've completely failed to make cfengine check whether a package
> > is installed, when the package name is held in a variable.
> > 
> > Attempts 1 and 2 were to define a class.
> > 
> > classes:
> >   package_installed = ( '/bin/rpm -q ${packagename}' )
> > 
> > and...
> > 
> > classes:
> >   package_installed = ( ReturnsZero(/bin/rpm -q ${packagename}) )
> > 
> > Attempt 3 was use use the "packages" action.
> > 
> > packages:
> >   any::
> >     $(packagename) pkgmgr=rpm define=package_installed
> > 
> > 
> > In every case, the cfengine output shows that rpm is being called to
> > check for a literal "${packagename}" package - the variable is not
> > getting substituted. The same commands work fine when they contain the
> > literal package name.
> > 
> > Is there any way I've missed that might make this work?
> > 
> > G.
> -- 
> Christian Pearce
> http://www.commnav.com
> http://www.perfectorder.com
> 
> 
> 
> 
> _______________________________________________
> Help-cfengine mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/help-cfengine
> 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]