Each installation method has three scripts:
dselect searches for methods in /usr/lib/dpkg/methods
and /usr/local/lib/dpkg/methods
.
.deb
files can be found, or the tape or
floppy device to install from. It should store the responses under
/var/lib/dpkg/methods
- see below. If no available
packages list is available it should perhaps offer to scan the
available packages.
The update script should obtain a list of available packages if
possible, and run dpkg --update-avail
, dpkg --merge-avail
and/or dpkg --forget-old-unavail
to load it into dpkg and
dselect's database of available packages. If no packages list
was available and the user was offered and accepted the option of
scanning the actual files available this scan should be done here,
using dpkg --record-avail
.
The install script should feed all the available .deb
files to
dpkg --iGOEB
(this is equivalent to dpkg --install
--refuse-downgrade --selected-only --skip-same-version
--auto-deconfigure
). The -R
(--recursive
) option for
traversing subdirectories may also be useful here).
If any of these scripts needs to display a message for the user, it should wait for the user to hit `return' before exiting so that dselect doesn't immediately rewrite the screen.
If a method script succeeds (returns a zero exit status) dselect will return immediately to the main menu, with the `next' option highlighted ready for the user to select it. If it fails dselect will display a message and wait for the user to hit return.
Each group of methods implemented by the same set of scripts should
have a subdirectory /usr/lib/dpkg/methods/
group or
/usr/local/lib/dpkg/methods/
group, containing:
names
setup
update
install
desc.
option
names
will be formatted as a list of lines, each containing:
sequence method summary
sequence is a two-digit number that will be used much like
rc.d
prefixes to control the order in the main menu. If in doubt
use 50.
method is a name which is displayed by dselect as the
name of the method, and which will be passed to setup
,
update
and unpack
as their first argument.
summary is the brief description string for dselect's menu.
Each of the three scripts gets the same three arguments: vardir,
group and method. vardir is the base directory for
storing dpkg and dselect's state, usually
/var/lib/dpkg
; this is passed in so that the --admindir
option to dselect is honoured).
Each option may have an extended description in
desc.
option. This should be formatted like the extended
description part of a
Description
field entry shifted one
character to the left.
vardir
/methods
will exist, and a method group may use a
vardir
/methods/
group directory to store its state.
The group name and method name must follow the rules for C identifiers.