summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joey@kodama.kitenet.net>2008-04-23 12:49:35 -0400
committerJoey Hess <joey@kodama.kitenet.net>2008-04-23 12:49:35 -0400
commitd4e087749efd0e445026f46a9d2b1cfc9e10dcde (patch)
tree34471f29f89d2080dd8042dc3ffbeb9de8774a0f
parentc41c158bc3fd2324f9969190fe64e350312e67a8 (diff)
Record debhelper commands that successfully finish in a per-package log file.
-rw-r--r--Debian/Debhelper/Dh_Lib.pm18
-rw-r--r--debian/changelog2
2 files changed, 20 insertions, 0 deletions
diff --git a/Debian/Debhelper/Dh_Lib.pm b/Debian/Debhelper/Dh_Lib.pm
index c43b128..3b69602 100644
--- a/Debian/Debhelper/Dh_Lib.pm
+++ b/Debian/Debhelper/Dh_Lib.pm
@@ -108,6 +108,24 @@ sub init {
}
}
+# Run at exit. Add the command to the log files for the packages it acted
+# on, if it's exiting successfully.
+sub END {
+ if ($? == 0) {
+ my $cmd=basename($0);
+ # dh_clean deletes the log, so should not recreate it at
+ # the end
+ if ($cmd ne "dh_clean") {
+ foreach my $package (@{$dh{DOPACKAGES}}) {
+ my $ext=pkgext($package);
+ open(LOG, ">>", "debian/${ext}log.debhelper") || error("failed to write to log");
+ print LOG $cmd."\n";
+ close LOG;
+ }
+ }
+ }
+}
+
# Pass it an array containing the arguments of a shell command like would
# be run by exec(). It turns that into a line like you might enter at the
# shell, escaping metacharacters and quoting arguments that contain spaces.
diff --git a/debian/changelog b/debian/changelog
index 0eb19ec..424f7b7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,8 @@ debhelper (6.0.13) UNRELEASED; urgency=low
* dh_clean: Don't delete core dumps. (Too DWIM, and "core" is not
necessarily a core dump.) Closes: #477391
+ * Record debhelper commands that successfully finish in a per-package log
+ file.
-- Joey Hess <joeyh@debian.org> Tue, 22 Apr 2008 17:54:20 -0400