The following commit has been merged in the master branch:
commit d07ecdda8a1af8aeec8bba68fec5b25365e3ae5b
Author: Guillem Jover <[email protected]>
Date: Sun Jun 14 20:32:41 2009 +0200
Dpkg::ErrorHandling: Support changing the file handle for info()
Sometimes we need not clutter STDOUT when outputting data there.
diff --git a/scripts/Dpkg/ErrorHandling.pm b/scripts/Dpkg/ErrorHandling.pm
index 6996692..cc6b8fe 100644
--- a/scripts/Dpkg/ErrorHandling.pm
+++ b/scripts/Dpkg/ErrorHandling.pm
@@ -9,6 +9,7 @@ our @EXPORT = qw(report_options info warning error errormsg
our @EXPORT_OK = qw(report unknown);
my $quiet_warnings = 0;
+my $info_fh = \*STDOUT;
sub report_options
{
@@ -17,6 +18,9 @@ sub report_options
if (exists $options{quiet_warnings}) {
$quiet_warnings = $options{quiet_warnings};
}
+ if (exists $options{info_fh}) {
+ $info_fh = $options{info_fh};
+ }
}
sub report(@)
@@ -29,7 +33,7 @@ sub report(@)
sub info($;@)
{
- print report(_g("info"), @_) if (!$quiet_warnings);
+ print $info_fh report(_g("info"), @_) if (!$quiet_warnings);
}
sub warning($;@)
--
dpkg's main repository
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]