diff options
author | Volker Uhrig | 2008-04-23 17:54:18 +0200 |
---|---|---|
committer | Volker Uhrig | 2008-04-23 17:54:18 +0200 |
commit | 297822eae307ec08e29a660e4120a7700ca58ce7 (patch) | |
tree | 8170e7d3d3c45f87e3555f1d2f32faa8529c1291 /os-plugins/plugins/vmware/OpenSLX/OSPlugin/vmware.pm | |
parent | added username tag (diff) | |
download | core-297822eae307ec08e29a660e4120a7700ca58ce7.tar.gz core-297822eae307ec08e29a660e4120a7700ca58ce7.tar.xz core-297822eae307ec08e29a660e4120a7700ca58ce7.zip |
* changed version identification of local installed vmplayer
or vmware ws
git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@1756 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 | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/os-plugins/plugins/vmware/OpenSLX/OSPlugin/vmware.pm b/os-plugins/plugins/vmware/OpenSLX/OSPlugin/vmware.pm index 54231189..b9225f23 100644 --- a/os-plugins/plugins/vmware/OpenSLX/OSPlugin/vmware.pm +++ b/os-plugins/plugins/vmware/OpenSLX/OSPlugin/vmware.pm @@ -211,22 +211,32 @@ sub installationPhase # version of local if(-e "/usr/lib/vmware/bin/vmware"){ $vmfile = "vmware"; - # should be replaced with perl code (grepping in a textfile - # shouldn't be that complicated :)) - $vmversion = - qx(strings /usr/lib/vmware/bin/vmplayer| - grep -m 1 "build-"| sed "s,.*build-,,"); - chomp($vmversion); + # get version. read it out of the binary + open(FH, "/usr/lib/vmware/bin/vmware"); + $/ = undef; + my $data = <FH>; + close FH; + #TODO: add the else case, if we cant find this string + if ($data =~ m{(\d\.\d)\.\d build-(\d)+}) { + $vmversion = $1; + } + print "DEBUG: vmware ws version: $vmversion\n"; rename ("/usr/bin/$vmfile", "/usr/bin/$vmfile.slx-bak"); linkFile("/var/X11R6/bin/$vmfile", "/usr/bin/$vmfile"); - } elsif (-e "/usr/lib/vmware/bin/vmware") { + } elsif (-e "/usr/lib/vmware/bin/vmplayer") { $vmfile = "vmplayer"; # dublicate of test for vmware - should be put into a function, # e.g. in one which decides if workstation or player too ... - $vmversion = - qx(strings /usr/lib/vmware/bin/vmplayer| - grep -m 1 "build-"| sed "s,.*build-,,"); + open(FH, "/usr/lib/vmware/bin/vmplayer"); + $/ = undef; + my $data = <FH>; + close FH; + #TODO: add the else case, if we cant find this string + if ($data =~ m{(\d\.\d)\.\d build-(\d)+}) { + $vmversion = $1; + } chomp($vmversion); + print "DEBUG: vmplayer version: $vmversion\n"; rename ("/usr/bin/$vmfile", "/usr/bin/$vmfile.slx-bak"); linkFile("/var/X11R6/bin/$vmfile", "/usr/bin/$vmfile"); } |