Package: debconf-doc Version: 1.5.27 Severity: wishlist It took me a while to get the suggestion to debug with debconf(1) right. Hopefully, the following will help others:
--- debconf-devel.7 2009-08-22 01:53:08.000000000 +0100 +++ debconf-devel.7.new 2009-08-22 03:12:22.000000000 +0100 @@ -620,12 +620,141 @@ user, pointing at a personal config.dat and template.dat for the user, you can load up templates and run config scripts all you like, without any root access. If you want to start over with a clean database, just blow away the -*.dat files. +*.dat files. You might also want to rename config.dat-old to config.dat. .P For details about setting this up, see .BR debconf.conf (5) , and note that /etc/debconf.conf makes a good template for a personal -~/.debconfrc file. +~/.debconfrc file. An example while trying to debug the portmap +configuration is as follows: +.P +.in +4n +.nf +# Creates the debconfrc +$ sed -ne '/Config: configdb/,/templates.dat/p' \\ +.fi +.in +.in +8n +.nf +/etc/debconf.conf > /home/user/.debconfrc +.fi +.in +.in +4n +.nf +$ sed -ne '/Config: configdb/,/templates.dat/p' \\ +.fi +.in +.in +8n +.nf +/etc/debconf.conf > /home/user/.debconfrc +.fi +.in +.in +4n +.nf +$ sed -ie 's:/var/cache/debconf/:/home/user/portmap/:' \\ +.fi +.in +.in +8n +.nf +/home/user/.debconfrc +.fi +.in +.P +.in +4n +.nf +# Creating a dedicated directory is not necessary. +$ mkdir portmap +$ cd portmap +.fi +.in +.P +.in +4n +.nf +# Copying the default file serves to emphasize path +# issues. +$ cp /etc/default/portmap default +.fi +.in +.P +.in +4n +.nf +$ cp {/var/lib/dpkg/info/portmap.,}postinst +.fi +.in +.P +.in +4n +.nf +# It is important to set the paths in a way that +# debconf sees the files. +$ sed -i '/^CONFFILE=/s:.*:CONFFILE=/home/user/portmap/default:' \\ +.fi +.in +.in +8n +.nf +postinst +.fi +.in +.P +.in +4n +.nf +$ cp {/var/lib/dpkg/info/portmap.,}templates +.fi +.in +.P +.in +4n +.nf +$ debconf-loadtemplate portmap templates +# Note that some *.dat get created, but not config.dat-old. +.fi +.in +.P +.in +4n +.nf +$ cp {/var/lib/dpkg/info/portmap.,}config +.fi +.in +.P +.in +4n +.nf +# It is important to set the paths in a way that debconf +# see the files. +$ sed -i '/^CONFFILE=/s:.*:CONFFILE=/home/user/portmap/default:' \\ +.fi +.in +.in +8n +.nf +config +.fi +.in +.P +.in +4n +.nf +$ debconf -freadline -pmedium /home/user/portmap/config \\ +.fi +.in +.in +8n +.nf +configure 6.0-10 +.fi +.in +.P +.in +12n +.nf + . . . User get prompted +.fi +.in +.P +.in +4n +.nf +$ debconf -freadline -pmedium /home/user/portmap/postinst \\ +.fi +.in +.in +8n +.nf +configure 6.0-10 +.fi +.in +.P .RE .SH "ADVANCED PROGRAMMING WITH DEBCONF" .SS "Config file handling" -- sobtw...@sdf.lonestar.org SDF Public Access UNIX System - http://sdf.lonestar.org -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org