summaryrefslogtreecommitdiffstats
path: root/lib/OpenSLX/Utils.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/OpenSLX/Utils.pm')
-rw-r--r--lib/OpenSLX/Utils.pm30
1 files changed, 30 insertions, 0 deletions
diff --git a/lib/OpenSLX/Utils.pm b/lib/OpenSLX/Utils.pm
index b85d6bc1..dbc35270 100644
--- a/lib/OpenSLX/Utils.pm
+++ b/lib/OpenSLX/Utils.pm
@@ -658,4 +658,34 @@ sub grabLock
return $lock;
}
+=item B<pathOf()>
+
+Returns the path of a binary it is installed in.
+
+=cut
+
+sub pathOf
+{
+ my $self = shift;
+ my $binary = shift;
+
+ return qx{which $binary 2>/dev/null};
+}
+
+=item B<isInpath()>
+
+Returns whether a binary is found.
+
+=cut
+
+sub isInPath
+{
+ my $self = shift;
+ my $binary = shift;
+
+ my $path = $self->pathOf($binary);
+
+ return $path ? 1 : 0;
+}
+
1;