diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2006-12-06 16:54:17 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2006-12-06 16:54:17 +0000 |
commit | c30bf0d1e28c3fc75b43d37cc59138ff81c73344 (patch) | |
tree | acab79e210314abc208e7b54a88a550fe9c14838 /urpm | |
parent | ed654fa31d41be62b134c5300b577b121ce6344f (diff) | |
download | urpmi-c30bf0d1e28c3fc75b43d37cc59138ff81c73344.tar urpmi-c30bf0d1e28c3fc75b43d37cc59138ff81c73344.tar.gz urpmi-c30bf0d1e28c3fc75b43d37cc59138ff81c73344.tar.bz2 urpmi-c30bf0d1e28c3fc75b43d37cc59138ff81c73344.tar.xz urpmi-c30bf0d1e28c3fc75b43d37cc59138ff81c73344.zip |
add code to help debugging bugs like #26256
Diffstat (limited to 'urpm')
-rw-r--r-- | urpm/args.pm | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/urpm/args.pm b/urpm/args.pm index b843735d..e711c05d 100644 --- a/urpm/args.pm +++ b/urpm/args.pm @@ -37,10 +37,18 @@ sub add_param_closure { return sub { $::qf .= join $::separator, '', map { "%$_" } @tags }; } +# debug code to display a nice message when exiting, +# to ensure f*cking code (eg: Sys::Syslog) won't exit and break graphical interfaces +END { $::debug_exit and print STDERR "EXITING (pid=$$)\n" } + # options specifications for Getopt::Long my %options_spec_all = ( - 'debug' => sub { $urpm->{debug} = sub { print STDERR "$_[0]\n" } }, + 'debug' => sub { + $::debug_exit = 1; + $urpm->{debug} = sub { print STDERR "$_[0]\n" }; + }, + 'urpmi-root=s' => sub { urpm::set_files($urpm, $_[1]) }, ); my %options_spec = ( @@ -142,8 +150,8 @@ my %options_spec = ( 'no-md5sum' => \$::nomd5sum, 'force-key' => \$::forcekey, a => \$::all, - q => sub { --$::verbose; $::rpm_opt = '' }, - v => sub { ++$::verbose; $::rpm_opt = 'vh' }, + 'q|quiet' => sub { --$::verbose; $::rpm_opt = '' }, + 'v|verbose' => sub { ++$::verbose; $::rpm_opt = 'vh' }, p => sub { $::use_provides = 1 }, P => sub { $::use_provides = 0 }, y => sub { $urpm->{options}{fuzzy} = 1 }, @@ -152,7 +160,7 @@ my %options_spec = ( urpme => { auto => \$::auto, - v => \$::verbose, + 'v|verbose' => \$::verbose, a => \$::matches, noscripts => \$::noscripts, repackage => \$::repackage, @@ -249,7 +257,7 @@ my %options_spec = ( R => sub { ++$options{what_requires} }, y => sub { $urpm->{options}{fuzzy} = 1; $options{all} = 1 }, Y => sub { $urpm->{options}{fuzzy} = 1; $options{all} = $options{caseinsensitive} = 1 }, - v => \$options{verbose}, + 'verbose|v' => \$options{verbose}, i => \$options{info}, l => \$options{list_files}, r => sub { |