]> git.donarmstrong.com Git - debhelper.git/blob - dh_installdebconf
r424: typo
[debhelper.git] / dh_installdebconf
1 #!/usr/bin/perl -w
2 #
3 # Integration with debconf.
4
5 use strict;
6 use Debian::Debhelper::Dh_Lib;
7 init();
8
9 foreach my $package (@{$dh{DOPACKAGES}}) {
10         my $tmp=tmpdir($package);
11         my $config=pkgfile($package,"config");
12         my $templates=pkgfile($package,"templates");
13
14         if (! -d "$tmp/DEBIAN") {
15                 doit("install","-o",0,"-g",0,"-d","$tmp/DEBIAN");
16         }
17
18         if ($config ne '') {
19                 doit("install", "-o", 0, "-g", 0, "-m", 755, "-p",
20                      $config, "$tmp/DEBIAN/config");
21         }
22         
23         if ($templates ne '') {
24                 # Are there translated templates too?
25 <<<<<<< dh_installdebconf
26                 my @trans=glob("$templates.??", "$templates.??_??");
27 =======
28                 my @trans=(glob("$templates.??"), glob("$templates.??_??"));
29 >>>>>>> 1.5
30                 if (@trans) {
31                         complex_doit("debconf-mergetemplate @trans $templates > $tmp/DEBIAN/templates");
32                         chmod 0644, "$tmp/DEBIAN/templates";
33                         chown 0, 0, "$tmp/DEBIAN/templates";
34                 }
35                 else {
36                         doit("install", "-o", 0, "-g", 0, "-m", 644, "-p",
37                              $templates, "$tmp/DEBIAN/templates");
38                 }
39         }
40
41         if (($config ne ''|| $templates ne '') && ! $dh{NOSCRIPTS}) {
42                 autoscript($package,"postrm","postrm-debconf");
43         }
44 }