summaryrefslogtreecommitdiffstats
path: root/os-plugins/plugins/vmware/OpenSLX/OSPlugin/vmware.pm
diff options
context:
space:
mode:
authorVolker Uhrig2008-06-07 21:52:48 +0200
committerVolker Uhrig2008-06-07 21:52:48 +0200
commit7796d07fd918175dd2ab795c8928d88a47a392c2 (patch)
treef75b839fb5710fc259345849eb41e84287b2ede6 /os-plugins/plugins/vmware/OpenSLX/OSPlugin/vmware.pm
parent* made support for chrooted shells and updates explicit in vendor-OS list, (diff)
downloadcore-7796d07fd918175dd2ab795c8928d88a47a392c2.tar.gz
core-7796d07fd918175dd2ab795c8928d88a47a392c2.tar.xz
core-7796d07fd918175dd2ab795c8928d88a47a392c2.zip
* finished implementation of vmpl2.0 installation
* tested successfull on suse 10.2 (vmpl2.0 and local installation) * some minor (optical) changes * some more errorhandling for invalid configuration needed * theres a need for tests on debian-based systems * Configuration: http://openslx.org/trac/de/openslx/wiki/vmware git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@1859 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.pm47
1 files changed, 27 insertions, 20 deletions
diff --git a/os-plugins/plugins/vmware/OpenSLX/OSPlugin/vmware.pm b/os-plugins/plugins/vmware/OpenSLX/OSPlugin/vmware.pm
index 4207a12d..2786594b 100644
--- a/os-plugins/plugins/vmware/OpenSLX/OSPlugin/vmware.pm
+++ b/os-plugins/plugins/vmware/OpenSLX/OSPlugin/vmware.pm
@@ -196,7 +196,28 @@ sub installationPhase
if ($self->{attrs}->{'vmware::vmpl2.0'} == 1) {
$self->_vmpl2Installation();
}
-
+
+ ## prepration for our faster wrapper script
+ # rename the default vmplayer script and create a link.
+ # uninstall routine takes care about plugin remove.
+ # stage3 copys our own wrapper script
+ if (-e "/usr/bin/vmplayer") {
+ rename("/usr/bin/vmplayer", "/usr/bin/vmplayer.slx-bak");
+ linkFile("/var/X11R6/bin/vmplayer", "/usr/bin/vmplayer");
+ }
+ # the same with vmware, if ws is installed
+ if (-e "/usr/bin/vmware") {
+ rename("/usr/bin/vmware", "/usr/bin/vmware.slx-bak");
+ }
+ # this kinda sucks. what if we have local installed vmplayer but
+ # plugin installed vmware workstation? what if we have a local
+ # installed vmware workstation but run plugin installed vmplayer
+ # without workstation. Link will go to nowhere... kinda ugly that
+ # /usr/ is ro.
+ # TODO: need to find a solution (if there is one possible with ro
+ # mounted /usr ...)
+ linkFile("/var/X11R6/bin/vmware", "/usr/bin/vmware");
+
}
sub removalPhase
@@ -207,7 +228,7 @@ sub removalPhase
# restore old start scripts - to be discussed
my @files = qw( vmware vmplayer );
foreach my $file (@files) {
- if (-e $file) {
+ if (-e "/usr/bin/$file.slx-bak") {
unlink("/usr/bin/$file");
rename("/usr/bin/$file.slx-bak", "/usr/bin/$file");
}
@@ -272,7 +293,7 @@ sub _writeWrapperScript
if ($kind ne "local") {
$script .= unshiftHereDoc(<<" End-of-Here");
export LD_LIBRARY_PATH=$vmpath/lib
- export GTK_PIXBUF_MODULE_FILE=$vmpath/libconf/etc/gtk-2.0/gdk-pixbuf.loaders
+ export GDK_PIXBUF_MODULE_FILE=$vmpath/libconf/etc/gtk-2.0/gdk-pixbuf.loaders
export GTK_IM_MODULE_FILE=$vmpath/libconf/etc/gtk-2.0/gtk.immodules
export FONTCONFIG_PATH=$vmpath/libconf/etc/fonts
export PANGO_RC_FILE=$vmpath/libconf/etc/pango/pangorc
@@ -299,12 +320,12 @@ sub _writeWrapperScript
}
}
-sub _wirteVmwareConfig {
+sub _writeVmwareConfig {
my $self = shift;
my $kind = shift;
my $vmpath = shift;
- my $config = "libdir = \"$vmpath\"";
+ my $config = "libdir = \"$vmpath\"\n";
spitFile("$self->{'pluginRepositoryPath'}/$kind/config", $config);
chmod 0755, "$self->{'pluginRepositoryPath'}/$kind/config";
@@ -396,20 +417,6 @@ sub _localInstallation
$self->_writeWrapperScript("$vmpath", "$kind", "player")
}
- ##
- ## replacement with our faster wrapper script
-
- # rename the default vmplayer script and copy it. remove function takes
- # care about plugin remove. We only need this part if vmplayer
- # or ws is installed on the local system
- rename("/usr/bin/vmplayer", "/usr/bin/vmplayer.slx-bak");
- copyFile("$self->{'pluginRepositoryPath'}/$kind/vmplayer", "/usr/bin");
- # the same with vmware, if ws is installed
- if (-e "/usr/bin/vmware") {
- rename("/usr/bin/vmware", "/usr/bin/vmware.slx-bak");
- copyFile("$self->{'pluginRepositoryPath'}/$kind/vmware", "/usr/bin");
- }
-
}
# else { TODO: errorhandling }
}
@@ -456,7 +463,7 @@ sub _vmpl2Installation {
##
## Creating needed config /etc/vmware/config
- $self->_wirteVmwareConfig("$kind", "$vmpath");
+ $self->_writeVmwareConfig("$kind", "$vmpath");
}