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: Phil D'Amore
Subject: Re: method to check for package installation
Date: Wed, 28 Apr 2004 09:04:28 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030314

Probably the easiest way to do this is something like this within cfengine:

packages:
   <package_name>   elsedefine=need_package


shellcommands:
   need_package::
      "your favorite install command here"

This really works best with something that solves dependancies, like up2date, yum, or <insert favorite tool here>. Using rpm by itself works well only if you can be sure that the rpm command you fire off includes all the packages to solve deps on a single command line. Check the packages docs for other options like version checks.

I'm supposed to be coming up with an option to packages that will just automatically install the package, but alas, my employer has had other plans for my time lately...

Tim Nelson wrote:

On Tue, 27 Apr 2004, 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.

Is there some particular reason you aren't using RPM's built-in functionality? rpm -i and rpm -U both do this.
        :)


--
Phil D'Amore                             "Sometimes there is a fine line
Senior System Administrator               between criminally abusive
Red Hat, Inc                              behavior and fun."
Office: 919.754.3700 x44395                 -- Ted the Generic Guy
Pager: 877.383.8795                            (Dilbert 4/19/2003)






reply via email to

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