[debhelper-devel] [debhelper] 01/01: dh_install: Fix regression with non-existing files

Niels Thykier nthykier at moszumanska.debian.org
Mon Mar 21 17:51:26 UTC 2016


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

nthykier pushed a commit to branch master
in repository debhelper.

commit ffc8adac33238d3ad84afd2034d10a986e93acee
Author: Niels Thykier <niels at thykier.net>
Date:   Mon Mar 21 17:50:06 2016 +0000

    dh_install: Fix regression with non-existing files
    
    Signed-off-by: Niels Thykier <niels at thykier.net>
---
 debian/changelog |  4 ++++
 dh_install       | 21 +++++++++++++++++++--
 2 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 8f0dec1..56b608c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -6,6 +6,10 @@ debhelper (9.20160313) unstable; urgency=medium
   * dh_compress: Gracefully handle absolute paths passed via
     the -P option.  Thanks to Andreas Beckmann for reporting
     the issue.  (Closes: #818049)
+  * dh_install: Fix a regression where a non-existing file
+    was ignored if another file was matched for the same
+    destination dir.  Thanks to Ben Hutchings for reporting
+    the issue.  (Closes: #818834)
 
  -- Niels Thykier <niels at thykier.net>  Sun, 13 Mar 2016 14:21:02 +0000
 
diff --git a/dh_install b/dh_install
index 7dc4b64..cd89887 100755
--- a/dh_install
+++ b/dh_install
@@ -175,15 +175,32 @@ foreach my $package (getpackages()) {
 		my @filelist;
 		foreach my $glob (@$set) {
 			my @found = glob "$srcdir/$glob";
+			my $glob_sd = $srcdir;
+			my $matched = 0;
 			if (! compat(6)) {
 				# Fall back to looking in debian/tmp.
 				if (! @found || ! (-e $found[0] || -l $found[0])) {
-					@found = glob "debian/tmp/$glob"
-						if $glob !~ m{^(?:\./)?debian/tmp/};
+					if ($glob !~ m{^(?:\./)?debian/tmp/}) {
+						@found = glob "debian/tmp/$glob";
+						$glob_sd = 'debian/tmp';
+					}
 				}
 			}
 			if (@found && (-e $found[0] || -l $found[0])) {
 				push @filelist, @found;
+				$matched = 1;
+			}
+			# Do not require a match for packages that not acted on
+			# (directly).  After all, the files might not have been
+			# generated/compiled.
+			if (not $matched and not $skip_install) {
+				if (compat(6)) {
+					warning("Cannot find (any matches for) \"${glob}\" (tried in \"${srcdir}\")");
+				} else {
+					warning("Cannot find (any matches for) \"${glob}\" (tried in \"${srcdir}\" and \"debian/tmp\")");
+				}
+				# In compat 4, a non-matching glob was not fatal...
+				++$missing_files if not compat(4) or @found;
 			}
 		}
 

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