summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2008-09-09 15:31:42 +0000
committerThierry Vignaud <tv@mandriva.org>2008-09-09 15:31:42 +0000
commit2c35f854a76ea94f9e5fdfa4a41f1468a8589dc6 (patch)
tree8ee381cfdec0f27e397be60cb915c805bea6134b
parent3ca6b0f781487ea5fee8cf60a7686cd461e92c06 (diff)
downloadurpmi-2c35f854a76ea94f9e5fdfa4a41f1468a8589dc6.tar
urpmi-2c35f854a76ea94f9e5fdfa4a41f1468a8589dc6.tar.gz
urpmi-2c35f854a76ea94f9e5fdfa4a41f1468a8589dc6.tar.bz2
urpmi-2c35f854a76ea94f9e5fdfa4a41f1468a8589dc6.tar.xz
urpmi-2c35f854a76ea94f9e5fdfa4a41f1468a8589dc6.zip
(set_debug) extract it so that rpmdrake can support the --debug option
-rw-r--r--NEWS1
-rw-r--r--urpm/args.pm13
2 files changed, 9 insertions, 5 deletions
diff --git a/NEWS b/NEWS
index 412a26d0..85f70046 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,5 @@
- library:
+ o enable rpmdrake to support --debug option
o fix urpm::download::sync() return value (used by rpmdrake) (#43639)
Version 6.9 - 9 September 2008, Pascal "Pixel" Rigaux
diff --git a/urpm/args.pm b/urpm/args.pm
index aeaf0829..35775da8 100644
--- a/urpm/args.pm
+++ b/urpm/args.pm
@@ -42,14 +42,17 @@ sub add_param_closure {
# to ensure f*cking code (eg: Sys::Syslog) won't exit and break graphical interfaces
END { $::debug_exit and print STDERR "EXITING (pid=$$)\n" }
+sub set_debug {
+ my ($urpm) = @_;
+ $::debug_exit = 1;
+ $options{verbose}++;
+ $urpm->{debug} = $urpm->{debug_URPM} = sub { print STDERR "$_[0]\n" };
+}
+
# options specifications for Getopt::Long
my %options_spec_all = (
- 'debug' => sub {
- $::debug_exit = 1;
- $options{verbose}++;
- $urpm->{debug} = $urpm->{debug_URPM} = sub { print STDERR "$_[0]\n" };
- },
+ 'debug' => sub { set_debug($urpm) },
'debug-librpm' => sub { URPM::setVerbosity(7) }, # 7 == RPMLOG_DEBUG
'q|quiet' => sub { --$options{verbose} },
'v|verbose' => sub { ++$options{verbose} },