summaryrefslogtreecommitdiff
path: root/dh
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2011-02-10 19:56:44 -0400
committerJoey Hess <joey@kitenet.net>2011-02-10 19:56:51 -0400
commit7fa165faff3df27694cbe9e24830eefd517cc8a6 (patch)
treef5f16049fa6ff3627fec24a139b1b656dfbd17dc /dh
parent14e02173f2eb2ceeffa719c284fd77f25e03576b (diff)
Improve handling of logging in override targets
Changes in 76ef1cbd64829ee4a5156a5fc4b887bcba6b974f broke --remaining-packages in override target. Now all debhelper commands run in the override target are marked as running as part of the override, and when the whole target is run, the log is updated to indicate that commands run during the override have finished. So, inside the override target, --remaining-packages will see the commands run as part of the target as having been run. Outside, if the target fails, dh won't see the commands run it it as having been run. Closes: #612828
Diffstat (limited to 'dh')
-rwxr-xr-xdh13
1 files changed, 7 insertions, 6 deletions
diff --git a/dh b/dh
index 301ce5d..9e6fa04 100755
--- a/dh
+++ b/dh
@@ -647,9 +647,7 @@ sub run {
# This passes the options through to commands called
# inside the target.
$ENV{DH_INTERNAL_OPTIONS}=join("\x1e", @options);
- # Prevent commands called inside the target from
- # logging.
- $ENV{DH_INHIBIT_LOG}=$command;
+ $ENV{DH_INTERNAL_OVERRIDE}=$command;
$command="debian/rules";
@options="override_".$override_command;
}
@@ -670,10 +668,11 @@ sub run {
else {
print " ", "# Skipping ", $override_command, " - empty override", "\n";
}
-
+
if (! $dh{NO_ACT}) {
if (defined $command) {
my $ret=system($command, @options);
+
if ($ret >> 8 != 0) {
exit $ret >> 8;
}
@@ -683,8 +682,6 @@ sub run {
}
if (defined $override_command) {
- delete $ENV{DH_INTERNAL_OPTIONS};
- delete $ENV{DH_INHIBIT_LOG};
# Update log for overridden command now that it has
# finished successfully.
# (But avoid logging for dh_clean since it removes
@@ -692,8 +689,12 @@ sub run {
if ($override_command ne 'dh_clean') {
my %packages=map { $_ => 1 } @packages;
map { delete $packages{$_} } @exclude;
+ commit_override_log(keys %packages);
write_log($override_command, keys %packages);
}
+
+ delete $ENV{DH_INTERNAL_OPTIONS};
+ delete $ENV{DH_INTERNAL_OVERRIDE};
}
}
}