|
|
|
@ -1,16 +1,21 @@
@@ -1,16 +1,21 @@
|
|
|
|
|
#!/usr/bin/perl |
|
|
|
|
|
|
|
|
|
# ---------------------------------------------------------------------- |
|
|
|
|
# File: milkbone |
|
|
|
|
# ----------------------------------------------------------------------------- |
|
|
|
|
# milkbone |
|
|
|
|
# Desc: This file is the heart of milkbone. It brings up the core and calls |
|
|
|
|
# the appropriate guidance script. There's nothing too complicated happening |
|
|
|
|
# here; most of it ought to be self-explanatory. |
|
|
|
|
# Quote: "A beginning is the time for ensuring that the balances are correct" |
|
|
|
|
# - Princess Irulan, Dune |
|
|
|
|
# ---------------------------------------------------------------------- |
|
|
|
|
# Quote: "A beginning is the time for taking the most delicate care |
|
|
|
|
# that the balances are correct." |
|
|
|
|
# - Dune |
|
|
|
|
# ----------------------------------------------------------------------------- |
|
|
|
|
|
|
|
|
|
use strict; |
|
|
|
|
use warnings; |
|
|
|
|
|
|
|
|
|
# Load the core. This prepares @INC for guidance script detection, and |
|
|
|
|
# sets default values (e.g. $Milkbone::FatalLog). |
|
|
|
|
|
|
|
|
|
use lib 'lib'; |
|
|
|
|
use Milkbone; |
|
|
|
|
|
|
|
|
|
# Launch the correct guidance script based on the command-line parameters. |
|
|
|
@ -36,14 +41,20 @@ else {
@@ -36,14 +41,20 @@ else {
|
|
|
|
|
# something must have gone terribly wrong. Note that the guidance script |
|
|
|
|
# doesn't return until the user has closed milkbone. |
|
|
|
|
|
|
|
|
|
eval { |
|
|
|
|
require $target; |
|
|
|
|
}; |
|
|
|
|
my $script = slurp($target . ".pl", 1); |
|
|
|
|
$script = <<'END' . $script; |
|
|
|
|
use strict; |
|
|
|
|
use warnings; |
|
|
|
|
END |
|
|
|
|
|
|
|
|
|
eval $script; |
|
|
|
|
|
|
|
|
|
# Really serious exceptions will get logged into the file pointed to by |
|
|
|
|
# $Milkbone::FatalLog. |
|
|
|
|
|
|
|
|
|
if($@) { |
|
|
|
|
open(my $file, $Milkbone::FatalLog); |
|
|
|
|
print $file $a; |
|
|
|
|
close($file); |
|
|
|
|
print $@; |
|
|
|
|
open(my $log, ">" . $Milkbone::FatalLog); |
|
|
|
|
print $log "\n" . $@; |
|
|
|
|
close($log); |
|
|
|
|
} |
|
|
|
|