diff options
author | Oliver Tappe | 2008-03-22 16:02:11 +0100 |
---|---|---|
committer | Oliver Tappe | 2008-03-22 16:02:11 +0100 |
commit | 13ab568437e7672024b4897ece539d00f6f01034 (patch) | |
tree | 86bc4a7be90ccc11d4c1281491795e8c1c2a1d7e /os-plugins/plugins/vmware/OpenSLX/OSPlugin/vmware.pm | |
parent | Incorporated modified vmware runlevel script into plugin. It has to be (diff) | |
download | core-13ab568437e7672024b4897ece539d00f6f01034.tar.gz core-13ab568437e7672024b4897ece539d00f6f01034.tar.xz core-13ab568437e7672024b4897ece539d00f6f01034.zip |
* added support for distro-specific runlevelScriptPath() [currently there's only
a generic implementation in Distro/Base.pm - other distros may have to override
it]
* fixed several styleguide violations ;-)
* deactivated overly simplistic backup strategy that only works once
git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@1672 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'os-plugins/plugins/vmware/OpenSLX/OSPlugin/vmware.pm')
-rw-r--r-- | os-plugins/plugins/vmware/OpenSLX/OSPlugin/vmware.pm | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/os-plugins/plugins/vmware/OpenSLX/OSPlugin/vmware.pm b/os-plugins/plugins/vmware/OpenSLX/OSPlugin/vmware.pm index 0104b99d..2da0d688 100644 --- a/os-plugins/plugins/vmware/OpenSLX/OSPlugin/vmware.pm +++ b/os-plugins/plugins/vmware/OpenSLX/OSPlugin/vmware.pm @@ -173,23 +173,26 @@ sub installationPhase #my $vmbin = "$vmpath/bin"; # get path of files we need to install - my $pluginFilesPath = "$self->{'openslxPath'}/lib/plugins/$self->{'name'}/files"; + my $pluginFilesPath + = "$self->{'openslxPath'}/lib/plugins/$self->{'name'}/files"; # copy all needed files my @files = qw( vmware-init nvram.5.0 runvmware-v2 ); foreach my $file (@files) { copyFile("$pluginFilesPath/$file", $self->{'pluginRepositoryPath'}); } - # generate the runlevel script (depends on distro/version and vmware location) - # TODO: the path to the runlevel directory is distro specific!! - rename ("/etc/init.d/vmware", "/etc/init.d/vmware.slx-bak"); - $self->_writeRunlevelScript($vmbin, "/etc/init.d/vmware"); + # generate the runlevel script (depends on distro/version and vmware + # location) + my $runlevelScriptPath = $self->{distro}->getRunlevelScriptPath(); + $self->_writeRunlevelScript($vmbin, $runlevelScriptPath); # generate links for the user executables vmware and player and a # simplified version of the start script @files = qw( vmware vmplayer ); foreach my $file (@files) { - rename ("/usr/bin/$file", "/usr/bin/$file.slx-bak"); + # OLTA: this backup strategy is useless if invoked twice, so I have + # deactivated it +# rename ("/usr/bin/$file", "/usr/bin/$file.slx-bak"); linkFile("/var/X11R6/bin/$file", "/usr/bin/$file"); my $script = unshiftHereDoc(<<" End-of-Here"); #!/bin/sh @@ -203,7 +206,6 @@ sub installationPhase End-of-Here spitFile("$self->{'pluginRepositoryPath'}/$file", $script); } - } sub removalPhase @@ -225,9 +227,9 @@ sub removalPhase sub _writeRunlevelScript { - my $self = shift; + my $self = shift; my $location = shift; - my $file = shift; + my $file = shift; # $location points to the path where vmware helpers are installed my $script = unshiftHereDoc(<<" End-of-Here"); @@ -331,6 +333,11 @@ sub _writeRunlevelScript exit 0 End-of-Here + + # OLTA: this backup strategy is useless if invoked twice, so I have + # deactivated it +# rename($file, "${file}.slx-bak") if -e $file; + spitFile($file, $script); } |