diff options
-rw-r--r-- | urpm/args.pm | 8 | ||||
-rw-r--r-- | urpme | 20 |
2 files changed, 13 insertions, 15 deletions
diff --git a/urpm/args.pm b/urpm/args.pm index 83561845..903ab2b2 100644 --- a/urpm/args.pm +++ b/urpm/args.pm @@ -185,11 +185,8 @@ my %options_spec = ( }, urpme => { - auto => \$::auto, - a => \$::matches, - noscripts => \$::noscripts, - repackage => \$::repackage, - restricted => \$::restricted, + a => \$options{matches}, + restricted => \$options{restricted}, }, #- see also below, autogenerated callbacks @@ -411,6 +408,7 @@ foreach my $k ('allow-medium-change', 'auto', 'auto-select', 'force', 'expect-in $options_spec{gurpmi2} = $options_spec{gurpmi}; foreach my $k ("help|h", "version", "no-locales", "test!", "force", "root=s", "use-distrib=s", + 'repackage', 'noscripts', 'auto', "parallel=s") { $options_spec{urpme}{$k} = $options_spec{urpmi}{$k}; @@ -31,7 +31,7 @@ use urpm::select; $ENV{PATH} = "/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin"; delete @ENV{qw(ENV BASH_ENV IFS CDPATH)}; -our ($test, $parallel, $auto, $matches, $force, $noscripts, $repackage, $restricted); +our ($test, $parallel, $force); my $yesexpr = #-PO: Add here the keys which might be pressed in the "Yes"-case. N("Yy"); @@ -71,8 +71,8 @@ if ($< && !$test) { } #- rurpme checks -if ($restricted) { - urpm::error_restricted($urpm) if $urpm->{root} || $options{usedistrib} || $noscripts || $parallel; +if ($options{restricted}) { + urpm::error_restricted($urpm) if $urpm->{root} || $options{usedistrib} || $urpm->{options}{noscripts} || $parallel; } unless ($test) { @@ -92,7 +92,7 @@ urpm::media::configure($urpm, my @toremove = urpm::select::find_packages_to_remove($urpm, $state, \@cmdline_pkgs_to_remove, - matches => $matches, + matches => $options{matches}, force => $force, callback_notfound => sub { my $urpm = shift @_; @@ -115,11 +115,11 @@ my @toremove = urpm::select::find_packages_to_remove($urpm, ) or $urpm->{fatal}(0, N("Nothing to remove")); my $list = urpm::select::translate_why_removed($urpm, $state, @toremove); -if ($test && $auto) { +if ($test && $options{auto}) { #- Warning : the following message is parsed in urpm::parallel_* my $msg = N("Checking to remove the following packages"); print STDOUT "$msg:\n$list\n"; -} elsif (($parallel || @toremove > @cmdline_pkgs_to_remove) && !$auto) { +} elsif (($parallel || @toremove > @cmdline_pkgs_to_remove) && !$options{auto}) { my $msg = P("To satisfy dependencies, the following package will be removed", "To satisfy dependencies, the following %d packages will be removed", @@ -135,15 +135,15 @@ my @errors = $parallel \@toremove, test => $test, force => $force, - noscripts => $noscripts, - repackage => $repackage || $urpm->{options}{repackage}, + noscripts => $urpm->{options}{noscripts}, + repackage => $urpm->{options}{repackage}, ) : urpm::install::install($urpm, \@toremove, {}, {}, test => $test, force => $force, - noscripts => $noscripts, - repackage => $repackage || $urpm->{options}{repackage}, + noscripts => $urpm->{options}{noscripts}, + repackage => $urpm->{options}{repackage}, ); if (@errors) { |