Datasheet

75
Chapter 4 Software Management
Maintaining package relationships is a large part of a Debian maintainer’s job
because these relatively simple concepts make software management easy and
painless for the user. However, choosing which relationships to declare with which
packages is something of an art.
Maintainer scripts
Debian packages have maintainer scripts, which are scripts the package maintainer
writes to help ease the installation, removal, or upgrade of his packages by the user.
There isn’t a single installation script. Rather, there are five scripts that the main-
tainer can use, although not every package uses every script: the pre-installation
script, the post-installation script, the pre-removal script, the post-removal script,
and the
debconf script. These scripts are all run automatically during different por-
tions of package management operations.
The names should be self-explanatory, except for perhaps the
debconf script.
During the installation of your Debian system, you were asked a number of ques-
tions. These were done using Debian’s configuration framework, the self-titled
debconf. debconf scripts primarily serve to collect information from the user to
provide a sensible default configuration for a package. However,
debconf scripts
are also occasionally used to print messages and warnings to the user.
Each of the maintainer scripts is provided with a great deal of information about
the user’s system before they’re run, including whether the package is being
upgraded, what version of the package was last installed, any errors that might
have occurred, and so on.
Configuration files
In addition to the regular files that make up the software, the declarations of pack-
age relationships, and the maintainer scripts that ease installation and upgrades, a
major component of a Debian package is its configuration files. Unlike regular files,
which overwrite old versions or preexisting versions without any prompting on the
part of the user, configuration files are treated specially. A large part of Debian’s
appeal to system administrators is the care taken to preserve any changes made to
a configuration file.
Preserving changes made to a configuration file isn’t easy. There are many different
configuration file formats, and sometimes a single configuration file will have multi-
ple formats depending on which version of the package you have installed. As
such, there are two standard methods of dealing with configuration files in a Debian
package:
dpkg’s conffile handling and a debconf-based handler called ucf (which
stands for “update configuration file”).
Dealing with configuration files is presented in detail in the “Installing Packages”
section of this chapter.
Cross-
Reference
09_576445 ch04.qxd 7/5/05 3:10 PM Page 75