summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2009-10-29 18:41:22 +0000
committerThierry Vignaud <tv@mandriva.org>2009-10-29 18:41:22 +0000
commitf3f6432805907c918b4179d222f350b1afa7799c (patch)
tree5766281ce7e9904f710db8f2d3e79df633877a5d
parent9d6e49edf6d26f3625aee9dac8254e4c3ff19028 (diff)
downloadcontrol-center-f3f6432805907c918b4179d222f350b1afa7799c.tar
control-center-f3f6432805907c918b4179d222f350b1afa7799c.tar.gz
control-center-f3f6432805907c918b4179d222f350b1afa7799c.tar.bz2
control-center-f3f6432805907c918b4179d222f350b1afa7799c.tar.xz
control-center-f3f6432805907c918b4179d222f350b1afa7799c.zip
track gurpmi PID
-rwxr-xr-xcontrol-center8
1 files changed, 7 insertions, 1 deletions
diff --git a/control-center b/control-center
index 43679fb3..9f6528ac 100755
--- a/control-center
+++ b/control-center
@@ -39,7 +39,7 @@ use Gtk2::WebKit;
use MDV::Control_Center;
-my (%tool_pids, %tool_feedback);
+my (%tool_pids, %tool_feedback, $gurpmi_pid);
my ($version, $conffile, $class_install) = (`cat /etc/mandrakelinux-release` =~ /\b(\d+\.{1}.+\))/, "/etc/mcc.conf", "/etc/sysconfig/system");
@@ -1206,11 +1206,13 @@ sub run_tool {
my ($exec, $gtkplug) = @$tool{qw(binary embedded)};
$application_driven_menu = $tool->{application_driven_menu};
return if $tool_pids{$label};
+ my $will_run_gurpmi;
if (! -x first(split /\s+/, $exec)) {
if ($tool->{packages2install}) {
# gurpmi doesn't support being embedded yet:
$gtkplug = -1;
$exec = join(' ', "$bindir/gurpmi", split(/\s/, $tool->{packages2install}));
+ $will_run_gurpmi = 1;
} else {
splash_warning(N("cannot fork and exec \"%s\" since it is not executable", $exec));
return;
@@ -1269,6 +1271,7 @@ sub run_tool {
# fix #3415 when $gtkplug eq -1
local $option_values{embedded} = 0;
$tool_pids{$label} = fork_($exec);
+ $gurpmi_pid = $tool_pids{$label} if $will_run_gurpmi;
}
start_logdrake();
$box->window->set_cursor($wait_cursor) if $box;
@@ -1331,6 +1334,9 @@ sub sig_child {
$tool_feedback{$tool}->();
delete $tool_pids{$tool};
@pid_launched = grep { $_ ne $child_pid } @pid_launched;
+ if ($child_pid == $gurpmi_pid) {
+ undef $gurpmi_pid;
+ }
}
undef $pid_exp if $pid_exp eq $child_pid;
} while $child_pid > 0;