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

Re: dpkg modification: non-interactivity



On Sat, Jan 09, 1999 at 01:40:56PM +0800, Mikolaj J. Habryn wrote:
>   A simple first cut would be to write a dpkg-option that does exactly
> what the different maintainer scripts are doing now (ie, read from
> stdin). Then write a few different ones to look prettier (eg, a
> graphical gtk based one, a pretty ncurses version, etc), stick them in 
> different directories, and have apt set the path appropriately.
> 

as far as i can see, if you can separate the act of asking the user and
the act of querying a value, then you're set.

ie: provide a chunk of text that explains what a setting is _separately_ to
the script that uses the value. the script calls a simple
"command --query unique_name --default 'yes'" or some such.
command would (if running interactively (env variable)), print the chunk of
text, ask the user, using the default given

if non-interactive, then just take the default.

it would be trivial to provide a simple override list of
package+unique_name -> default, and the users response could be kept here
to be the default for later questions


you also get a transparent way to implement different languages, simply
by having a fancier unique_name -> chunk of text mapping


an X interface (etc) could easily pick up the chunk of text and display it
in whatever way it wanted, without having to muck around with capturing
script outputs, etc.

it is easy (for the user or some other (eg: X) program) to reconfigure a
package - just edit the list of defaults and then rerun the packages
postinst non-interactively (although ideally, some system of configuration-
dependencies should exist between packages, so that when one is reconfigured,
it triggers other to be reconfigured too)


it does involve a (simple) change to all existing packages, but how drastic
this is depends on how loudly you complain about a package that doesn't use
it -- and look at what you get for it..

(my 2c, although i've been thinking about it for quite a while now -- i'll
whip up an example implementation if anyone wants one (its really very simple
to do))

-- 
 - Gus


Reply to: