Morten Werner Forsbring wrote:
Bas van der Vlies <[EMAIL PROTECTED]> writes:

When i want to install deb packages with cfengine2 it will always install
the package with statements like:

package:
      ipython action=install

Can you please elaborate a bit? What do you expect and what does
happen / not happen?


ofcourse

I just want that the ipython package is installed. It will install the package, but with out this patch it will install everytime cfengine is run:

dpkg -l ipython:
 ii  ipython        0.7.2-5        enhanced interactive Python shell

now i run cfagent:
*********************************************************************
 Main Tree Sched: packages pass 1 @ Thu Feb 14 09:05:58 2008
*********************************************************************

Package: ipython
Something impossible happened... ('grep' exited abnormally).
Package manager will be invoked as /etc/cfengine/global/debian/install_pkg
BuildCommandLine(): Adding package 'ipython' to the list.
cfengine:ldapn1: Installing package(s) using '/etc/cfengine/global/debian/install_pkg ipython'


This patch fixes 3 things we do not get this line anymore:
 - Something impossible happened... ('grep' exited abnormally).
 - And does try to install the package again
 - i can now also remove packages without specifying a version
   packages:
        ipython action=remove

   gives an error:
        package: ipython
        Something impossible happened... ('grep' exited abnormally).


Just to make clear this line must be added:
 - if ((pp = cfpopen_sh(VBUFF, "r")) == NULL)


fix included:
-/*
- * HvB : Changed cfopen to cfopen_sh
-*/
-if ((pp = cfpopen_sh(VBUFF, "r")) == NULL)
+if ((pp = cfpopen (VBUFF, "r")) == NULL)
    {
    Verbose ("Could not execute APT-command (apt-cache policy).\n");
    return 0;
@@ -768,7 +765,6 @@

In the next email to this bug you say:

The patch must be cfpopen must be replace by cfpopen_sh ;-)

So what you want is the following,

| diff -ruN cfengine-2.2.3.orig/src/package.c
| cfengine-2.2.3/src/package.c
| --- cfengine-2.2.3.orig/src/package.c   2007-11-21 18:20:01.000000000 +0100
| +++ cfengine-2.2.3/src/package.c        2008-02-13 23:13:13.000000000 +0100
| @@ -734,7 +734,7 @@
|  snprintf (VBUFF, CF_BUFSIZE, "/usr/bin/apt-cache policy %s 2>&1 | grep -v " \
|            "\"W: Unable to locate package \"", package);
|
| -if ((pp = cfpopen_sh(VBUFF, "r")) == NULL)
| +if ((pp = cfpopen (VBUFF, "r")) == NULL)
|     {
|     Verbose ("Could not execute APT-command (apt-cache).\n");
|     return 0;

right?


- Werner


--
--
********************************************************************
*                                                                  *
*  Bas van der Vlies                     e-mail: [EMAIL PROTECTED]      *
*  SARA - Academic Computing Services    phone:  +31 20 592 8012   *
*  Kruislaan 415                         fax:    +31 20 6683167    *
*  1098 SJ Amsterdam                                               *
*                                                                  *
********************************************************************



--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to