From 3589e7ccfef5f4c4bd1fe63707f33993f16b5e52 Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Mon, 12 Mar 2007 18:21:52 +0000 Subject: * now uses OpenSLX::Utils git-svn-id: http://svn.openslx.org/svn/openslx/trunk@759 95ad53e4-c205-0410-b2fa-d234c58c8868 --- installer/OpenSLX/OSSetup/Engine.pm | 56 ++----------------------------------- 1 file changed, 2 insertions(+), 54 deletions(-) (limited to 'installer/OpenSLX/OSSetup/Engine.pm') diff --git a/installer/OpenSLX/OSSetup/Engine.pm b/installer/OpenSLX/OSSetup/Engine.pm index 7b9b4b13..a804632f 100644 --- a/installer/OpenSLX/OSSetup/Engine.pm +++ b/installer/OpenSLX/OSSetup/Engine.pm @@ -20,6 +20,7 @@ use strict; use Carp; use File::Basename; use OpenSLX::Basics; +use OpenSLX::Utils; use vars qw(%supportedDistros); @@ -75,7 +76,7 @@ sub initialize { my $self = shift; my $distroName = shift; - my $selectionName = shift; + my $selectionName = shift || 'default'; my $protectSystemPath = shift; my $cloneMode = shift; @@ -714,59 +715,6 @@ sub clone_fetchSource ################################################################################ ### utility functions ################################################################################ -sub copyFile -{ - my $fileName = shift; - my $dirName = shift; - - my $baseName = basename($fileName); - my $targetName = "$dirName/$baseName"; - if (!-e $targetName) { - my $targetDir = dirname($targetName); - system("mkdir -p $targetDir") unless -d $targetDir; - if (system("cp -p $fileName $targetDir/")) { - die _tr("unable to copy file '%s' to dir '%s' (%s)", - $fileName, $targetDir, $!); - } - } -} - -sub fakeFile -{ - my $fullPath = shift; - - my $targetDir = dirname($fullPath); - system("mkdir", "-p", $targetDir) unless -d $targetDir; - if (system("touch", $fullPath)) { - die _tr("unable to create file '%s' (%s)", - $fullPath, $!); - } -} - -sub linkFile -{ - my $linkTarget = shift; - my $linkName = shift; - - my $targetDir = dirname($linkName); - system("mkdir -p $targetDir") unless -d $targetDir; - if (system("ln -s $linkTarget $linkName")) { - die _tr("unable to create link '%s' to '%s' (%s)", - $linkName, $linkTarget, $!); - } -} - -sub slurpFile -{ - my $file = shift; - open(F, "< $file") - or die _tr("could not open file '%s' for reading! (%s)", $file, $!); - $/ = undef; - my $text = ; - close(F); - return $text; -} - sub string2Array { my $str = shift; -- cgit v1.2.3-55-g7522