Hi Tim,

Tim Cutts wrote:
> Isn't in the first one that's wrong, not the second?  If the quotes have
> made it through to the command line (because it wasn't executed with a
> shell) then the value of DPkg::Options will include the quotes, which
> isn't correct.  I suspect this is a case of whether the command is being
> run in a shell or not.

I found out that one can add the lines

force-confdef
force-confold

to /etc/dpkg/dpkg.cfg to set these options globally. So I've build a
promise that's adds these lines right at the beginning of the cf-agent
run, and all is well:

<snip http://paste.debian.net/53541/>
bundle agent dpkgConfig {
vars:
        any::
                "dpkg_cfg" string => "/etc/dpkg/dpkg.cfg";
files:
        any::
                "$(dpkg_cfg)"
                        edit_line => AppendIfNoSuchLine("force-confold"),
                        comment => "Upon package installation, do not overwrite 
existing
config files with new ones";
}

bundle edit_line AppendIfNoSuchLine(Line) {
insert_lines:
        "$(Line)"
                location => "Append";
}

body location Append {
        before_after => "after";
}
</snip>

Cheers,
Robert

_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to