summaryrefslogtreecommitdiff
path: root/Debian/Debhelper/Dh_Lib.pm
diff options
context:
space:
mode:
authorJoey Hess <joey@gnu.kitenet.net>2009-02-16 14:55:55 -0500
committerJoey Hess <joey@gnu.kitenet.net>2009-02-16 14:55:55 -0500
commit0f3f59fe6058edfda4010dc88bd3b8aa3ae70a6d (patch)
tree620de8f75a33cc930ca3a9ba88e92a9ee834da61 /Debian/Debhelper/Dh_Lib.pm
parent9e9f49c03fe968effe2ade343d8665386bc8e4c2 (diff)
dh override targets
* dh: debian/rules override targets can change what is run for a specific debhelper command in a sequence. * dh: Redid all the examples to use override targets, since these eliminate all annoying boilerplate and are much easier to understand than the old method. * Remove rules.simple example, there's no need to use explcit targets with dh anymore.
Diffstat (limited to 'Debian/Debhelper/Dh_Lib.pm')
-rw-r--r--Debian/Debhelper/Dh_Lib.pm23
1 files changed, 15 insertions, 8 deletions
diff --git a/Debian/Debhelper/Dh_Lib.pm b/Debian/Debhelper/Dh_Lib.pm
index 4df64c8..f0aa71d 100644
--- a/Debian/Debhelper/Dh_Lib.pm
+++ b/Debian/Debhelper/Dh_Lib.pm
@@ -27,6 +27,7 @@ sub init {
# If so, we need to pass this off to the resource intensive
# Getopt::Long, which I'd prefer to avoid loading at all if possible.
if ((defined $ENV{DH_OPTIONS} && length $ENV{DH_OPTIONS}) ||
+ (defined $ENV{DH_INTERNAL_OPTIONS} && length $ENV{DH_INTERNAL_OPTIONS}) ||
grep /^-/, @ARGV) {
eval "use Debian::Debhelper::Dh_Getopt";
error($@) if $@;
@@ -102,14 +103,20 @@ sub init {
my $write_log=1;
sub END {
if ($? == 0 && $write_log) {
- my $cmd=basename($0);
- foreach my $package (@{$dh{DOPACKAGES}}) {
- my $ext=pkgext($package);
- my $log="debian/${ext}debhelper.log";
- open(LOG, ">>", $log) || error("failed to write to ${log}: $!");
- print LOG $cmd."\n";
- close LOG;
- }
+ write_log(basename($0), @{$dh{DOPACKAGES}});
+ }
+}
+
+sub write_log {
+ my $cmd=shift;
+ my @packages=@_;
+
+ foreach my $package (@packages) {
+ my $ext=pkgext($package);
+ my $log="debian/${ext}debhelper.log";
+ open(LOG, ">>", $log) || error("failed to write to ${log}: $!");
+ print LOG $cmd."\n";
+ close LOG;
}
}