diff options
author | Thierry Vignaud <tv@mandriva.org> | 2007-03-21 11:55:35 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mandriva.org> | 2007-03-21 11:55:35 +0000 |
commit | 478d7474f1c8af355a356d52dcf96084cff4c7f1 (patch) | |
tree | 67d6b68fbdb5448b9b15c0819cbaf415a0572e4e /Rpmdrake | |
parent | 1df0880ba80ae653b29cc524defe4d632c741a6a (diff) | |
download | rpmdrake-478d7474f1c8af355a356d52dcf96084cff4c7f1.tar rpmdrake-478d7474f1c8af355a356d52dcf96084cff4c7f1.tar.gz rpmdrake-478d7474f1c8af355a356d52dcf96084cff4c7f1.tar.bz2 rpmdrake-478d7474f1c8af355a356d52dcf96084cff4c7f1.tar.xz rpmdrake-478d7474f1c8af355a356d52dcf96084cff4c7f1.zip |
(perform_parallel_install) split it out of perform_install()
Diffstat (limited to 'Rpmdrake')
-rwxr-xr-x | Rpmdrake/pkg.pm | 42 |
1 files changed, 23 insertions, 19 deletions
diff --git a/Rpmdrake/pkg.pm b/Rpmdrake/pkg.pm index 475a73d4..81327706 100755 --- a/Rpmdrake/pkg.pm +++ b/Rpmdrake/pkg.pm @@ -424,6 +424,28 @@ Then, restart %s.", $rpmdrake::myname_update)), myexit(-1); } +sub perform_parallel_install { + my ($urpm, $group, $w, $statusbar_msg_id) = @_; + my $pkgs = join(' ', map { if_($_->flag_requested, urpm_name($_)) } @{$urpm->{depslist}}); + my @error_msgs; + system("urpmi -v --X --parallel $group $pkgs"); + if ($? == 0) { + $statusbar_msg_id = statusbar_msg( + #N("Everything installed successfully"), + N("All requested packages were installed successfully."), + ); + } else { + interactive_msg( + N("Problem during installation"), + N("There was a problem during the installation:\n\n%s", join("\n", @error_msgs)), + scroll => 1, + ); + } + open_db('force_sync'); + $w->set_sensitive(1); + return 0; +} + sub perform_installation { #- (partially) duplicated from /usr/sbin/urpmi :-( my ($urpm, $pkgs) = @_; @@ -439,25 +461,7 @@ sub perform_installation { #- (partially) duplicated from /usr/sbin/urpmi :-( my $_flush_guard = Gtk2::GUI_Update_Guard->new; my $group; - if ($::options{parallel} && (($group) = @{$::options{parallel}})) { - my $pkgs = join(' ', map { if_($_->flag_requested, urpm_name($_)) } @{$urpm->{depslist}}); - system("urpmi -v --X --parallel $group $pkgs"); - if ($? == 0) { - $statusbar_msg_id = statusbar_msg( - #N("Everything installed successfully"), - N("All requested packages were installed successfully."), - ); - } else { - interactive_msg( - N("Problem during installation"), - N("There was a problem during the installation:\n\n%s", join("\n", @error_msgs)), - scroll => 1, - ); - } - open_db('force_sync'); - $w->set_sensitive(1); - return 0; - } + return perform_parallel_install($urpm, $group, \$statusbar_msg_id) if $::options{parallel} && (($group) = @{$::options{parallel}}); my $lock = urpm::lock::urpmi_db($urpm); my $rpm_lock = urpm::lock::rpm_db($urpm, 'exclusive'); |