From 2d0394696fea9aa61a7e4ee68d252740d56cfae4 Mon Sep 17 00:00:00 2001 From: Bastian Wissler Date: Thu, 26 Feb 2009 17:13:26 +0000 Subject: xserver plugin: * fixed wrong usage of unlink function git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@2646 95ad53e4-c205-0410-b2fa-d234c58c8868 --- .../plugins/xserver/OpenSLX/OSPlugin/xserver.pm | 25 ++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'os-plugins/plugins') diff --git a/os-plugins/plugins/xserver/OpenSLX/OSPlugin/xserver.pm b/os-plugins/plugins/xserver/OpenSLX/OSPlugin/xserver.pm index e4c63736..26dfc395 100644 --- a/os-plugins/plugins/xserver/OpenSLX/OSPlugin/xserver.pm +++ b/os-plugins/plugins/xserver/OpenSLX/OSPlugin/xserver.pm @@ -229,15 +229,16 @@ sub installationPhase my $binDrivers = 0; my $engine = $self->{'os-plugin-engine'}; + # removeLinks is to remove Links to the files + # otherwise some wrong files are created + # this can happed here + $self->removeLinks(); if ($attrs->{'xserver::nvidia'} == 1 || $attrs->{'xserver::ati'} == 1 ) { copyFile("$pluginFilesPath/ubuntu-gfx-install.sh", "$installationPath"); copyFile("$pluginFilesPath/suse-gfx-install.sh", "$installationPath"); copyFile("$pluginFilesPath/ubuntu-8.10-gfx-install.sh", "$installationPath"); - # removeLinks is to remove Links to the files - # otherwise some wrong files are created - $self->removeLinks(); $binDrivers = 1; } if ($attrs->{'xserver::ati'} == 1) { @@ -415,7 +416,23 @@ sub removeLinks symlink "/usr/lib/libGL.so.1.2", "/usr/lib/libGL.so.1"; symlink "/usr/lib/libGL.so.1.2", "/usr/lib/libGL.so"; - my $number = unlink @linkedFiles; + + foreach my $file (@linkedFiles) { + chomp($file); + unlink $file; + } + + # this should not print any file at all ;-( + my @files = `find $instFolders -lname "$divertFolder*" -o -lname "$pluginFolder*" `; + if ( $#files > 0 ) { + print "Links were not removed properly! Exiting!\n"; + my $bla; + foreach (@files) { + chomp($bla = $_); + print $bla; + } + exit(1); + } return; } -- cgit v1.2.3-55-g7522