[debhelper-devel] [debhelper] 01/01: pkgfile: Do the $dh{NAME} rewrite later

Niels Thykier nthykier at moszumanska.debian.org
Tue Apr 25 13:54:57 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 f8a06ed36fc3319f97612ddcf3a70b91d86638e1
Author: Niels Thykier <niels at thykier.net>
Date:   Tue Apr 25 13:52:16 2017 +0000

    pkgfile: Do the $dh{NAME} rewrite later
    
    Signed-off-by: Niels Thykier <niels at thykier.net>
---
 Debian/Debhelper/Dh_Lib.pm | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/Debian/Debhelper/Dh_Lib.pm b/Debian/Debhelper/Dh_Lib.pm
index 796c866..380a14d 100644
--- a/Debian/Debhelper/Dh_Lib.pm
+++ b/Debian/Debhelper/Dh_Lib.pm
@@ -528,11 +528,6 @@ sub tmpdir {
 
 	sub pkgfile {
 		my ($package, $filename) = @_;
-
-		if (defined $dh{NAME}) {
-			$filename="$dh{NAME}.$filename";
-		}
-	
 		my (@try, $check_expensive);
 
 		if (not exists($_check_expensive{$filename})) {
@@ -546,6 +541,19 @@ sub tmpdir {
 		} else {
 			$check_expensive = $_check_expensive{$filename};
 		}
+
+		# Rewrite $filename after the check_expensive globbing above
+		# as $dh{NAME} is used as a prefix (so the glob above will
+		# cover it).
+		#
+		# In practise, it should not matter as NAME is ether set
+		# globally or not.  But if someone is being "clever" then the
+		# cache is reusable and for the general/normal case, it has no
+		# adverse effects.
+		if (defined $dh{NAME}) {
+			$filename="$dh{NAME}.$filename";
+		}
+
 		if (ref($package) eq 'ARRAY') {
 			# !!NOT A PART OF THE PUBLIC API!!
 			# Bulk test used by dh to speed up the can_skip check.   It

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