[Debconf-devel] Help on using Debconf from a Ruby program

Francesco Poli invernomuto at paranoici.org
Sun Apr 22 19:34:40 UTC 2012


Hello Debconf Developers,
I am one of the two co-maintainers of apt-listbugs.

[I am *not* subscribed to the debconf-devel list, hence,
please Cc: me on replies. Thanks!]

I am trying to see whether I can solve an issue by only modifying
apt-listbugs [1], if possible at all.
I asked for help on the debian-ruby list [2] and it has been suggested
[3] that, maybe, interacting with the user through Debconf could work
around the issue.

[1] bug #662983
[2] https://lists.debian.org/debian-ruby/2012/03/msg00016.html
[3] https://lists.debian.org/debian-ruby/2012/03/msg00018.html

The problem is: I am rather ignorant about Debconf and I don't know how
I could ask questions and output data through Debconf from within a
program written in Ruby (and still be able to read other data from
stdin before beginning to ask questions to the user).

I have searched for something (a library?) to use Debconf from Ruby, but
I have found nothing.
I searched for information on Debconf documentation [4][5][6], but I
failed to find relevant hints.

[4] http://www.debian.org/doc/packaging-manuals/debconf_specification.html
[5] debconf(7) man page
[6] debconf-devel(7) man page


Also, I tried to look at the tuturial example [7], in the (miserably
failed) attempt to translate it into Ruby.

[7] /usr/share/doc/debconf-doc/examples/tutorial

May I run it as a regular (non-root) user?
I get the following error:

debconf: DbDriver "passwords" warning: could not open /var/cache/debconf/passwords.dat: Permission denied
debconf: DbDriver "config": could not write /var/cache/debconf/config.dat-new: Permission denied

If I

  $ export DEBCONF_DB_REPLACE=File{/tmp/tutorial.dat}

I get the following warning

debconf: DbDriver "passwords" warning: could not open /var/cache/debconf/passwords.dat: Permission denied

and ./tutorial exits with 0 status, but nothing seems to happen, apart
from the creation of a value-less

  $ cat /tmp/tutorial.dat
  Name: foo/like_debian
  Template: foo/like_debian
  Value: 
  Owners: unknown

  Name: foo/why_debian_is_great
  Template: foo/why_debian_is_great
  Owners: unknown


Could someone please help me?
Thanks for your time (and for developing a great tool that I really
enjoy when configuring packages!).


-- 
 http://www.inventati.org/frx/frx-gpg-key-transition-2010.txt
 New GnuPG key, see the transition document!
..................................................... Francesco Poli .
 GnuPG key fpr == CA01 1147 9CD2 EFDF FB82  3925 3E1C 27E1 1F69 BFFE
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/debconf-devel/attachments/20120422/1da2abfb/attachment.pgp>


More information about the Debconf-devel mailing list