major debconf changes
- To: config@kitenet.net, debian-devel@lists.debian.org, mailcrypt@packages.debian.org, apple2@packages.debian.org, sdic-edict@packages.debian.org, acct@packages.debian.org, netbase@packages.debian.org, im@packages.debian.org, dhis@packages.debian.org, proftpd@packages.debian.org, auctex@packages.debian.org, wnorwegian@packages.debian.org, taper@packages.debian.org, horde@packages.debian.org, imp@packages.debian.org, alevt@packages.debian.org, Rafael Laboissiere <rafael@icp.inpg.fr>, Roland Rosenfeld <roland@spinnaker.de>, "T.A. Lees" <tal26@hermes.cam.ac.uk>
- Subject: major debconf changes
- From: Joey Hess <joey@kitenet.net>
- Date: Fri, 29 Oct 1999 16:41:06 -0700
- Message-id: <[🔎] 19991029164105.A5741@kitenet.net>
- Mail-followup-to: config@kitenet.net, debian-devel@lists.debian.org, mailcrypt@packages.debian.org, apple2@packages.debian.org, sdic-edict@packages.debian.org, acct@packages.debian.org, netbase@packages.debian.org, im@packages.debian.org, dhis@packages.debian.org, proftpd@packages.debian.org, auctex@packages.debian.org, wnorwegian@packages.debian.org, taper@packages.debian.org, horde@packages.debian.org, imp@packages.debian.org, alevt@packages.debian.org, Rafael Laboissiere <rafael@icp.inpg.fr>, Roland Rosenfeld <roland@spinnaker.de>, "T.A. Lees" <tal26@hermes.cam.ac.uk>
[ I think I've sent this directly to most insterested parties, but I will cc
debian-devel to make sure. ]
I've decided to slip in a major update to debconf before the freeze (which I
understand has been delayed one week). It should be at least mostly
backwards compatable, but to use it fully, you need to make several changes
to your packages that use debconf, and I hope everyone can make those
changes before the freeze. If this looks like too much work, contact me and
I will prepare a diff for you and optionally do a NMU of your package.
The new version of debconf, in Incoming now, is 0.2.0. The relevant entries
from the changelog are at the end of this message. Debhelper 2.0.67, also in
Incoming, has support for this new version.
If you are using confmodule.sh in a config script or other script, here is a
checklist to follow to update to the new version:
* Change the line that sources confmodule.sh to source confmodule, which is
in the same directory.
* Right after that line, add a call to "db_version 2.0". If you already have
some other db_version call, remove it.
* Change your debconf dependancy to debconf (>= 0.2.0)
* db_input and db_go commands can now return a non-zero return code, which
will make set -e scripts exit if not trapped. Trap the return codes of
those commands. Eg: "db_input || true" will serve in most cases.
* If you used db_visible before, just call db_input now, and check to see
if it returns a non-zero return code. If so, the question is not visible.
* If you use db_exist before, just call db_get instead, and check to see
if it returns a non-zero return code. If so, the question does not exist.
* If you supported the "backup" capability, db_go will return a non-zero
return code if the user hits the back button now. See the tutorial for
updated examples.
* Build with the new debhelper, if you use debhelper.
If you are using ConfModule.pm, here is a checklist to follow:
* Add a call to "version('2.0')" after you load the ConfModule module, and
remove any other version call you may have.
* ret() no longer returns "back" when a back button is hit. Instead, you
must call it in a list context, and check to see if the first elemnt of
the returned list == 30.
* visible() and exist() are deprecated, instead you should use input and
get; call them in list context, and check to see if the first returned
item of the list == 30.
* Build with the new debhelper, if you use debhelper.
--
see shy jo
debconf (0.2.0) unstable; urgency=low
.
* Now uses version 2.0 of the configuration management protocol.
- All commands in the protocol now return a numerical return code,
optionally followed by a space and a text return code.
* confmodule is a new shell library that handles this by making each
command it provides now return the numerical return code. They continue
to set $RET to the text return code. This means that you now have to
check the return codes of those commands, or the set -e script you are
running them in may exit if they return an error code.
* confmodule.sh is now deprecated, but remains for backwards compatability,
and has special compatability code in it.
* ConfModule.pm handles this by making each of its commands, when called
in list contect, return a list consiting of the numeric return code, and
the string return code. When called in scalar context, it behaves
in a backwards compatable way.
* Deprecated the VISIBLE command. Check to see if INPUT returns 30 instead.
* Deprecated the EXIST command. Check for return code 10 from commands that
try to use the question, instead.
* The GO command no longer returns "back"; instead, it returns 30.
* Documented all this.
* Hey, a state machine is the way to go if you want to support back buttons!
Converted the tutorial to reccommend this, and converted debconf's own
config script into a state machine.
Reply to: