diff options
author | Joey Hess <joey@kodama.kitenet.net> | 2008-01-11 14:15:50 -0500 |
---|---|---|
committer | Joey Hess <joey@kodama.kitenet.net> | 2008-01-11 14:15:50 -0500 |
commit | e1975ed51b11061aeacd35886869ebbfc8d84683 (patch) | |
tree | 5644e47d5fd82666240e45824528d72bd9a1d07c /dh_installdocs | |
parent | fcc792210d4e089a41b1c14ccca9f0a8a7e0f2ec (diff) |
* dh_install{,docs,examples}: Avoid infinite recursion when told to
install a directory ending with "/." (slashdot effect?) when exclusion is
enabled. Emulate the behavior of cp in this case. Closes: #253234
* dh_install: Fix #459426 here too.
Diffstat (limited to 'dh_installdocs')
-rwxr-xr-x | dh_installdocs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/dh_installdocs b/dh_installdocs index e8e6e3bc..3707a136 100755 --- a/dh_installdocs +++ b/dh_installdocs @@ -8,7 +8,6 @@ dh_installdocs - install documentation into package build directories use strict; use Debian::Debhelper::Dh_Lib; -use Cwd q{abs_path}; =head1 SYNOPSIS @@ -134,11 +133,12 @@ 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(abs_path($doc)); + my $basename = basename($doc); + my $dir = ($basename eq '.') ? $doc : "$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 \\;"); + complex_doit("cd '$dir' && find '$basename' $exclude -exec cp --parents -dp {} $pwd/$tmp/usr/share/doc/$package \\;"); } else { doit("cp", "-a", $doc, "$tmp/usr/share/doc/$package"); |