]> git.donarmstrong.com Git - debhelper.git/blobdiff - dh_installdocs
use mv -f for robustness
[debhelper.git] / dh_installdocs
index e335df74d0b62d5b745db2ae2002c0022b8901be..35672369f319c8c6c37d8fe45351e5187f57ca2c 100755 (executable)
@@ -121,7 +121,7 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
        }
 
        if (@docs) {
-               my $exclude = '\\( -type f -or -type l \\)';
+               my $exclude = '';
                if ($dh{EXCLUDE_FIND}) {
                        $exclude .= ' -and ! \( '.$dh{EXCLUDE_FIND}.' \)';
                }
@@ -133,10 +133,11 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
                        next if excludefile($doc);
                        next if -e $doc && ! -s $doc && ! compat(4); # ignore empty files
                        if (-d $doc && length $exclude) {
-                           my ($dir_basename) = basename($doc);
-                           my $pwd=`pwd`;
-                           chomp $pwd;
-                           complex_doit("cd '$doc/..' && find '$dir_basename' $exclude -exec cp --parents -dp {} $pwd/$tmp/usr/share/doc/$package \\;");
+                               my $basename = basename($doc);
+                               my $dir = ($basename eq '.') ? $doc : "$doc/..";
+                               my $pwd=`pwd`;
+                               chomp $pwd;
+                               complex_doit("cd '$dir' && find '$basename' \\( -type f -or -type l \\)$exclude -exec cp --parents -dp {} $pwd/$tmp/usr/share/doc/$package \\;");
                        }
                        else {
                                doit("cp", "-a", $doc, "$tmp/usr/share/doc/$package");