]> git.donarmstrong.com Git - debhelper.git/commitdiff
* dh_installdocs/examples: Don't unnecessarily use the exclude code path.
authorJoey Hess <joey@kodama.kitenet.net>
Fri, 11 Jan 2008 18:48:10 +0000 (13:48 -0500)
committerJoey Hess <joey@kodama.kitenet.net>
Fri, 11 Jan 2008 18:48:10 +0000 (13:48 -0500)
* 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

debian/changelog
dh_install
dh_installdocs
dh_installexamples

index 4df4ad376188f969670771a8ee51f55e929d8f1d..43bfefc60e28c35d08ebf9a7627704bc287ccd27 100644 (file)
@@ -1,3 +1,12 @@
+debhelper (6.0.1) UNRELEASED; 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
+
+ -- Joey Hess <joeyh@debian.org>  Fri, 11 Jan 2008 13:38:10 -0500
+
 debhelper (6.0.0) unstable; urgency=low
 
   * dh_gencontrol: Stop passing -isp, it's the default now. Closes: #458114
index 624c88b01788dacafb64011417382cce86fc4666..47c00db2c1a09e3eafe62bc137945d4711dc8fdf 100755 (executable)
@@ -9,6 +9,7 @@ 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
 
@@ -175,7 +176,7 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
                        }
                        
                        if (-d $src && $exclude) {
-                               my ($dir_basename) = basename($src);
+                               my ($dir_basename) = basename(abs_path($src));
                                # Pity there's no cp --exclude ..
                                my $pwd=`pwd`;
                                chomp $pwd;
index e335df74d0b62d5b745db2ae2002c0022b8901be..e8e6e3bc0688db277e1f1a1baef44e9701542e05 100755 (executable)
@@ -8,6 +8,7 @@ dh_installdocs - install documentation into package build directories
 
 use strict;
 use Debian::Debhelper::Dh_Lib;
+use Cwd q{abs_path};
 
 =head1 SYNOPSIS
 
@@ -121,7 +122,7 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
        }
 
        if (@docs) {
-               my $exclude = '\\( -type f -or -type l \\)';
+               my $exclude = '';
                if ($dh{EXCLUDE_FIND}) {
                        $exclude .= ' -and ! \( '.$dh{EXCLUDE_FIND}.' \)';
                }
@@ -133,10 +134,11 @@ 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($doc);
-                           my $pwd=`pwd`;
-                           chomp $pwd;
-                           complex_doit("cd '$doc/..' && find '$dir_basename' $exclude -exec cp --parents -dp {} $pwd/$tmp/usr/share/doc/$package \\;");
+                               my ($dir_basename) = basename(abs_path($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 \\;");
                        }
                        else {
                                doit("cp", "-a", $doc, "$tmp/usr/share/doc/$package");
index 4e0bace0d66d7a60c48ed540b1e687d35c8db40b..25661dfe38a33c509fda55a7f0d59616c1e2d385 100755 (executable)
@@ -8,6 +8,7 @@ dh_installexamples - install example files into package build directories
 
 use strict;
 use Debian::Debhelper::Dh_Lib;
+use Cwd q{abs_path};
 
 =head1 SYNOPSIS
 
@@ -78,7 +79,7 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
                        doit("install","-d","$tmp/usr/share/doc/$package/examples");
                }
                
-               my $exclude = '-type f';
+               my $exclude = '';
                if ($dh{EXCLUDE_FIND}) {
                        $exclude .= ' -and ! \( '.$dh{EXCLUDE_FIND}.' \)';
                }
@@ -86,9 +87,10 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
                foreach my $example (@examples) {
                        next if excludefile($example);
                        if (-d $example && $exclude) {
-                               my ($dir_basename) = basename($example);
+                               my ($dir_basename) = basename(abs_path($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 \\;");
                        }
                        else {