Control: tag -1 patch

A patch that exports _DH_DO_PACKAGES before running an executable script
is attached. It may be worth restricting this to compat 10, but... I
don't see the harm in exporting this even in lower compat levels. The
only upside of restricting it to 10 would be to make sure that stuff
that rely on this behaviour use the right compat level.

Yet, since there's about one potential user for this so far, and that
can just build-depend on a higher debhelper, I don't think adding the
compat 10 restriction is worth it.

-- 
|8]

>From 80766c948080a382bb752f0cb90623073626aa05 Mon Sep 17 00:00:00 2001
From: Gergely Nagy <alger...@madhouse-project.org>
Date: Wed, 23 Sep 2015 10:12:43 +0200
Subject: [PATCH] Dh_Lib: Export _DH_DO_PACKAGES before running executable
 scripts

In order to let executable scripts discover what package is being built,
so they can avoid side-effects in case a package is skipped, export
_DH_DO_PACKAGES before running them.

This, along with changes to dh-exec, will close #698054.

Signed-off-by: Gergely Nagy <alger...@madhouse-project.org>
---
 Debian/Debhelper/Dh_Lib.pm | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Debian/Debhelper/Dh_Lib.pm b/Debian/Debhelper/Dh_Lib.pm
index a5743e9..03553ce 100644
--- a/Debian/Debhelper/Dh_Lib.pm
+++ b/Debian/Debhelper/Dh_Lib.pm
@@ -760,7 +760,9 @@ sub filedoublearray {
 	if ($x) {
 		require Cwd;
 		my $cmd=Cwd::abs_path($file);
+		$ENV{"_DH_DO_PACKAGES"} = join(",", @{$dh{"DOPACKAGES"}});
 		open (DH_FARRAY_IN, "$cmd |") || error("cannot run $file: $!");
+		delete $ENV{"_DH_DO_PACKAGES"};
 	}
 	else {
 		open (DH_FARRAY_IN, $file) || error("cannot read $file: $!");
-- 
2.5.1

Reply via email to