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

Noninteractive Proposal



I haven't been completely following the discussion since it moved off debian
private, and just subscribed to this list a few minutes ago, so bear with me
if I propose something that's already been proposed or ruled out as
impractical.

What I propose:

A scheme for configuring packages to be installed all at one time, either
before or after installation, with configuration questions answered
manually or automatically from a stored template.

How I think it might be implemented: 

If a package is capable of what I'm calling "interact before/after"
installation, an additional file in control.tar.gz called options would be
present. When run, it would produce a list of option names, their
descriptions, reasonable defaults, and possible values on standard output.
The list of possible values could indicate that the configuration option is
a yes/no question, or that text matching a certain regular expression is
required, is numeric, a list to choose from (eth0, eth1, etc.) or is perhaps
some other data type.

When it's time for the user to configure the packages, the package manager
frontend would run this file and present its output to the user in a manner
appropriate for their display. For example, yes/no questions and prompts for
text on a dumb terminal, a dialog box with check boxes and text fields on an
X terminal. Any options the user sets would be placed into environment
variables of the same name (perhaps OPTION_IFACE=eth0, or whatever.) Perhaps
the options script could be called with these environment variables set and
report an error if conflicting options are enabled or some other error state
has occured. The values used could be saved somewhere, (perhaps as a shell
script) and could be fed into subsequent installations on other machines so
that the questions do not have to be answered again.

When the package manager frontend goes to run the package's preinst,
postinst, etc. files, it would set the environment variable NON_INTERACTIVE.
It would also set the options up in environment variables. The
preinst/postinst script would be able to look at these variables instead of
prompting the user if they are set. Otherwise, it could default to the old
way of asking questions to prevent the package from breaking when installed
with tools that don't support the noninteractive functionality.

If there's interest, perhaps I'll work up a mock version of a package like
dhcpcd or something so people can get a better idea. I belive this sort of
thing can be done without any changes to dpkg, and without making the new
packages incompatible with existing package managers. 

-- 
Brian Ristuccia
brianr@osiris.978.org
bristucc@baynetworks.com
bristucc@cs.uml.edu


Reply to: