Radix cross Linux Toolchains

Toolchains for all supported by Radix cross Linux devices

42 Commits   1 Branch   8 Tags
Index: _kxLab.pm
===================================================================
--- _kxLab.pm	(nonexistent)
+++ _kxLab.pm	(revision 5)
@@ -0,0 +1,39 @@
+
+use strict;
+use warnings FATAL => 'all';
+
+package _kxLab;
+
+sub error
+{
+  my $message = shift;
+  my $func = shift;
+
+  print STDERR "Error: $message\n";
+  if( defined( $func ) )
+  {
+    &$func();
+  }
+  exit 1;
+}
+
+sub command_error
+{
+  my $command = shift;
+  my $context = shift;
+
+  error( "$command failed at @{$context}[1] line @{$context}[2]" );
+}
+
+sub system
+{
+  my $command = shift;
+
+  if( system( $command ) )
+  {
+    my @context = caller;
+    command_error($command, \@context);
+  }
+}
+
+1;