From f3f6432805907c918b4179d222f350b1afa7799c Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Thu, 29 Oct 2009 18:41:22 +0000 Subject: track gurpmi PID --- control-center | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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; -- cgit v1.2.1