summaryrefslogtreecommitdiffstats
path: root/urpm
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-06-08 18:51:26 +0000
committerThierry Vignaud <tv@mageia.org>2012-06-08 18:51:26 +0000
commit995720bf24dbc9195426b87de962f6431ab313ca (patch)
tree7f1445e7f4e449c82c1cb23df1b9ff7413496b2c /urpm
parentc166bd1de749851388581828d16ffa65493a4118 (diff)
downloadurpmi-995720bf24dbc9195426b87de962f6431ab313ca.tar
urpmi-995720bf24dbc9195426b87de962f6431ab313ca.tar.gz
urpmi-995720bf24dbc9195426b87de962f6431ab313ca.tar.bz2
urpmi-995720bf24dbc9195426b87de962f6431ab313ca.tar.xz
urpmi-995720bf24dbc9195426b87de962f6431ab313ca.zip
(_init_common_options) split it out of run()
Diffstat (limited to 'urpm')
-rw-r--r--urpm/main_loop.pm35
1 files changed, 20 insertions, 15 deletions
diff --git a/urpm/main_loop.pm b/urpm/main_loop.pm
index ec1a7619..43034fa6 100644
--- a/urpm/main_loop.pm
+++ b/urpm/main_loop.pm
@@ -175,6 +175,25 @@ sub _handle_removable_media {
$callbacks->{post_removable} and $callbacks->{post_removable}->();
}
+sub _init_common_options {
+ my ($urpm, $state, $callbacks, $test) = @_;
+ (
+ urpm::install::options($urpm),
+ test => $test,
+ verbose => $options{verbose},
+ script_fd => $urpm->{options}{script_fd},
+ oldpackage => $state->{oldpackage},
+ justdb => $options{justdb},
+ replacepkgs => $options{replacepkgs},
+ callback_close_helper => $callbacks->{close_helper},
+ callback_inst => $callbacks->{inst},
+ callback_open_helper => $callbacks->{open_helper},
+ callback_trans => $callbacks->{trans},
+ callback_report_uninst => $callbacks->{callback_report_uninst},
+ raw_message => 1,
+ );
+}
+
# locking is left to callers
sub run {
my ($urpm, $state, $something_was_to_be_done, $ask_unselect, $_requested, $callbacks) = @_;
@@ -290,21 +309,7 @@ sub run {
my $to_remove = $urpm->{options}{'allow-force'} ? [] : $set->{remove} || [];
bug_log(scalar localtime(), " ", join(' ', values %transaction_sources_install, values %$transaction_sources), "\n");
$urpm->{log}("starting installing packages");
- my %install_options_common = (
- urpm::install::options($urpm),
- test => $test,
- verbose => $options{verbose},
- script_fd => $urpm->{options}{script_fd},
- oldpackage => $state->{oldpackage},
- justdb => $options{justdb},
- replacepkgs => $options{replacepkgs},
- callback_close_helper => $callbacks->{close_helper},
- callback_inst => $callbacks->{inst},
- callback_open_helper => $callbacks->{open_helper},
- callback_trans => $callbacks->{trans},
- callback_report_uninst => $callbacks->{callback_report_uninst},
- raw_message => 1,
- );
+ my %install_options_common = _init_common_options($urpm, $state, $callbacks, $test);
urpm::orphans::add_unrequested($urpm, $state) if !$test;