[Reproducible-commits] [debhelper] 45/56: dh_movefiles: Support globs in cmd-line arguments

Mattia Rizzolo mattia at mapreri.org
Sun Oct 4 17:06:20 UTC 2015


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

mapreri-guest pushed a commit to branch master
in repository debhelper.

commit c530fe28c070aa6c272dbd058c72624d3141e6fb
Author: Niels Thykier <niels at thykier.net>
Date:   Thu Oct 1 21:12:30 2015 +0200

    dh_movefiles: Support globs in cmd-line arguments
    
    Signed-off-by: Niels Thykier <niels at thykier.net>
---
 debian/changelog |  3 +++
 dh_movefiles     | 14 +++++++++++---
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index c0b8981..a05e051 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -70,6 +70,9 @@ debhelper (9.20150811+unreleased) UNRELEASED; urgency=medium
     executable debhelper config file.  This is intended to
     assist dh-exec (etc.) in figuring what packages are
     acted on.  (Closes: #698054)
+  * dh_movefiles: Expand globs in arguments passed in all
+    compat levels (and not just compat 1 and 2).
+    (Closes: #800332)
 
   [ Paul Tagliamonte ]
   * dh_gencontrol: Put debug debs back in the "debug" section.
diff --git a/dh_movefiles b/dh_movefiles
index 547991c..05c74af 100755
--- a/dh_movefiles
+++ b/dh_movefiles
@@ -96,7 +96,7 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
 		error("$sourcedir does not exist.");
 	}
 
-	my @tomove;
+	my (@tomove, @tomove_expanded);
 
         # debian/files has a different purpose, so ignore it.
 	if ($files && $files ne "debian/files" ) {
@@ -104,10 +104,16 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
 	}
 	
 	if (($package eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) {
-		push @tomove, @ARGV;
+		if (compat(2)) {
+			# Pass-throu as-is and it will be expanded below
+			push(@tomove, @ARGV);
+		} else {
+			# Expand these manually as filearray already
+			push(@tomove_expanded, map { glob("$sourcedir/$_") } @ARGV);
+		}
 	}
 
-	if (@tomove && $tmp eq $sourcedir) {
+	if ((@tomove || @tomove_expanded) && $tmp eq $sourcedir) {
 		error("I was asked to move files from $sourcedir to $sourcedir. Perhaps you should set DH_COMPAT=2?");
 	}
 
@@ -127,6 +133,8 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
 		@tomove = map { "$sourcedir/$_" } @tomove;
 	}
 
+	push(@tomove, @tomove_expanded);
+
 	if (@tomove) {
 		if (! -d $tmp) {
 			install_dir($tmp);

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



More information about the Reproducible-commits mailing list