[debhelper-devel] [debhelper] 01/01: Dh_Lib: Fix regression in handling of "foo{bar}" globs

Niels Thykier nthykier at moszumanska.debian.org
Wed Jan 24 20:30:20 UTC 2018


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

nthykier pushed a commit to branch master
in repository debhelper.

commit 91baecbabc338c3713262260d99c16a5db7ecc70
Author: Niels Thykier <niels at thykier.net>
Date:   Wed Jan 24 20:18:42 2018 +0000

    Dh_Lib: Fix regression in handling of "foo{bar}" globs
    
    Signed-off-by: Niels Thykier <niels at thykier.net>
---
 debian/changelog               |  4 ++++
 lib/Debian/Debhelper/Dh_Lib.pm | 10 ++++++++--
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 63d449d..7f4c784 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -6,6 +6,10 @@ debhelper (11.1.4) UNRELEASED; urgency=medium
   * dh_installdocs: Discard auto-detected main doc package when
     passed -A/--all as it causes file-conflicts.
     (Closes: #886108, #888294)
+  * Dh_Lib: Fix regression where "foo{bar}" would not be matched
+    when the pattern was handled as a glob.  The bug was
+    introduced in debhelper/10.6.  Thanks to Wouter Verhelst for
+    finding the bug.  (Closes: #888251)
 
  -- Niels Thykier <niels at thykier.net>  Sun, 21 Jan 2018 08:18:20 +0000
 
diff --git a/lib/Debian/Debhelper/Dh_Lib.pm b/lib/Debian/Debhelper/Dh_Lib.pm
index 9410292..834527d 100644
--- a/lib/Debian/Debhelper/Dh_Lib.pm
+++ b/lib/Debian/Debhelper/Dh_Lib.pm
@@ -1187,8 +1187,14 @@ sub glob_expand {
 	for my $pattern (@patterns) {
 		my @m;
 		for my $dir (@dirs) {
-			@m = bsd_glob("$dir/$pattern", GLOB_CSH & ~(GLOB_NOMAGIC|GLOB_TILDE));
-			last if @m;# > 1 or (@m and (-l $m[0] or -e _));
+			my $full_pattern = "$dir/$pattern";
+			@m = bsd_glob($full_pattern, GLOB_CSH & ~(GLOB_NOMAGIC|GLOB_TILDE));
+			last if @m;
+			# Handle "foo{bar}" pattern (#888251)
+			if (-l $full_pattern or -e _) {
+				push(@m, $full_pattern);
+				last;
+			}
 		}
 		if (not @m) {
 			$error_handler //= \&glob_expand_error_handler_reject;

-- 
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