diff options
author | Thierry Vignaud <tv@mageia.org> | 2012-06-08 18:51:23 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mageia.org> | 2012-06-08 18:51:23 +0000 |
commit | c166bd1de749851388581828d16ffa65493a4118 (patch) | |
tree | cf54e1d606258887a7e4aa42389da34a5209e98e | |
parent | 8139d7672c2c2f04eed6562f32ce4a4796e506ba (diff) | |
download | urpmi-c166bd1de749851388581828d16ffa65493a4118.tar urpmi-c166bd1de749851388581828d16ffa65493a4118.tar.gz urpmi-c166bd1de749851388581828d16ffa65493a4118.tar.bz2 urpmi-c166bd1de749851388581828d16ffa65493a4118.tar.xz urpmi-c166bd1de749851388581828d16ffa65493a4118.zip |
(_handle_removable_media) split it out of run()
-rw-r--r-- | urpm/main_loop.pm | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/urpm/main_loop.pm b/urpm/main_loop.pm index 6e3c82ab..ec1a7619 100644 --- a/urpm/main_loop.pm +++ b/urpm/main_loop.pm @@ -163,6 +163,18 @@ sub _continue_on_error { return 1; } +sub _handle_removable_media { + my ($urpm, $callbacks, $blists, $sources) = @_; + urpm::removable::try_mounting_non_cdroms($urpm, $blists); + + $callbacks->{pre_removable} and $callbacks->{pre_removable}->(); + require urpm::cdrom; + urpm::cdrom::copy_packages_of_removable_media($urpm, + $blists, $sources, + $callbacks->{copy_removable}); + $callbacks->{post_removable} and $callbacks->{post_removable}->(); +} + # locking is left to callers sub run { my ($urpm, $state, $something_was_to_be_done, $ask_unselect, $_requested, $callbacks) = @_; @@ -183,14 +195,7 @@ sub run { my %sources = %$local_sources; - urpm::removable::try_mounting_non_cdroms($urpm, $blists); - - $callbacks->{pre_removable} and $callbacks->{pre_removable}->(); - require urpm::cdrom; - urpm::cdrom::copy_packages_of_removable_media($urpm, - $blists, \%sources, - $callbacks->{copy_removable}); - $callbacks->{post_removable} and $callbacks->{post_removable}->(); + _handle_removable_media($urpm, $callbacks, $blists, \%sources); if (exists $urpm->{options}{'download-all'}) { _download_all($urpm, $blists, \%sources, $force, $callbacks); |