diff options
author | Oliver Tappe | 2007-03-12 19:21:52 +0100 |
---|---|---|
committer | Oliver Tappe | 2007-03-12 19:21:52 +0100 |
commit | 3589e7ccfef5f4c4bd1fe63707f33993f16b5e52 (patch) | |
tree | da5452a10e877e7cd0b4193b0445127209210f09 /installer/OpenSLX/OSSetup/Engine.pm | |
parent | * added Utils.pm that contains helpful functions used throughout OpenSLX (diff) | |
download | core-3589e7ccfef5f4c4bd1fe63707f33993f16b5e52.tar.gz core-3589e7ccfef5f4c4bd1fe63707f33993f16b5e52.tar.xz core-3589e7ccfef5f4c4bd1fe63707f33993f16b5e52.zip |
* now uses OpenSLX::Utils
git-svn-id: http://svn.openslx.org/svn/openslx/trunk@759 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'installer/OpenSLX/OSSetup/Engine.pm')
-rw-r--r-- | installer/OpenSLX/OSSetup/Engine.pm | 56 |
1 files changed, 2 insertions, 54 deletions
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 = <F>; - close(F); - return $text; -} - sub string2Array { my $str = shift; |