]> git.donarmstrong.com Git - debhelper.git/blobdiff - dh_installdocs
* dh_installdocs/examples: Don't unnecessarily use the exclude code path.
[debhelper.git] / dh_installdocs
index e335df74d0b62d5b745db2ae2002c0022b8901be..e8e6e3bc0688db277e1f1a1baef44e9701542e05 100755 (executable)
@@ -8,6 +8,7 @@ dh_installdocs - install documentation into package build directories
 
 use strict;
 use Debian::Debhelper::Dh_Lib;
+use Cwd q{abs_path};
 
 =head1 SYNOPSIS
 
@@ -121,7 +122,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 +134,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 ($dir_basename) = basename(abs_path($doc));
+                               my $pwd=`pwd`;
+                               chomp $pwd;
+                               $exclude='\\( -type f -or -type l \\)'.$exclude;
+                               complex_doit("cd '$doc/..' && find '$dir_basename' $exclude -exec cp --parents -dp {} $pwd/$tmp/usr/share/doc/$package \\;");
                        }
                        else {
                                doit("cp", "-a", $doc, "$tmp/usr/share/doc/$package");