[prev] [thread] [next] [lurker] [Date index for 2004/03/23]
Author: richardc Date: 2004-03-23 00:20:25 +0000 (Tue, 23 Mar 2004) New Revision: 1494 Modified: trunk/mariachi/lib/Mariachi.pm Log: better error reporting, marginally less method overhead Modified: trunk/mariachi/lib/Mariachi.pm =================================================================== --- trunk/mariachi/lib/Mariachi.pm 2004-03-23 00:08:03 UTC (rev 1493) +++ trunk/mariachi/lib/Mariachi.pm 2004-03-23 00:20:25 UTC (rev 1494) @@ -393,6 +393,7 @@ my $again; do { my $file = $spool; + my $tmpfile = $self->config->output . "/$$.tmp"; $self->tt->process( $template, { @_, @@ -404,12 +405,13 @@ file => sub { $file }, set_again => sub { $again = shift; return }, set_file => sub { $file = shift; return }, }, - $self->config->output . "/$$.tmp" ) + $tmpfile ) or die $self->tt->error; - mkpath dirname $self->config->output . "/$file"; - move $self->config->output . "/$$.tmp", $self->config->output . "/$file" - or die "$!"; + my $new = $self->config->output . "/$file"; + mkpath dirname $new; + move $tmpfile, $new + or die "moving $tmpfile -> $new: $!"; } while $again; }
Generated at 13:57 on 01 Jul 2004 by mariachi 0.52