summaryrefslogtreecommitdiffstats
path: root/mdkapplet
diff options
context:
space:
mode:
authorDaouda Lo <daouda@mandriva.com>2004-09-09 08:48:00 +0000
committerDaouda Lo <daouda@mandriva.com>2004-09-09 08:48:00 +0000
commit53b288d77817647b91e279201ab8f79403dd5b0a (patch)
treecaa6a1c726550a8fedebe85d42513997f042715c /mdkapplet
parentf07f873019e9ebeddcbd040a332e18fe526d2d43 (diff)
downloadmgaonline-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-xmdkapplet10
1 files changed, 5 insertions, 5 deletions
diff --git a/mdkapplet b/mdkapplet
index 82af6d10..403e429c 100755
--- a/mdkapplet
+++ b/mdkapplet
@@ -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 = ();