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

Re: Debconf problem



Frank Küster wrote:
> However, in case apt-utils is installed, this script will be run twice:
> Once by dpkg-preconfigure, i.e. in the preinst stage, and once by
> confmodule when the postinst script sources confmodule.  As far as I can
> see, this will have a confusing effect.  Assume the configfile currently
> contains
> 
> FOO=true
> 
> and the local admin wants to change this to 
> 
> FOO=false
> 
> using dpkg-reconfigure mypackage.  This is what is going to happen:

dpkg-reconfigure runs the config script exactly once, so the config file
is read once, its values are used for defaults to the questions to allow
reconfiguration, and are saved to the config file by the postinst.

In the case of a fresh installation of the package, or an upgrade from a
version before the config file exists, or before a given line is added
to the config file, the config script runs the first time, does not
override the question from the default in the debconf database because
the config file is not present, the user answers the question, the
config script runs again similarly but the question is not asked a second
time, and the postinst script writes the values into the config file.

In the case of an upgrade of the package, the config file exists, the
config script runs as you describe but the user is not asked any
questions since they have seen them before, and the postinst writes the
old values back into the config file.

In more complex cases, such as adding a debconf question based on a
config file line that already exists in a previous version of the
package, you have to add additional code.

-- 
see shy jo

Attachment: signature.asc
Description: Digital signature


Reply to: