diff options
author | Thierry Vignaud <tv@mandriva.org> | 2008-09-09 15:31:42 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mandriva.org> | 2008-09-09 15:31:42 +0000 |
commit | 2c35f854a76ea94f9e5fdfa4a41f1468a8589dc6 (patch) | |
tree | 8ee381cfdec0f27e397be60cb915c805bea6134b | |
parent | 3ca6b0f781487ea5fee8cf60a7686cd461e92c06 (diff) | |
download | urpmi-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-- | 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} }, |