Should &shell() be deprecated? It looks awfully similar to &executable().
-Ethan On Tue, Sep/29/2009 08:34:44AM, mi...@osl.iu.edu wrote: > Author: miked > Date: 2009-09-29 08:34:44 EDT (Tue, 29 Sep 2009) > New Revision: 1320 > URL: https://svn.open-mpi.org/trac/mtt/changeset/1320 > > Log: > applied Jeff,Ethan comments: > 1. rename on_stop,on_start to after_mtt_start_exec, before_mtt_start_exec > 2. treat *_mtt_start_exec params in the same way like others before/after_* > params > 3. rename shell_script to executable > 4. fix DoCommand:CmdScript() to recognize shebang chars and do not add ":\n" > if #!.... is present > > > Text files modified: > trunk/client/mtt | 15 +++++++++++++-- > > trunk/lib/MTT/DoCommand.pm | 5 +++-- > > trunk/lib/MTT/Values/Functions.pm | 2 +- > > 3 files changed, 17 insertions(+), 5 deletions(-) > > Modified: trunk/client/mtt > ============================================================================== > --- trunk/client/mtt (original) > +++ trunk/client/mtt 2009-09-29 08:34:44 EDT (Tue, 29 Sep 2009) > @@ -496,7 +496,8 @@ > MTT::Lock::Init($ini); > > # execute on_start callback if exists > - _process_get_value_option("mtt,on_start", $ini); > + _do_step($ini, "mtt", "before_mtt_start_exec"); > + > > # Set the logfile, if specified > > @@ -565,7 +566,7 @@ > } > > # execute on_stop callback if exists > - _process_get_value_option("mtt,on_stop", $ini); > + _do_step($ini, "mtt", "after_mtt_start_exec"); > > # Shut down locks > > @@ -737,3 +738,13 @@ > print "$value\n"; > } > } > + > +# Run cmd, specified in the non Test* sections > +sub _do_step { > + my ($ini, $section,$param) = @_; > + my $cmd = $ini->val($section, $param); > + if ( defined $cmd ) { > + my $x = MTT::DoCommand::RunStep(1, $cmd, -1, $ini, $section, > $param); > + Verbose(" Output: $x->{result_stdout}\n") > + } > +} > > Modified: trunk/lib/MTT/DoCommand.pm > ============================================================================== > --- trunk/lib/MTT/DoCommand.pm (original) > +++ trunk/lib/MTT/DoCommand.pm 2009-09-29 08:34:44 EDT (Tue, 29 Sep > 2009) > @@ -794,9 +794,10 @@ > # protects against a common funclet syntax error. > # We can safely do this since "foo" (literally, with > # quotes included) would never be a valid shell command. > - $cmds =~ s/\"$// > - if ($cmds =~ s/^\"//); > + $cmds =~ s/\"$// if ($cmds =~ s/^\"//); > > + > + print $fh ":\n" if ($cmds !~ /^\s*\#\!/); # no shell specified - use > default > print $fh "$cmds\n"; > close($fh); > chmod(0700, $filename); > > Modified: trunk/lib/MTT/Values/Functions.pm > ============================================================================== > --- trunk/lib/MTT/Values/Functions.pm (original) > +++ trunk/lib/MTT/Values/Functions.pm 2009-09-29 08:34:44 EDT (Tue, 29 Sep > 2009) > @@ -3038,7 +3038,7 @@ > # > # > > -sub shell_script { > +sub executable { > my ($cmd_section, $cmd_param) = @_; > my $cmd = &get_ini_val($cmd_section, $cmd_param); > my $x = MTT::DoCommand::CmdScript(1, $cmd); > _______________________________________________ > mtt-svn mailing list > mtt-...@open-mpi.org > http://www.open-mpi.org/mailman/listinfo.cgi/mtt-svn