summaryrefslogtreecommitdiffstats
path: root/lib/OpenSLX/Basics.pm
diff options
context:
space:
mode:
authorOliver Tappe2007-03-15 22:41:10 +0100
committerOliver Tappe2007-03-15 22:41:10 +0100
commit03db5fcadee81bd5ce66665f18b611e106783c27 (patch)
tree1071ff956228157c52fbd5b5087ca8928b37d0f9 /lib/OpenSLX/Basics.pm
parent* removed 'nbd' from supported export types as I have learned from Dirk yeste... (diff)
downloadcore-03db5fcadee81bd5ce66665f18b611e106783c27.tar.gz
core-03db5fcadee81bd5ce66665f18b611e106783c27.tar.xz
core-03db5fcadee81bd5ce66665f18b611e106783c27.zip
* 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
Diffstat (limited to 'lib/OpenSLX/Basics.pm')
-rw-r--r--lib/OpenSLX/Basics.pm19
1 files changed, 18 insertions, 1 deletions
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