summaryrefslogtreecommitdiff
path: root/dh_install
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_install
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_install')
-rwxr-xr-xdh_install9
1 files changed, 4 insertions, 5 deletions
diff --git a/dh_install b/dh_install
index 47c00db2..eda38962 100755
--- a/dh_install
+++ b/dh_install
@@ -9,7 +9,6 @@ dh_install - install files into package build directories
use strict;
use File::Find;
use Debian::Debhelper::Dh_Lib;
-use Cwd q{abs_path};
=head1 SYNOPSIS
@@ -176,14 +175,14 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
}
if (-d $src && $exclude) {
- my ($dir_basename) = basename(abs_path($src));
- # Pity there's no cp --exclude ..
+ my $basename = basename($src);
+ my $dir = ($basename eq '.') ? $src : "$src/..";
my $pwd=`pwd`;
chomp $pwd;
- complex_doit("cd $src/.. && find $dir_basename $exclude \\( -type f -or -type l \\) -exec cp --parents -dp {} $pwd/$tmp/$dest/ \\;");
+ complex_doit("cd '$dir' && find '$basename' $exclude \\( -type f -or -type l \\) -exec cp --parents -dp {} $pwd/$tmp/$dest/ \\;");
# cp is annoying so I need a separate pass
# just for empty directories
- complex_doit("cd $src/.. && find $dir_basename $exclude \\( -type d -and -empty \\) -exec cp --parents -a {} $pwd/$tmp/$dest/ \\;");
+ complex_doit("cd '$dir' && find '$basename' $exclude \\( -type d -and -empty \\) -exec cp --parents -a {} $pwd/$tmp/$dest/ \\;");
}
else {
doit("cp", "-a", $src, "$tmp/$dest/");