From 03db5fcadee81bd5ce66665f18b611e106783c27 Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Thu, 15 Mar 2007 21:41:10 +0000 Subject: * largish overhaul, changed ConfigDB to be object-oriented (could be improved, though!) * slxos-setup, slxos-export, slxconfig and slxconfig-demuxer can now be run one after the other in order to get a complete setup * still problems when trying to boot that system here, need to investigate... git-svn-id: http://svn.openslx.org/svn/openslx/trunk@774 95ad53e4-c205-0410-b2fa-d234c58c8868 --- lib/OpenSLX/Basics.pm | 19 ++++++++++++++++++- lib/OpenSLX/Utils.pm | 1 + 2 files changed, 19 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/OpenSLX/Basics.pm b/lib/OpenSLX/Basics.pm index 9c5b0b6c..b1e052a4 100644 --- a/lib/OpenSLX/Basics.pm +++ b/lib/OpenSLX/Basics.pm @@ -15,7 +15,7 @@ $VERSION = 1.01; @EXPORT = qw( &openslxInit %openslxConfig %cmdlineConfig - &_tr &trInit + &_tr &trInit die &vlog ); @@ -29,6 +29,8 @@ use FindBin; use Getopt::Long; use POSIX qw(locale_h); +my $DEBUG = 0; + my %translations; # this hash will hold the active openslx configuration, @@ -271,4 +273,19 @@ sub _tr return sprintf($formatStr, @_); } +# ------------------------------------------------------------------------------ +sub die +{ + my $msg = shift; + if ($DEBUG) { + print STDERR "*** "; + croak $msg; + } else { + $msg =~ s[^][!!! ]igms; + chomp $msg; + print STDERR "$msg\n"; + exit $!; + } +} + 1; \ No newline at end of file diff --git a/lib/OpenSLX/Utils.pm b/lib/OpenSLX/Utils.pm index a6048621..0980a7c0 100644 --- a/lib/OpenSLX/Utils.pm +++ b/lib/OpenSLX/Utils.pm @@ -22,6 +22,7 @@ $VERSION = 1.01; ################################################################################ use Carp; use OpenSLX::Basics; +use File::Basename; sub copyFile { -- cgit v1.2.3-55-g7522