summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiels Thykier <niels@thykier.net>2015-10-01 21:12:30 +0200
committerNiels Thykier <niels@thykier.net>2015-10-01 21:12:30 +0200
commitc530fe28c070aa6c272dbd058c72624d3141e6fb (patch)
tree68d30c0415f8c4db44ec2d854c9576a4250291a2
parente2a802bf5365ce05e5270592dfa95240499d98ed (diff)
downloaddebhelper-c530fe28c070aa6c272dbd058c72624d3141e6fb.tar.gz
dh_movefiles: Support globs in cmd-line arguments
Signed-off-by: Niels Thykier <niels@thykier.net>
-rw-r--r--debian/changelog3
-rwxr-xr-xdh_movefiles14
2 files changed, 14 insertions, 3 deletions
diff --git a/debian/changelog b/debian/changelog
index c0b89819..a05e0518 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 547991c6..05c74af4 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);