From a0ce0340d0f95514008cfac751fe58748bbadd88 Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Thu, 20 Mar 2008 00:04:16 +0000 Subject: * Switched indent used in Perl-code and settings files from tabs to 4 spaces. May need some manual corrections here and there, but should basically be ok. git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@1658 95ad53e4-c205-0410-b2fa-d234c58c8868 --- lib/OpenSLX/ConfigFolder.pm | 116 ++++++++++++++++++++++---------------------- 1 file changed, 58 insertions(+), 58 deletions(-) (limited to 'lib/OpenSLX/ConfigFolder.pm') diff --git a/lib/OpenSLX/ConfigFolder.pm b/lib/OpenSLX/ConfigFolder.pm index 99289881..e8c3ee8f 100644 --- a/lib/OpenSLX/ConfigFolder.pm +++ b/lib/OpenSLX/ConfigFolder.pm @@ -9,7 +9,7 @@ # General information about OpenSLX can be found at http://openslx.org/ # ----------------------------------------------------------------------------- # ConfigFolder.pm -# - provides utility functions for generation of configuration folders +# - provides utility functions for generation of configuration folders # ----------------------------------------------------------------------------- package OpenSLX::ConfigFolder; @@ -23,8 +23,8 @@ $VERSION = 1.01; @ISA = qw(Exporter); @EXPORT = qw( - &createConfigFolderForDefaultSystem - &createConfigFolderForSystem + &createConfigFolderForDefaultSystem + &createConfigFolderForSystem ); ################################################################################ @@ -35,68 +35,68 @@ use OpenSLX::Utils; sub createConfigFolderForDefaultSystem { - my $result = 0; - my $defaultConfigPath = "$openslxConfig{'private-path'}/config/default"; - if (!-e "$defaultConfigPath/initramfs") { - slxsystem("mkdir -p $defaultConfigPath/initramfs"); - $result = 1; - } - if (!-e "$defaultConfigPath/rootfs") { - slxsystem("mkdir -p $defaultConfigPath/rootfs"); - $result = 1; - } + my $result = 0; + my $defaultConfigPath = "$openslxConfig{'private-path'}/config/default"; + if (!-e "$defaultConfigPath/initramfs") { + slxsystem("mkdir -p $defaultConfigPath/initramfs"); + $result = 1; + } + if (!-e "$defaultConfigPath/rootfs") { + slxsystem("mkdir -p $defaultConfigPath/rootfs"); + $result = 1; + } - # create default pre-/postinit scripts for us in initramfs: - my $preInitFile = "$defaultConfigPath/initramfs/preinit.local"; - if (!-e $preInitFile) { - my $preInit = unshiftHereDoc(<<' END-of-HERE'); - #!/bin/sh - # - # This script allows the local admin to extend the - # capabilities at the beginning of the initramfs (stage3). - # The toolset is rather limited and you have to keep in mind - # that stage4 rootfs has the prefix '/mnt'. - END-of-HERE - spitFile($preInitFile, $preInit); - slxsystem("chmod u+x $preInitFile"); - $result = 1; - } + # create default pre-/postinit scripts for us in initramfs: + my $preInitFile = "$defaultConfigPath/initramfs/preinit.local"; + if (!-e $preInitFile) { + my $preInit = unshiftHereDoc(<<' END-of-HERE'); + #!/bin/sh + # + # This script allows the local admin to extend the + # capabilities at the beginning of the initramfs (stage3). + # The toolset is rather limited and you have to keep in mind + # that stage4 rootfs has the prefix '/mnt'. + END-of-HERE + spitFile($preInitFile, $preInit); + slxsystem("chmod u+x $preInitFile"); + $result = 1; + } - my $postInitFile = "$defaultConfigPath/initramfs/postinit.local"; - if (!-e $postInitFile) { - my $postInit = unshiftHereDoc(<<' END-of-HERE'); - #!/bin/sh - # - # This script allows the local admin to extend the - # capabilities at the end of the initramfs (stage3). - # The toolset is rather limited and you have to keep in mind - # that stage4 rootfs has the prefix '/mnt'. - # But you may use some special slx-functions available via - # inclusion: '. /etc/functions' ... - END-of-HERE - spitFile($postInitFile, $postInit); - slxsystem("chmod u+x $postInitFile"); - $result = 1; - } - return $result; + my $postInitFile = "$defaultConfigPath/initramfs/postinit.local"; + if (!-e $postInitFile) { + my $postInit = unshiftHereDoc(<<' END-of-HERE'); + #!/bin/sh + # + # This script allows the local admin to extend the + # capabilities at the end of the initramfs (stage3). + # The toolset is rather limited and you have to keep in mind + # that stage4 rootfs has the prefix '/mnt'. + # But you may use some special slx-functions available via + # inclusion: '. /etc/functions' ... + END-of-HERE + spitFile($postInitFile, $postInit); + slxsystem("chmod u+x $postInitFile"); + $result = 1; + } + return $result; } sub createConfigFolderForSystem { - my $systemName = shift || confess "need to pass in system-name!"; + my $systemName = shift || confess "need to pass in system-name!"; - my $result = 0; - my $systemConfigPath - = "$openslxConfig{'private-path'}/config/$systemName/default"; - if (!-e "$systemConfigPath/initramfs") { - slxsystem("mkdir -p $systemConfigPath/initramfs"); - $result = 1; - } - if (!-e "$systemConfigPath/rootfs") { - slxsystem("mkdir -p $systemConfigPath/rootfs"); - $result = 1; - } - return $result; + my $result = 0; + my $systemConfigPath + = "$openslxConfig{'private-path'}/config/$systemName/default"; + if (!-e "$systemConfigPath/initramfs") { + slxsystem("mkdir -p $systemConfigPath/initramfs"); + $result = 1; + } + if (!-e "$systemConfigPath/rootfs") { + slxsystem("mkdir -p $systemConfigPath/rootfs"); + $result = 1; + } + return $result; } 1; -- cgit v1.2.3-55-g7522