summaryrefslogtreecommitdiff
path: root/dh_installexamples
diff options
context:
space:
mode:
authorJoey Hess <joey@kodama.kitenet.net>2008-01-11 14:15:50 -0500
committerJoey Hess <joey@kodama.kitenet.net>2008-01-11 14:15:50 -0500
commite1975ed51b11061aeacd35886869ebbfc8d84683 (patch)
tree5644e47d5fd82666240e45824528d72bd9a1d07c /dh_installexamples
parentfcc792210d4e089a41b1c14ccca9f0a8a7e0f2ec (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_installexamples')
-rwxr-xr-xdh_installexamples6
1 files changed, 3 insertions, 3 deletions
diff --git a/dh_installexamples b/dh_installexamples
index 25661df..1e10e65 100755
--- a/dh_installexamples
+++ b/dh_installexamples
@@ -8,7 +8,6 @@ dh_installexamples - install example files into package build directories
use strict;
use Debian::Debhelper::Dh_Lib;
-use Cwd q{abs_path};
=head1 SYNOPSIS
@@ -87,11 +86,12 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
foreach my $example (@examples) {
next if excludefile($example);
if (-d $example && $exclude) {
- my ($dir_basename) = basename(abs_path($example));
+ my $basename = basename($example);
+ my $dir = ($basename eq '.') ? $example : "$example/..";
my $pwd=`pwd`;
chomp $pwd;
$exclude = '-type f'.$exclude;
- complex_doit("cd '$example/..' && find '$dir_basename' $exclude -exec cp --parents -dp {} $pwd/$tmp/usr/share/doc/$package/examples \\;");
+ complex_doit("cd '$dir' && find '$basename' $exclude -exec cp --parents -dp {} $pwd/$tmp/usr/share/doc/$package/examples \\;");
}
else {
doit("cp", "-a", $example, "$tmp/usr/share/doc/$package/examples");