diff options
-rw-r--r-- | NEWS | 1 | ||||
-rw-r--r-- | urpm/args.pm | 13 |
2 files changed, 9 insertions, 5 deletions
@@ -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} }, |