From 707eb1cdaef84318f7a464fef94fff26d09d2514 Mon Sep 17 00:00:00 2001 From: Dirk von Suchodoletz Date: Wed, 17 Dec 2008 16:04:54 +0000 Subject: More general location of helper functions (to check if a certain binary is installed somewhere). git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@2426 95ad53e4-c205-0410-b2fa-d234c58c8868 --- lib/OpenSLX/Utils.pm | 30 ++++++++++++++++++++++ .../plugins/syslog/OpenSLX/OSPlugin/syslog.pm | 6 ++--- os-plugins/plugins/x11vnc/OpenSLX/Distro/Base.pm | 18 ------------- .../plugins/x11vnc/OpenSLX/OSPlugin/x11vnc.pm | 22 ---------------- 4 files changed, 33 insertions(+), 43 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 + +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 + +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; diff --git a/os-plugins/plugins/syslog/OpenSLX/OSPlugin/syslog.pm b/os-plugins/plugins/syslog/OpenSLX/OSPlugin/syslog.pm index 86232c93..f19fa00c 100644 --- a/os-plugins/plugins/syslog/OpenSLX/OSPlugin/syslog.pm +++ b/os-plugins/plugins/syslog/OpenSLX/OSPlugin/syslog.pm @@ -66,11 +66,11 @@ sub getAttrInfo 'syslog::kind' => { applies_to_vendor_os => 1, description => unshiftHereDoc(<<' End-of-Here'), - kind of syslog to use (syslogd or syslog-ng) + kind of syslog to use (syslogd-ng or old-style syslog) End-of-Here content_regex => undef, - content_descr => 'allowed: syslogd, syslog-ng', - default => undef, + content_descr => 'allowed: syslogd-ng, syslog', + default => syslog-ng, }, 'syslog::host' => { applies_to_systems => 1, diff --git a/os-plugins/plugins/x11vnc/OpenSLX/Distro/Base.pm b/os-plugins/plugins/x11vnc/OpenSLX/Distro/Base.pm index 11f0b2e5..93f1a3eb 100644 --- a/os-plugins/plugins/x11vnc/OpenSLX/Distro/Base.pm +++ b/os-plugins/plugins/x11vnc/OpenSLX/Distro/Base.pm @@ -89,24 +89,6 @@ sub fillRunlevelScript return $script; } -sub pathOf -{ - my $self = shift; - my $binary = shift; - - return qx{which $binary 2>/dev/null}; -} - -sub isInPath -{ - my $self = shift; - my $binary = shift; - - my $path = $self->pathOf($binary); - - return $path ? 1 : 0; -} - sub isX11vncInstalled { my $self = shift; diff --git a/os-plugins/plugins/x11vnc/OpenSLX/OSPlugin/x11vnc.pm b/os-plugins/plugins/x11vnc/OpenSLX/OSPlugin/x11vnc.pm index 3c67b9f7..e73ea8a3 100644 --- a/os-plugins/plugins/x11vnc/OpenSLX/OSPlugin/x11vnc.pm +++ b/os-plugins/plugins/x11vnc/OpenSLX/OSPlugin/x11vnc.pm @@ -207,28 +207,6 @@ sub installationPhase vlog(3, "install init file"); - #if ( !-x "/usr/bin/x11vnc" ) { - # # let's install x11vnc - # my $vendorOSName = $self->{'os-plugin-engine'}->{'vendor-os-name'}; - # if ( $vendorOSName =~ m/(debian|ubuntu)/i ) { - # my $cmd = "aptitude -y install x11vnc"; - # vlog(3, "executing: $cmd"); - # if (slxsystem($cmd)) { - # die _tr("unable to execute shell-cmd\n\t%s", $cmd); - # } - # } - # if ( $vendorOSName =~ m/suse/i ) { - # # PLEASE TEST THIS!!! - # my $cmd = "zypper -n in x11vnc"; - # vlog(3, "executing: $cmd"); - # if (slxsystem($cmd)) { - # die _tr("unable to execute shell-cmd\n\t%s", $cmd); - # } - # } - #} else { - # vlog(3, "x11vnc is already installed"); - #} - } sub removalPhase -- cgit v1.2.3-55-g7522