diff options
author | Daouda Lo <daouda@mandriva.com> | 2004-09-09 08:48:00 +0000 |
---|---|---|
committer | Daouda Lo <daouda@mandriva.com> | 2004-09-09 08:48:00 +0000 |
commit | 53b288d77817647b91e279201ab8f79403dd5b0a (patch) | |
tree | caa6a1c726550a8fedebe85d42513997f042715c /mdkapplet | |
parent | f07f873019e9ebeddcbd040a332e18fe526d2d43 (diff) | |
download | mgaonline-53b288d77817647b91e279201ab8f79403dd5b0a.tar mgaonline-53b288d77817647b91e279201ab8f79403dd5b0a.tar.gz mgaonline-53b288d77817647b91e279201ab8f79403dd5b0a.tar.bz2 mgaonline-53b288d77817647b91e279201ab8f79403dd5b0a.tar.xz mgaonline-53b288d77817647b91e279201ab8f79403dd5b0a.zip |
- is_running
Diffstat (limited to 'mdkapplet')
-rwxr-xr-x | mdkapplet | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -51,11 +51,7 @@ my $localfile = "$localdir/mdkonline"; mkdir_p($localdir) if !-d $localdir; -e "$ENV{HOME}/.mdkonline" and system("mv", "$ENV{HOME}/.mdkonline", "$localfile"); -my @pids = `ps -u $ENV{USER} | grep mdkapplet`; -@pids > 1 and die "mdkapplet already running\n"; -#don't launch it twice :) -#my @pids = fuzzy_pidofs(qr/\bmdkapplet\b/); -#@pids > 1 and die "mdkapplet already running\n"; +is_running('mdkapplet') and die "mdkapplet already running\n"; my %state = ( okay => { @@ -271,6 +267,10 @@ sub compareWithInstalled { } $isUpdate } +sub is_running { + my ($name) = @_; + any { !/^\s*$$\b/ && /\b\Q$name\E$/ } `ps -u $ENV{USER}`; +} sub rpmverparse { my ($ver) = @_; my @verparts = (); |