diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2006-11-20 12:35:25 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2006-11-20 12:35:25 +0000 |
commit | 08da28d0074a50a5a83563f9cfd4719a8e8cd854 (patch) | |
tree | 7ff86fa3695be1f676ebcd45760c2697246ca6ba | |
parent | 28dd1e250b64de50317f963f77f63f537c77a651 (diff) | |
download | urpmi-08da28d0074a50a5a83563f9cfd4719a8e8cd854.tar urpmi-08da28d0074a50a5a83563f9cfd4719a8e8cd854.tar.gz urpmi-08da28d0074a50a5a83563f9cfd4719a8e8cd854.tar.bz2 urpmi-08da28d0074a50a5a83563f9cfd4719a8e8cd854.tar.xz urpmi-08da28d0074a50a5a83563f9cfd4719a8e8cd854.zip |
simplify copy_packages_of_removable_media() prototype
-rwxr-xr-x | gurpmi2 | 6 | ||||
-rw-r--r-- | urpm.pm | 8 | ||||
-rwxr-xr-x | urpmi | 6 |
3 files changed, 8 insertions, 12 deletions
@@ -218,8 +218,7 @@ sub do_install_3 () { $progressbar->set_size_request(300, -1); $vbox->pack_start($progressbar, 0, 0, 0); change_mainw($vbox); - $urpm->copy_packages_of_removable_media($list, \%sources, - ask_for_medium => sub { + $urpm->copy_packages_of_removable_media($list, \%sources, sub { my $w = Gtk2::MessageDialog->new($mainw, [qw(modal destroy-with-parent)], 'warning', 'ok-cancel', N("Please insert the medium named \"%s\" on device [%s]", $_[0], $_[1]) ); @@ -227,8 +226,7 @@ sub do_install_3 () { $w->destroy; exit 0 if $response eq 'cancel'; 1; - } - ); + }); $urpm->create_transaction( $state, split_level => $urpm->{options}{'split-level'}, @@ -2530,7 +2530,7 @@ sub download_source_packages { my %error_sources; $urpm->lock_urpmi_db('exclusive') if !$options{nolock}; - $urpm->copy_packages_of_removable_media($list, \%sources, %options) or return; + $urpm->copy_packages_of_removable_media($list, \%sources, $options{ask_for_medium}) or return; $urpm->download_packages_of_distant_media($list, \%sources, \%error_sources, %options); $urpm->unlock_urpmi_db unless $options{nolock}; @@ -2592,7 +2592,7 @@ sub unlock_urpmi_db { #- $list is a [ { pkg_id1 => url1, ... }, { ... }, ... ] #- where there is one hash for each medium in {media} sub copy_packages_of_removable_media { - my ($urpm, $list, $sources, %options) = @_; + my ($urpm, $list, $sources, $o_ask_for_medium) = @_; my %removables; #- make sure everything is correct on input... @@ -2628,12 +2628,12 @@ sub copy_packages_of_removable_media { #- by mounting some other directory. Try to figure it out and mount #- everything that might be necessary. while ($check_notfound->($id, $dir, is_iso($medium->{removable}) ? $medium->{removable} : 'removable')) { - is_iso($medium->{removable}) || $options{ask_for_medium} + is_iso($medium->{removable}) || $o_ask_for_medium or $urpm->{fatal}(4, N("medium \"%s\" is not selected", $medium->{name})); $urpm->try_umounting($dir); system("/usr/bin/eject '$device' 2>/dev/null"); is_iso($medium->{removable}) - || $options{ask_for_medium}(remove_internal_name($medium->{name}), $medium->{removable}) + || $o_ask_for_medium->(remove_internal_name($medium->{name}), $medium->{removable}) or $urpm->{fatal}(4, N("medium \"%s\" is not selected", $medium->{name})); } if (-e $dir) { @@ -592,8 +592,7 @@ my %error_sources; $urpm->copy_packages_of_removable_media( $list, \%sources, - verbose => $verbose > 0, - ask_for_medium => (!$urpm->{options}{auto} || $allow_medium_change) && sub { + (!$urpm->{options}{auto} || $allow_medium_change) && sub { my $msg = N("Please insert the medium named \"%s\" on device [%s]", $_[0], $_[1]); my $msg2 = N("Press Enter when ready..."); if ($ENV{DISPLAY} && $::gui) { @@ -605,8 +604,7 @@ $urpm->copy_packages_of_removable_media( } } return defined message_input("$msg\n$msg2 "); - }, -); + }); #- now create transaction just before installation, this will save user impression of slowness. #- split of transaction should be disabled if --test is used. |