[Debconf-devel] Bug#534180: Cannot use variable in Default field for multiselect

David Paleino d.paleino at gmail.com
Mon Jun 22 10:10:58 UTC 2009


Package: debconf
Version: 1.5.26
Severity: important

Hello,
this is related to two wicd bugs: #532112 (which I can't reproduce anymore),
and #534138 .
I have this template:

--->8---
Template: wicd/users
Type: multiselect
Choices: ${users}
Default: ${default}
_Description: Users to add to the netdev group:
 Users who should be able to run wicd clients need to be added to the
 group "netdev".
---8<---

And was populating the vars with:

--->8---
db_metaget wicd/users users
db_subst wicd/users users "$(getent passwd | [..])"

db_metaget wicd/users default
db_subst wicd/users default "$(getent group netdev | [..])"

db_input high wicd/users || true
db_go
---8<---

(commands cut for wrapping purposes, both return a list in the form "one, two,
three")

And then act accordingly removing unchecked users, and adding checked ones.
The problem is that Default doesn't "work" when using a variable and db_subst.
Let me explain.

If I drop the wicd/users stanza from /var/cache/debconf/config.dat , and I
dpkg-reconfigure wicd, I have no users/choices checked, even if the "default"
variable is correctly initialized. This is what I get after the first run,
without checking anything:

--->8---
Name: wicd/users
Template: wicd/users
Value:
Owners: wicd
Flags: seen
Variables:
 default = neo, roberto
 users = bot, fede, neo, roberto, test
---8<---

This is *wrong*.
If I set "Default: neo, roberto" in the templates, the debconf multiselect has
the right choices.

Is it possible to set Default choices on-the-fly?

I hope I explained myself, sorry for the long report :)

David

-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.29-1-686 (SMP w/1 CPU core)
Locale: LANG=it_IT.UTF-8, LC_CTYPE=it_IT.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages debconf depends on:
ii  debconf-i18n                  1.5.26     full internationalization support 
ii  perl-base                     5.10.0-23  minimal Perl system

Versions of packages debconf recommends:
ii  apt-utils                     0.7.21     APT utility programs

Versions of packages debconf suggests:
ii  debconf-doc               1.5.26         debconf documentation
ii  debconf-utils             1.5.26         debconf utilities
ii  dialog                    1.1-20080819-1 Displays user-friendly dialog boxe
ii  gnome-utils               2.26.0-1       GNOME desktop utilities
ii  libgnome2-perl            1.042-2        Perl interface to the GNOME librar
pn  libnet-ldap-perl          <none>         (no description available)
pn  libqt-perl                <none>         (no description available)
pn  libterm-readline-gnu-perl <none>         (no description available)
ii  perl                      5.10.0-23      Larry Wall's Practical Extraction 
ii  whiptail                  0.52.10-4      Displays user-friendly dialog boxe

-- debconf information:
  debconf-apt-progress/title:
  debconf-apt-progress/info:
* debconf/priority: high
  debconf-apt-progress/preparing:
  debconf-apt-progress/media-change:
* debconf/frontend: Dialog

-- 
 . ''`.  Debian maintainer | http://wiki.debian.org/DavidPaleino
 : :'  : Linuxer #334216 --|-- http://www.hanskalabs.net/
 `. `'`  GPG: 1392B174 ----|---- http://snipr.com/qa_page
   `-   2BAB C625 4E66 E7B8 450A C3E1 E6AA 9017 1392 B174
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/debconf-devel/attachments/20090622/37b48939/attachment.pgp>


More information about the Debconf-devel mailing list