[Top][All Lists]

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

Re: cfengine Debian apt-get

From: Sami J. Mäkinen
Subject: Re: cfengine Debian apt-get
Date: Thu, 23 Dec 2004 09:40:52 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040913

Pe5kyTac0 wrote:
What I don't see is a way to run the following in cfengine

if apt-show-versions | grep "portmap" then
apt-get remove portmap

Of course you can, e.g.

    "/bin/sh -c 'apt-show-versions | grep $(dblquote)portmap$(dblquote) && (apt-get 
remove portmap)'" timeout=60

The key here is || and && notation of the shell.
We are using apt-get and yam repository to install things on
RHEL3 machines that use rpm natively, like this:

    "/bin/sh -c 'rpm -q --quiet compat-db || (apt-get update; apt-get -y install 
compat-db)'" timeout=60
    "/bin/sh -c 'rpm -q --quiet lynx || (apt-get update; apt-get -y install 
lynx)'" timeout=60

If you can ask apt-show-versions to tell only the version of
a given package, I would prefer that. You are now dumping
names and versions of all installed software to grep.
As you see, I am not familiar with apt-show-versions
since we use rpm with apt-get here.

-- sjm
"Pirättäkää. Nakkeletta nuallen rassukoollen peräkoijasta
 jokuja napollisia opaalia."  - Junttapurin maharatsa

reply via email to

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