[debhelper-devel] [debhelper] 01/01: Re-instate bug compatibility to fix #867866

Niels Thykier nthykier at moszumanska.debian.org
Wed Jul 12 20:42:22 UTC 2017


This is an automated email from the git hooks/post-receive script.

nthykier pushed a commit to branch master
in repository debhelper.

commit d00d7d524f874c602e51ec2c42d85881c4bb7c7d
Author: Niels Thykier <niels at thykier.net>
Date:   Wed Jul 12 20:37:00 2017 +0000

    Re-instate bug compatibility to fix #867866
    
    Previous versions of debhelper had "interesting" way of interpreting
    arguments where it split them on space.  This was mistakenly
    "corrected" in 10.6 when debhelper started to use bsd_glob (that does
    not split on spaces).
    
    To resolve this, manully split arguments like the original code would
    (effectively) have done so packages are unaffected by it.
    
    Signed-off-by: Niels Thykier <niels at thykier.net>
---
 debian/changelog   |  7 +++++++
 dh_install         | 23 +++++++++++++++++++----
 dh_installdocs     |  3 ++-
 dh_installexamples |  3 ++-
 dh_installinfo     |  3 ++-
 dh_installman      |  3 ++-
 6 files changed, 34 insertions(+), 8 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 1ba1c74..96de3c5 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -14,6 +14,13 @@ debhelper (10.6.4) UNRELEASED; urgency=medium
   * dh_compress: Apply patch from Sven Joachim to make dh_compress
     gracefully handle hardlinks, where the target files already
     exists.  (Closes: #867881)
+  * dh_install: Re-instate bug compatibility with debhelper (<< 10.6)
+    where (some) path arguments where split on space as if it had
+    been parsed in the config file.  (Closes: #867866)
+  * dh_installdocs: Ditto.
+  * dh_installexamples: Ditto.
+  * dh_installinfo: Ditto.
+  * dh_installman: Ditto.
 
  -- Niels Thykier <niels at thykier.net>  Sun, 09 Jul 2017 12:30:20 +0000
 
diff --git a/dh_install b/dh_install
index 7422c45..60ac42c 100755
--- a/dh_install
+++ b/dh_install
@@ -174,13 +174,29 @@ foreach my $package (getpackages()) {
 	if ($file) {
 		@install=filedoublearray($file); # no globbing here; done below
 	}
+
+
+	# With autodest, we can just pretend every pattern was on its own line
+	@install = map { [$_] } map { @$_ } @install if $dh{AUTODEST};
 	
 	if (($package eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) {
-		push @install, [@ARGV];
+		if ($dh{AUTODEST}) {
+			# Same as above, with autodest, we can just isolate each entry
+			# - the split is for bug-backwards compatibility (#867866).
+			push(@install, map { [$_] } map { split } @ARGV);
+		} else {
+			# Bug backwards compatibility (#867866).  The new "glob_expand"
+			# interface is smart enough to not split on spaces, but dh_install
+			# used to do that... *except* for the "DEST" since it was never
+			# passed to the glob function.
+			my @a = @ARGV;
+			my $dest = pop(@a) if @a > 1;
+			my @srcs = map { split } @a;
+			push(@srcs, $dest) if defined($dest);
+			push(@install, \@srcs);
+		}
 	}
 
-	# With autodest, we can just pretend every pattern was on its own line
-	@install = map { [$_] } map { @$_ } @install if $dh{AUTODEST};
 
 	my $glob_error_handler = sub {
 		# Do not require a match for packages that not acted on
@@ -197,7 +213,6 @@ foreach my $package (getpackages()) {
 		if (@$set > 1) {
 			$dest=pop @$set;
 		}
-
 		foreach my $glob (@$set) {
 			my @found = glob_expand(\@search_dirs, $glob_error_handler, $glob);
 			push(@filelist, map { tr{/}{/}s; $_ } @found);
diff --git a/dh_installdocs b/dh_installdocs
index bb2616c..7b81e00 100755
--- a/dh_installdocs
+++ b/dh_installdocs
@@ -235,7 +235,8 @@ foreach my $package (getpackages()) {
 	}
 
 	if (($package eq $dh{FIRSTPACKAGE} || ($dh{PARAMS_ALL} && !$link_doc)) && @ARGV) {
-		push @docs, @ARGV;
+		# The split is for bug-backwards compatibility (#867866).
+		push(@docs, map { split } @ARGV);
 	}
 
 	log_installed_files($package, @docs);
diff --git a/dh_installexamples b/dh_installexamples
index 6f0e806..79e6802 100755
--- a/dh_installexamples
+++ b/dh_installexamples
@@ -100,7 +100,8 @@ foreach my $package (getpackages()) {
 	}	
 
 	if (($package eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) {
-		push @examples, @ARGV;
+		# The split is for bug-backwards compatibility (#867866).
+		push(@examples, map { split } @ARGV);
 	}
 
 	log_installed_files($package, @examples);
diff --git a/dh_installinfo b/dh_installinfo
index dbef7de..ff9bbe2 100755
--- a/dh_installinfo
+++ b/dh_installinfo
@@ -83,7 +83,8 @@ foreach my $package (getpackages()) {
 	}
 
 	if (($package eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) {
-		push @info, @ARGV;
+		# The split is for bug-backwards compatibility (#867866).
+		push(@info, map { split } @ARGV);
 	}
 
 	next if not process_pkg($package) or $nodocs;
diff --git a/dh_installman b/dh_installman
index 1740a5d..f61d7e6 100755
--- a/dh_installman
+++ b/dh_installman
@@ -161,7 +161,8 @@ on_items_in_parallel(\@all_packages, sub {
 		@manpages = filearray($file, \@search_dirs, $error_handler) if $file;
 
 		if (($package eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) {
-			push @manpages, @ARGV;
+			# The split is for bug-backwards compatibility (#867866).
+			push(@manpages, map { split } @ARGV);
 		}
 
 		log_installed_files($package, @manpages);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debhelper/debhelper.git




More information about the debhelper-devel mailing list