Debian Codegraph @

debconf-loadtemplate

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