summaryrefslogtreecommitdiffstats
path: root/urpm/args.pm
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 /urpm/args.pm
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
Diffstat (limited to 'urpm/args.pm')
-rw-r--r--urpm/args.pm13
1 files changed, 8 insertions, 5 deletions
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} },