From 297822eae307ec08e29a660e4120a7700ca58ce7 Mon Sep 17 00:00:00 2001 From: Volker Uhrig Date: Wed, 23 Apr 2008 15:54:18 +0000 Subject: * 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 --- .../plugins/vmware/OpenSLX/OSPlugin/vmware.pm | 30 ++++++++++++++-------- 1 file changed, 20 insertions(+), 10 deletions(-) (limited to 'os-plugins/plugins') 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 = ; + 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 = ; + 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"); } -- cgit v1.2.3-55-g7522