| 1 |
#!/usr/bin/perl -w
|
| 2 |
|
| 3 |
=head1 NAME
|
| 4 |
|
| 5 |
debconf-loadtemplate - load template file into debconf database
|
| 6 |
|
| 7 |
=cut
|
| 8 |
|
| 9 |
use strict;
|
| 10 |
use Debconf::Db;
|
| 11 |
use Debconf::Template;
|
| 12 |
|
| 13 |
=head1 SYNOPSIS
|
| 14 |
|
| 15 |
debconf-loadtemplate owner file [file ..]
|
| 16 |
|
| 17 |
=head1 DESCRIPTION
|
| 18 |
|
| 19 |
Loads one or more template files into the debconf database. The first
|
| 20 |
parameter specifies the owner of the templates (typically, the owner is the
|
| 21 |
name of a debian package). The remaining parameters are template files to
|
| 22 |
load.
|
| 23 |
|
| 24 |
=head1 WARNING
|
| 25 |
|
| 26 |
This program should never be used from a maintainer script of a package
|
| 27 |
that uses debconf! It may however, be useful in debugging, or to seed the
|
| 28 |
debconf database.
|
| 29 |
|
| 30 |
=head1 SEE ALSO
|
| 31 |
|
| 32 |
L<debconf-communicate(1)>
|
| 33 |
|
| 34 |
=cut
|
| 35 |
|
| 36 |
sub usage {
|
| 37 |
die "Usage: $0 owner file\n";
|
| 38 |
}
|
| 39 |
|
| 40 |
my $owner=shift || usage();
|
| 41 |
usage() unless @ARGV;
|
| 42 |
|
| 43 |
Debconf::Db->load;
|
| 44 |
Debconf::Template->load($_, $owner) foreach @ARGV;
|
| 45 |
Debconf::Db->save;
|
| 46 |
|
| 47 |
=head1 AUTHOR
|
| 48 |
|
| 49 |
Joey Hess <joeyh@debian.org>
|
| 50 |
|
| 51 |
=cut
|