diff options
author | Oliver Tappe | 2007-04-30 23:29:01 +0200 |
---|---|---|
committer | Oliver Tappe | 2007-04-30 23:29:01 +0200 |
commit | 587a7a37f8abb4bea89e9fc669b787bc998ede86 (patch) | |
tree | 507180394ed18cf422ad6790903f77b5d1ad78a4 /lib | |
parent | * changed numbering scheme of initramfs from letters to numbers, in order to (diff) | |
download | core-587a7a37f8abb4bea89e9fc669b787bc998ede86.tar.gz core-587a7a37f8abb4bea89e9fc669b787bc998ede86.tar.xz core-587a7a37f8abb4bea89e9fc669b787bc998ede86.zip |
* improved die() and warn() to fall back to the respective CORE-functions unless croaking
has been requested.
git-svn-id: http://svn.openslx.org/svn/openslx/trunk@970 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'lib')
-rw-r--r-- | lib/OpenSLX/Basics.pm | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/lib/OpenSLX/Basics.pm b/lib/OpenSLX/Basics.pm index 3159afa0..6a23d8c0 100644 --- a/lib/OpenSLX/Basics.pm +++ b/lib/OpenSLX/Basics.pm @@ -37,7 +37,7 @@ use Carp::Heavy; # use it here to have it loaded immediately, not at the time when # carp() is being invoked (which might be at a point in time where # the script executes in a chrooted environment, such that the module - # can't be loaded anymore). + # can't be loaded anymore). use FindBin; use Getopt::Long; use POSIX qw(locale_h); @@ -329,13 +329,13 @@ sub slxsystem sub warn { my $msg = shift; + $msg =~ s[^\*\*\* ][]igms; + $msg =~ s[^][*** ]igms; if ($openslxConfig{'croak'}) { - print STDERR "*** "; carp $msg; } else { - $msg =~ s[^][*** ]igms; chomp $msg; - print STDERR "$msg\n"; + CORE::warn "$msg\n"; } } @@ -343,15 +343,13 @@ sub warn sub die { my $msg = shift; + $msg =~ s[^\*\*\* ][]igms; + $msg =~ s[^][*** ]igms; if ($openslxConfig{'croak'}) { - print STDERR "*** "; croak $msg; } else { - $msg =~ s[^][*** ]igms; chomp $msg; - print STDERR "$msg\n"; - exit 5 unless ($!); - exit $!; + CORE::die "$msg\n"; } } |