diff options
author | Oliver Tappe | 2007-07-01 22:28:50 +0200 |
---|---|---|
committer | Oliver Tappe | 2007-07-01 22:28:50 +0200 |
commit | 6974fa8b0419bbd0711f79c8b78e07a9543810dd (patch) | |
tree | 25141f0f4d20ca8fdb1c845edf5b9ce4b24a6e98 /lib/OpenSLX/ConfigFolder.pm | |
parent | Tried to add Ubuntu 7.04 to the list of cloneable systems. (diff) | |
download | core-6974fa8b0419bbd0711f79c8b78e07a9543810dd.tar.gz core-6974fa8b0419bbd0711f79c8b78e07a9543810dd.tar.xz core-6974fa8b0419bbd0711f79c8b78e07a9543810dd.zip |
* activated 'use warnings' to all modules and adjusted all occurences of
'use of uninitialized values', a couple of which might still show up
* adjusted all code with respect to passing perlcritic level 4 and 5
git-svn-id: http://svn.openslx.org/svn/openslx/trunk@1207 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'lib/OpenSLX/ConfigFolder.pm')
-rw-r--r-- | lib/OpenSLX/ConfigFolder.pm | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/lib/OpenSLX/ConfigFolder.pm b/lib/OpenSLX/ConfigFolder.pm index 0c957ef5..de2df73f 100644 --- a/lib/OpenSLX/ConfigFolder.pm +++ b/lib/OpenSLX/ConfigFolder.pm @@ -14,7 +14,9 @@ package OpenSLX::ConfigFolder; use strict; -use vars qw(@ISA @EXPORT $VERSION); +use warnings; + +our (@ISA, @EXPORT, $VERSION); use Exporter; $VERSION = 1.01; @@ -30,6 +32,7 @@ $VERSION = 1.01; ################################################################################ use Carp; use OpenSLX::Basics; +use OpenSLX::Utils; sub createConfigFolderForDefaultSystem { @@ -47,29 +50,22 @@ sub createConfigFolderForDefaultSystem # create default pre-/postinit scripts for us in initramfs: my $preInitFile = "$defaultConfigPath/initramfs/preinit.local"; if (!-e $preInitFile) { - open(PREINIT, "> $preInitFile") - or die _tr("Unable to create file '%s'!", $preInitFile); - my $preInit = <<' END' + 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 - ; - $preInit =~ s[^\s+][]igms; - print PREINIT $preInit; - close(PREINIT); + END-of-HERE + spitFile($preInitFile, $preInit); slxsystem("chmod u+x $preInitFile"); $result = 1; } my $postInitFile = "$defaultConfigPath/initramfs/postinit.local"; if (!-e $postInitFile) { - open(POSTINIT, "> $postInitFile") - or die _tr("Unable to create file '%s'!", $postInitFile); - my $postInit = <<' END' + my $postInit = unshiftHereDoc(<<' END-of-HERE'); #!/bin/sh # # This script allows the local admin to extend the @@ -78,11 +74,8 @@ sub createConfigFolderForDefaultSystem # that stage4 rootfs has the prefix '/mnt'. # But you may use some special slx-functions available via # inclusion: '. /etc/functions' ... - END - ; - $postInit =~ s[^\s+][]igms; - print POSTINIT $postInit; - close(POSTINIT); + END-of-HERE + spitFile($postInitFile, $postInit); slxsystem("chmod u+x $postInitFile"); $result = 1; } |