]> git.donarmstrong.com Git - debhelper.git/blobdiff - dh_installdebconf
r412: * Bah, reverted that last change. It isn't useful because
[debhelper.git] / dh_installdebconf
index 489db99a49a34f4646c3a62a73afbcc677b62f13..ccf3074aaef3df5ab052649bdccbb08f3e93d48c 100755 (executable)
@@ -2,8 +2,7 @@
 #
 # Integration with debconf.
 
-BEGIN { push @INC, "debian", "/usr/share/debhelper" }
-use Dh_Lib;
+use Debian::Debhelper::Dh_Lib;
 init();
 
 foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
@@ -12,17 +11,26 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
        $templates=pkgfile($PACKAGE,"templates");
 
        if (! -d "$TMP/DEBIAN") {
-               doit("install","-o","root","-g","root","-d","$TMP/DEBIAN");
+               doit("install","-o",0,"-g",0,"-d","$TMP/DEBIAN");
        }
 
        if ($config ne '') {
-               doit("install", "-o", "root", "-g", "root", "-m", 755, "-p",
+               doit("install", "-o", 0, "-g", 0, "-m", 755, "-p",
                     $config, "$TMP/DEBIAN/config");
        }
        
        if ($templates ne '') {
-               doit("install", "-o", "root", "-g", "root", "-m", 644, "-p",
-                    $templates, "$TMP/DEBIAN/templates");
+               # Are there translated templates too?
+               my @trans=glob("$templates.??");
+               if (@trans) {
+                       complex_doit("debconf-mergetemplate @trans $templates > $TMP/DEBIAN/templates");
+                       chmod 0644, "$TMP/DEBIAN/templates";
+                       chown 0, 0, "$TMP/DEBIAN/templates";
+               }
+               else {
+                       doit("install", "-o", 0, "-g", 0, "-m", 644, "-p",
+                            $templates, "$TMP/DEBIAN/templates");
+               }
        }
 
        if (($config ne ''|| $templates ne '') && ! $dh{NOSCRIPTS}) {