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

Re: Proposal: Automatic query servicing for dpkg installation scripts



(Crosspost to debian-devel removed.)

Raul Miller writes ("Re: Proposal: Automatic query servicing for dpkg installation scripts"):
> Ian Jackson <ian@chiark.greenend.org.uk> wrote:
> > 2. Only a particular package can determine which questions need to be
> > asked in what order; in particular, following questions can depend on
> > the previous ones.  This means that we can't specify the questions in
> > advance in a file.  Instead, we have to put the information in
> > command-line arguments to the query program.
> 
> But a package should be able to grandfather responses from previous
> package instances.  We have plenty of instances where new package
> names are needed for what is essentially the same package.  [Not
> that it's always appropriate to grandfather responses...]

Yes.  The way I see this working is to have the questions have names
that are in principle independent from package names.  So you might
have the question `mail-transfer-agent.visible-domain' for the `what
is this machine's visible mail domain'; all packages that needed to
know the answer to this could ask it with:

  dquestion-query --qname mail-transfer-agent.visible-domain \
                  --qtext "What is this machine's visible mail domain ?" \
                  --do-query:usually --default "`hostname -f`" \
                  --nocase --accept '[0-9a-z][-0-9a-z]*(,[0-9a-z][-0-9a-z]*)*'

Perhaps the question string itself would be stored in a file somewhere
else (to help with i18n).

The program would compare the --use-default with an environment
variable, so that for example if DQUESTION_ALLOW_QUERY were set to
`always' or `usually', then it would prompt, but not for `rarely' or
`never'.  If --do-query:always is set and
DQUESTION_ALLOW_QUERY=disable then it fails.  (Better names for these
variables and options and stuff are probably required.)

If there was a value in the database it would use that (perhaps there
would have to be a DQUESTION_ALLOW_REQUERY to allow you to reconfigure
a package later, and that would use the current value as default).

The database would be indexed by the qname, which would usually start
with a package name, but wouldn't have to change if the package did.

Ian.


--
To UNSUBSCRIBE, email to debian-policy-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org


Reply to: