]> git.donarmstrong.com Git - debhelper.git/commitdiff
* dh_install{,docs,examples}: Avoid infinite recursion when told to
authorJoey Hess <joey@kodama.kitenet.net>
Fri, 11 Jan 2008 19:15:50 +0000 (14:15 -0500)
committerJoey Hess <joey@kodama.kitenet.net>
Fri, 11 Jan 2008 19:15:50 +0000 (14:15 -0500)
  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.

debian/changelog
dh_install
dh_installdocs
dh_installexamples

index 43bfefc60e28c35d08ebf9a7627704bc287ccd27..b84fe5d55de402f4ff864f231c3c6fb24ee9bec9 100644 (file)
@@ -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
 
index 47c00db2c1a09e3eafe62bc137945d4711dc8fdf..eda38962b774374edfbc7ac92c5b1e40511e3e96 100755 (executable)
@@ -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/");
index e8e6e3bc0688db277e1f1a1baef44e9701542e05..3707a1366830263862c66293b4cc02bbae4685dd 100755 (executable)
@@ -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");
index 25661dfe38a33c509fda55a7f0d59616c1e2d385..1e10e65b3af915d96a83db4886b871438ebf7924 100755 (executable)
@@ -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");