[Bps-public-commit] Shipwright branch, master, updated. cdd0f18d8b1d918dd0f59d34685988d08e9f7801
sunnavy at bestpractical.com
sunnavy at bestpractical.com
Sun Apr 26 04:51:20 EDT 2009
The branch, master has been updated
via cdd0f18d8b1d918dd0f59d34685988d08e9f7801 (commit)
from bf5a8c736428b93e8ed25b9f647381a63a8789d8 (commit)
Summary of changes:
lib/Shipwright/Backend/Git.pm | 5 +++++
lib/Shipwright/Util.pm | 11 +++++------
2 files changed, 10 insertions(+), 6 deletions(-)
- Log -----------------------------------------------------------------
commit cdd0f18d8b1d918dd0f59d34685988d08e9f7801
Author: sunnavy <sunnavy at gmail.com>
Date: Sun Apr 26 16:51:12 2009 +0800
comment
diff --git a/lib/Shipwright/Backend/Git.pm b/lib/Shipwright/Backend/Git.pm
index dbf9e76..f564b74 100644
--- a/lib/Shipwright/Backend/Git.pm
+++ b/lib/Shipwright/Backend/Git.pm
@@ -142,6 +142,11 @@ sub DESTROY {
my $self = shift;
my $cwd = getcwd;
chdir $self->cloned_dir;
+
+ Shipwright::Logger->_initialize_log4perl(
+ log_level => $self->{log_level},
+ log_file => $self->{log_file}
+ );
Shipwright::Util->run( [ $ENV{'SHIPWRIGHT_GIT'}, 'add', '.' ] );
#TODO comment need to be something special
Shipwright::Util->run(
diff --git a/lib/Shipwright/Util.pm b/lib/Shipwright/Util.pm
index 58b0812..dec1318 100644
--- a/lib/Shipwright/Util.pm
+++ b/lib/Shipwright/Util.pm
@@ -55,21 +55,20 @@ sub run {
my $cmd = shift;
my $ignore_failure = shift;
- my $log; # = Log::Log4perl->get_logger('Shipwright::Util');
+ my $log = Log::Log4perl->get_logger('Shipwright::Util');
my ( $out, $err );
- $log->info( "run cmd: " . join ' ', @$cmd ) if $log;
+ $log->info( "run cmd: " . join ' ', @$cmd );
Shipwright::Util->select('null');
run3( $cmd, \*STDIN, \$out, \$err );
Shipwright::Util->select('stdout');
- $log->debug("run output:\n$out") if $out && $log;
- $log->error("run err:\n$err") if $err && $log;
+ $log->debug("run output:\n$out") if $out;
+ $log->error("run err:\n$err") if $err;
if ($?) {
$log->error(
- 'failed to run ' . join( ' ', @$cmd ) . " with exit number $?" )
- if $log;
+ 'failed to run ' . join( ' ', @$cmd ) . " with exit number $?" );
unless ($ignore_failure) {
confess <<"EOF";
something wrong when execute @$cmd: $?
-----------------------------------------------------------------------
More information about the Bps-public-commit
mailing list