diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2008-07-02 14:31:23 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2008-07-02 14:31:23 +0000 |
commit | e3a2f316c390cf3fe24e103d7d018acab7de81f0 (patch) | |
tree | 7dc89ca711624e4366e53662cea5ad2bd3704f59 /urpme | |
parent | 43f0942f8e4a865d26817e365f23d20095868fe4 (diff) | |
download | urpmi-e3a2f316c390cf3fe24e103d7d018acab7de81f0.tar urpmi-e3a2f316c390cf3fe24e103d7d018acab7de81f0.tar.gz urpmi-e3a2f316c390cf3fe24e103d7d018acab7de81f0.tar.bz2 urpmi-e3a2f316c390cf3fe24e103d7d018acab7de81f0.tar.xz urpmi-e3a2f316c390cf3fe24e103d7d018acab7de81f0.zip |
normalize options passing: through %options or $urpm->{options}
Diffstat (limited to 'urpme')
-rw-r--r-- | urpme | 20 |
1 files changed, 10 insertions, 10 deletions
@@ -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) { |