summaryrefslogtreecommitdiff
path: root/Debian
diff options
context:
space:
mode:
Diffstat (limited to 'Debian')
-rw-r--r--Debian/Debhelper/Dh_Getopt.pm8
-rw-r--r--Debian/Debhelper/Dh_Lib.pm23
2 files changed, 23 insertions, 8 deletions
diff --git a/Debian/Debhelper/Dh_Getopt.pm b/Debian/Debhelper/Dh_Getopt.pm
index 950a37b9..ddfb71b6 100644
--- a/Debian/Debhelper/Dh_Getopt.pm
+++ b/Debian/Debhelper/Dh_Getopt.pm
@@ -159,6 +159,14 @@ sub parseopts {
}
}
+ # DH_INTERNAL_OPTIONS is used to pass additional options from
+ # dh through an override target to a command.
+ if (defined $ENV{DH_INTERNAL_OPTIONS}) {
+ $ENV{DH_INTERNAL_OPTIONS}=~s/^\s+//;
+ $ENV{DH_INTERNAL_OPTIONS}=~s/\s+$//;
+ unshift @ARGV, split(/\s+/,$ENV{DH_INTERNAL_OPTIONS});
+ }
+
my $ret=getoptions(\@ARGV, $options);
if (!$ret) {
warning("warning: unknown options will be a fatal error in a future debhelper release");
diff --git a/Debian/Debhelper/Dh_Lib.pm b/Debian/Debhelper/Dh_Lib.pm
index 4df64c87..f0aa71df 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;
}
}