From 16e369e137b2e800fc36f3d2005d959f785100ee Mon Sep 17 00:00:00 2001 From: fukachan Date: Sun, 14 Oct 2001 03:08:59 +0000 Subject: sync style w/ Process::Command --- fml/lib/FML/Process/Configure.pm | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/fml/lib/FML/Process/Configure.pm b/fml/lib/FML/Process/Configure.pm index 5168d56a..92216d27 100644 --- a/fml/lib/FML/Process/Configure.pm +++ b/fml/lib/FML/Process/Configure.pm @@ -4,7 +4,7 @@ # Copyright (C) 2000,2001 Ken'ichi Fukamachi # All rights reserved. # -# $FML: Configure.pm,v 1.25 2001/08/26 08:41:58 fukachan Exp $ +# $FML: Configure.pm,v 1.26 2001/10/14 00:58:41 fukachan Exp $ # package FML::Process::Configure; @@ -171,7 +171,8 @@ sub _makefml # arguments to pass off to each method my $command_args = { command_mode => 'admin', - command => $method, + comname => $method, + command => "$method @options", ml_name => $ml_name, options => \@options, argv => $argv, @@ -181,7 +182,24 @@ sub _makefml # here we go require FML::Command; my $obj = new FML::Command; - $obj->$method($curproc, $command_args); + + if (defined $obj) { + # execute command ($comname method) under eval(). + eval q{ + $obj->$method($curproc, $command_args); + }; + unless ($@) { + ; # not show anything + } + else { + LogError("command $method fail"); + if ($@ =~ /^(.*)\s+at\s+/) { + my $reason = $1; + Log($reason); # pick up reason + croak($reason); + } + } + } } -- cgit v1.2.1