help-cfengine
[Top][All Lists]
Advanced

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

cfengine module for querying portage (only useful for gentoo linux)


From: tigger
Subject: cfengine module for querying portage (only useful for gentoo linux)
Date: Tue, 27 Jan 2004 14:59:17 +0000
User-agent: Mutt/1.5.5.1i

All,

Attached is a cfengine module which allows you to test for packages that
are installed.

Please run ./module:cfportage to get usage instructions.

I would suggest that you always test for the condition you would act
upon, i.e. if you would like to install a package if its not installed,
do:

control:
        actionsequence = (
        "module:cfportage.app_missing -m app_missing app-misc/app"
        shellcommands
        )

shellcommands:
        app_missing::
                "/usr/bin/emerge app-misc/app"

Rather than testing if its installed with -i. The reason for this is
that if the module fails for some reason, you're class won't be defined,
regardless of whether the package is installed. If you test if something
is installed and the module fails, the class won't be set, so you'll end
up installing whether its installed or not. Hope that makes sense...

Speaking of that, being able to check the return value of a module would
be very useful...

cheers,

rob

-- 
rob holland - [ tigger@gentoo.org ]
irc://irc.freenode.net/#gentoo as tigger^
http://dev.gentoo.org/~tigger/tigger@gentoo.org.asc

Attachment: pgpdJwefo_GN2.pgp
Description: PGP signature


reply via email to

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