help-cfengine
[Top][All Lists]
Advanced

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

Re: Suggestions on Testing for Packages


From: Russell Adams
Subject: Re: Suggestions on Testing for Packages
Date: Wed, 2 Feb 2005 12:12:08 -0600
User-agent: Mutt/1.4.2.1i

I wrote a module / shell script to do this, but I've never used it. ;]

I don't think you can test for specific versions, just a package name.

If its useful, let me know. Perhaps I'll post it to cfwiki.org if it
works properly.

module:apt_query
------------------------------------------------------------
#!/bin/sh

######################################################################
# $Id: apt_query,v 1.3 2004/11/27 20:48:53 root Exp $
#
# Module to query packages via apt-cache
#
# Return Classes:
#   AptQuery_Package_Installed         $Package is installed
#   AptQuery_Package_NotInstalled      $Package is not installed

MY_PACKAGE="$1"

/usr/bin/apt-cache show $MY_PACKAGE \
        | grep '^Status:.*ok installed' \
        && {
           echo "+AptQuery_${MY_PACKAGE}_Installed"
           exit
           }

echo "+AptQuery_${MY_PACKAGE}_NotInstalled"

------------------------------------------------------------

Russell

On Wed, Feb 02, 2005 at 11:01:08AM -0500, Brian E. Seppanen wrote:
> Has anyone come up with a method they would be willing to describe or 
> share on how I can use cfengine to determine if a package is installed 
> on a debian host with dpkg, or solaris with pkginfo?    Eventually I'm going 
> to have 
> to figure out how to do this, and was wondering how others have worked on 
> this?   I have to check for packages on a regular basis.
> 
> Thanks for the help.
> 
> Brian Seppanen
> address@hidden
> 608.826.1464
> 
> 
> _______________________________________________
> Help-cfengine mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/help-cfengine
> 
-----------------------------
Russell Adams
address@hidden
http://www.adamsinfoserv.com/




reply via email to

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