#!/usr/bin/perl -w
#
# Author: Petter Reinholdtsen <pere@hungry.com>
# Date:   2002-04-26
#
# Output the current debconf database in a format understandable by
# debconf-load-defaults.
#
# The reimplementation using the Debconf modules is based on Progenys
# readdebconf from Debian package autoinstall.
#
# See also debconf-copydb in debconf-utils

use strict;
use warnings;
use Debconf::Db;
use Debconf::Template;
use Debconf::Question;

Debconf::Db->load;
my $qi = Debconf::Question->iterator;

while (my $q = $qi->iterate)
{
    my ($name, $type, $value) = ($q->name, $q->type, $q->value);

    $value = "[undef]" if (! defined $value || "" eq $value);

    print "$name $type $value\n";
}

exit 0;
