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 | |
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.
-rw-r--r-- | debian/changelog | 11 | ||||
-rwxr-xr-x | dh_install | 9 | ||||
-rwxr-xr-x | dh_installdocs | 6 | ||||
-rwxr-xr-x | dh_installexamples | 6 |
4 files changed, 16 insertions, 16 deletions
diff --git a/debian/changelog b/debian/changelog index 43bfefc6..b84fe5d5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,11 +1,12 @@ -debhelper (6.0.1) UNRELEASED; urgency=low +debhelper (6.0.1) unstable; urgency=low * dh_installdocs/examples: Don't unnecessarily use the exclude code path. - * Avoid infiinite recursion when told to install a directory ending with - "/." (slashdot effect?). Indeed, arbitrarily complex paths can be used - now, although there's really no point in using them. Closes: #253234 + * 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. - -- Joey Hess <joeyh@debian.org> Fri, 11 Jan 2008 13:38:10 -0500 + -- Joey Hess <joeyh@debian.org> Fri, 11 Jan 2008 13:48:13 -0500 debhelper (6.0.0) unstable; urgency=low @@ -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/"); 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"); diff --git a/dh_installexamples b/dh_installexamples index 25661dfe..1e10e65b 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"); |