]> git.donarmstrong.com Git - debhelper.git/blobdiff - dh_installdebconf
r1655: * Added udeb support, as pioneered by di-packages-build. Understands
[debhelper.git] / dh_installdebconf
index be6fcabfa582b9fe83157158b6b33ab0388b85ce..ebf6a13123090c0943bf5e24711fb327fba30c8d 100755 (executable)
@@ -28,6 +28,11 @@ installed into the DEBIAN directory in the package build directory.
 Note that if you use debconf, your package probably needs to depend on it
 (it will be added to ${misc:Depends} by this program).
 
+Note that for your config script to be called by dpkg, your postinst
+needs to source debconf's confmodule. dh_installdebconf does not
+install this statement into postinst automatically as it it too hard to
+do it right.
+
 =head1 LOCALIZED TEMPLATE FILES
 
 Debconf also supports localized template files, and this program has some
@@ -78,7 +83,7 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
                doit("install","-o",0,"-g",0,"-d","$tmp/DEBIAN");
        }
 
-       if ($config ne '') {
+       if (! is_udeb($package) && $config ne '') {
                doit("install", "-o", 0, "-g", 0, "-m", 755, "-p",
                     $config, "$tmp/DEBIAN/config");
        }
@@ -87,14 +92,14 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
                # Are there old-style translated templates?
                my @trans=(glob("$templates.??"), glob("$templates.??_??"));
 
+               umask(0022); # since I do a redirect below
+               
                # Look for po directory.
                if (-d "debian/po") {
                        if (@trans) {
                                warning "ignoring debian/templates.ll files in favour of debian/po directory";
                        }
-                       else {
-                               complex_doit("po2debconf @extraparams $templates > $tmp/DEBIAN/templates");
-                       }
+                       complex_doit("po2debconf @extraparams $templates > $tmp/DEBIAN/templates");
                }
                elsif (@trans) {
                        complex_doit("debconf-mergetemplate --drop-old-templates @extraparams @trans $templates > $tmp/DEBIAN/templates");
@@ -107,13 +112,14 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
                }
        }
 
+       # I'm going with debconf 0.5 because it was the first
+       # "modern" one.
+       my $debconfdep="debconf (>= 0.5) | debconf-2.0";
        if ($config ne '' || $templates ne '') {
-               # I'm going with debconf 0.5 because it was the first
-               # "modern" one.
-               addsubstvar($package, "misc:Depends", "debconf", ">= 0.5");
+               addsubstvar($package, "misc:Depends", $debconfdep);
        }
        else {
-               addsubstvar($package, "misc:Depends", "debconf", ">= 0.5", 1); # remove
+               addsubstvar($package, "misc:Depends", $debconfdep, undef, 1); # remove
        }
        
        if (($config ne '' || $templates ne '') && ! $dh{NOSCRIPTS}) {
@@ -123,7 +129,7 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
 
 =head1 SEE ALSO
 
-L<debhelper(1)>
+L<debhelper(7)>
 
 This program is a part of debhelper.