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

Re: debconf-question-asking cgi script



On 2/8/07, Joey Hess <joeyh@debian.org> wrote:
Luke Kenneth Casson Leighton wrote:
> therefore, would you mind advising me: what command-line tools are there
> (no - i will not write in perl) to dump a debconf template for a
> particular item?
>
> i don't mind using debconf-get-selections but i really need the list
> of options/answers for e.g. a drop-down list and i need the descriptive
> text etc. etc.

debconf contains bindings to multiple languages (perl, python, shell) that
expose access to the database via the debconf protocol. The debconf protocol
can be used to get at all of that stuff if you really want to. Example in
shell (as I don't write python):


What?! You're kidding! 8-)

Hugo


#!/bin/sh
. /usr/share/debconf/confmodule
Q=debconf/priority
db_get $Q
echo "Value: $RET"
db_fget $Q seen
echo "Seen: $RET"
db_metaget $Q choices
echo "Choices: $RET"
db_metaget $Q description
echo "Description: $RET"
db_metaget $Q extended_description
echo "Extended Description: $RET"

root@kodama:/home/joey>./foo
Value: high
Seen: true
Choices: critical, high, medium, low
Description: Ignore questions with a priority less than:
Extended Description: Debconf prioritizes the questions it asks you. Pick the lowest priority of question you want to see:

--
see shy jo

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFFy4Pud8HHehbQuO8RAsj1AKDpd3H/r/iOLAaBpwtQrgg7yVBEHwCdGEmg
6zpyRcCi4qm5Lu6CwGartm0=
=+Npo
-----END PGP SIGNATURE-----





Reply to: