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

The magic of debconf - can I avoid a second run of config?



Hello,

due to filing too many bug reports I have been coerced ;-) to take over
maintainership of the f-prot-installer package in contrib.

The package is intended to install the F-Prot for Small Business virus
scanner which is availabe at http://www.f-prot.com/getfplinfree.html

Lately F-Prot has started offering their own deb, but it is rather
broken. Therefore I think that the f-prot-installer package still has a
reason to exist.

Now, the current situation with the package is as follows: The user
currently has to download the actual program files manually and place
them into a directory where the postinst script can find them.

The package doesn't use debconf yet, so the postinst script has to
prompt the user two times for input which interrupts the installation
process.

As I understand debian policy, this is deprecated. Instead all questions
should be asked by the config script during the preconfiguration phase.

My intention is:

	- to make the config script gather all needed information;
	- to make the postinst script verify if a new upstream version
	  is available, and if so, download the needed files or use
	  locally available files if so requested, unpack them.

Now, a substantial problem I have is, that, depending on the situation,
one or more questions _must_ be asked at _each_ installation. 

- If a version of F-Prot is already installed, do you wish to reinstall
  (i.e. check if there is an update and if yes, download and install it)
  or should I leave it alone?

- Do you wish to use an already downloaded file?

- If so, where do I find it?

- If not: Do you wish to proceed with the installation, as it requires a
  running Internet connection?

Especially with the last three questions, this is an issue: You cannot
assume that on each package upgrade the user will give identical answers
here.

Therefore I have used db_fset f-prot-installer/foobar seen false
to ensure that the question is asked at each upgrade.

Now, I've noticed that running the debconfized postinst file, it in fact
calls the config file again. As I understand man debconf-devel, this
seems to be intended. In fact config is run two times, at preconfigure
and configure stage.

This leads to quite unexpected results because due to db_fset all the
questions are asked once again and configuration is therefore
interrupted once again.

BTW: I've noticed the same behaviour with the realplayer installer
package, (which has obviously been removed from debian).

So I wonder, if there is any way to avoid this.

Does the config script "know", how it it called? Is there a variable
that indicates if it is called from the postinst or at preconfigure
stage?

Or could it be that debconf isn't the right tool for my purpose anyway?

Thanks for any comments,

Johannes


-- 
~/.signature under construction



Reply to: