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

Re: re-asked papersize

Adrian Bunk wrote:
> But I'm wondering why this happens because the postinst of libpaperg
> contains the following to avoid exactly this problem:

The postinst is immatrial; the config script is what asks the question,
and it does it unconditionally.

Oddly, the config script has code in it that seems to check if the file
exists and skip asking the question, but it is commented out.

  * Fix debian/config to get dpkg-reconfigure working.

 -- Adrian Bunk <bunk@fs.tum.de>  Tue,  4 Dec 2001 10:41:42 +0100

Oh, I see. You commented that out so it would ask the question when
reconfigured. A better way to accomplish this is something like this:

if (open(CONFIG, '/etc/papersize')){
       set('libpaperg/defaultpaper', $_);
} else {
    my @PAPERS = `/usr/bin/paperconf -a`;
    chomp @PAPERS;
    my $TEMPLATE = 'libpaperg/defaultpaper';
    subst($TEMPLATE, 'choices', join(", ", @PAPERS));
input('medium', $TEMPLATE);

This way it will mark it seen if the user saw the question (years) before and
the file is there. But it will always ask the question. Debconf redisplays
questions even if they're marked as seen when it reconfigures.

see shy jo

Reply to: