#324625 debconf-get-selections: option to only display questions differing from defaults

#324625#5
Date:
2005-08-23 03:46:16 UTC
From:
To:
to generate a debconf-preseeding file, it would be easier if there was
an option for debconf-get-selections to only grab questions that differ
from the default values.

another less ideal option that could approximate this would be to only
display questions marked as "seen".

live well,
  vagrant

#324625#10
Date:
2005-08-23 15:42:45 UTC
From:
To:
Vagrant Cascadian wrote:

The only difference being that it's possible for a question to be seen
and still have the default value. So is there any real reason you need
the former, or would just using grep be enough for the latter?

#324625#15
Date:
2005-08-24 22:17:05 UTC
From:
To:
it is also possible to change the default without marking it as seen...

how can you grep debconf-get-selections output for questions that are
marked seen?

the only fields i see are:

owner question type value


my goal is to have the smallest possible set of changes in a debconf
pre-seed to replicate the configuration, in case defaults of other
packages change.  maybe other tools would be more appropriate.
suggestions would be appreciated.

thanks for debconf!

live well,
  vagrant

#324625#20
Date:
2006-11-15 16:33:58 UTC
From:
To:
Hi,

I'd like to see this feature too.
Are the defaults available somewhere?
And why are owner and type needed in the preseed file?

#324625#25
Date:
2007-07-09 19:27:19 UTC
From:
To:
With version 1.4.48 debconf-set-selections introduced ability to set
seen flag using line:

owner\tvariable_name\tseen\tvalue

Howewer as I can see debconf-get-selections doesn't generate such output
until now (version 1.5.13). It's not too difficult to make patch like
this one:
=====
--- debconf-get-selections Tue Mar 6 21:46:16 2007 +++ debconf-get-selections-new Mon Jul 9 22:56:06 2007 @@ -60,15 +60,18 @@ print "# ".$q->description."\n"; if ($q->type eq 'select' || $q->type eq 'multiselect') { print "# Choices: ".join(", ", $q->choices)."\n"; - } + }; + my $owner = $defaultowner; if ($q->owners) { - foreach my $owner (split ", ", $q->owners) { + foreach $owner (split ", ", $q->owners) { print "$owner\t$name\t$type\t$value\n"; - } + }; + $owner = (split ", ",$q->owners)[-1]; } else { print "$defaultowner\t$name\t$type\t$value\n"; - } + }; + print "$owner\t$name\tseen\t" . $q->flag("seen") . "\n"; } =head1 AUTHOR ===== It's also easy to remove added lines with grep -v \ '^[^[:space:]]*[[:space:]][^[:space:]]*[[:space:]]seen[[:space:]].*$' or something like. Patched version is 1.5.13, but, unfortunately I have only 'sarge' there and tested against it, not 'etch' or 'sid' (I tested only output of program, not in conjunction with debconf-set-selections there, but with other system at my home I tested similar patch together with test debconf database). WBR Dmitri Ivanov