[debhelper-devel] [debhelper] 01/01: dh: Avoid repeating added build commands after "dh_auto_test"
Niels Thykier
nthykier at moszumanska.debian.org
Tue Jan 17 20:13:25 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 b1dc48313174ed4d0dfe14af2b698c26bb742cf3
Author: Niels Thykier <niels at thykier.net>
Date: Tue Jan 17 20:10:34 2017 +0000
dh: Avoid repeating added build commands after "dh_auto_test"
This fixes a bug, where dh would replay a command added to the
"build", "build-arch" or "build-indep" sequences (via --with $ADD_ON)
in the binary sequences.
Signed-off-by: Niels Thykier <niels at thykier.net>
---
debian/changelog | 4 ++++
dh | 13 ++++++++++++-
2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/debian/changelog b/debian/changelog
index 6d201db..b06f19d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,10 @@ debhelper (10.2.4) UNRELEASED; urgency=medium
* d/changelog: Add missing changelog entry in 10.2.3 for a
compat 11 change.
* dh: Show when the "create-stamp" "command" is being run.
+ * dh: Fix a bug where dh would repeat part of the build sequence
+ when an add-on modified the build sequence after "dh_auto_test".
+ Thanks to Sean Whitton for reporting the issue.
+ (Closes: #851071)
-- Niels Thykier <niels at thykier.net> Thu, 12 Jan 2017 07:00:19 +0000
diff --git a/dh b/dh
index bfa3ab6..0783e8d 100755
--- a/dh
+++ b/dh
@@ -647,12 +647,23 @@ if ( -f $build_stamp_file) {
close($fd);
}
+# Lazy cache of the result of optimize_sequence on the "build"
+# sequence
+my $optimized_build_seq;
foreach my $package (@packages) {
my @log;
if (compat(9)) {
@log = load_log($package, \%logged);
} elsif (exists($stamp_file{$package})) {
- @log = @bd;
+ if (not defined($optimized_build_seq)) {
+ # Expand "build" so we can accurately filter out
+ # everything (admittedly, it is bit of an over
+ # approximation)
+ # Related bug: #851071
+ my @seq = optimize_sequence(@{$sequences{'build'}});
+ $optimized_build_seq = \@seq;
+ }
+ @log = @{$optimized_build_seq};
# We do not need %logged in compat 10
}
if ($dh{AFTER}) {
--
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