]> git.donarmstrong.com Git - debhelper.git/commitdiff
Record debhelper commands that successfully finish in a per-package log file.
authorJoey Hess <joey@kodama.kitenet.net>
Wed, 23 Apr 2008 16:49:35 +0000 (12:49 -0400)
committerJoey Hess <joey@kodama.kitenet.net>
Wed, 23 Apr 2008 16:49:35 +0000 (12:49 -0400)
Debian/Debhelper/Dh_Lib.pm
debian/changelog

index c43b128610ade8993ec7b3b304039fc187417483..3b69602737d3419f526a7f06a12925af8a9dc995 100644 (file)
@@ -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.
index 0eb19ec39ce50af4c0b0a69f37f25286bd85c244..424f7b70c157f3b449c42a037a83013b10af992d 100644 (file)
@@ -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