[Bps-public-commit] r10758 - in Shipwright/lib/Shipwright: Script

sunnavy at bestpractical.com sunnavy at bestpractical.com
Thu Feb 7 04:03:12 EST 2008


Author: sunnavy
Date: Thu Feb  7 04:03:12 2008
New Revision: 10758

Modified:
   Shipwright/lib/Shipwright/Script.pm
   Shipwright/lib/Shipwright/Script/Build.pm
   Shipwright/lib/Shipwright/Script/Import.pm
   Shipwright/lib/Shipwright/Script/Initialize.pm
   Shipwright/lib/Shipwright/Script/Maintain.pm

Log:
modules below Script/ have log method now

Modified: Shipwright/lib/Shipwright/Script.pm
==============================================================================
--- Shipwright/lib/Shipwright/Script.pm	(original)
+++ Shipwright/lib/Shipwright/Script.pm	Thu Feb  7 04:03:12 2008
@@ -22,6 +22,15 @@
     return $self->SUPER::prepare(@_);
 }
 
+=head2 log
+=cut
+
+sub log {
+    my $self = shift;
+    Shipwright::Logger->new( $self );
+    return Log::Log4perl->get_logger( ref $self ) ;
+}
+
 1;
 
 __END__

Modified: Shipwright/lib/Shipwright/Script/Build.pm
==============================================================================
--- Shipwright/lib/Shipwright/Script/Build.pm	(original)
+++ Shipwright/lib/Shipwright/Script/Build.pm	Thu Feb  7 04:03:12 2008
@@ -4,7 +4,7 @@
 use strict;
 use Carp;
 
-use base qw/App::CLI::Command Class::Accessor::Fast/;
+use base qw/App::CLI::Command Class::Accessor::Fast Shipwright::Script/;
 __PACKAGE__->mk_accessors(
     qw/repository log_level install_base build_base skip skip_test only_test force/
 );

Modified: Shipwright/lib/Shipwright/Script/Import.pm
==============================================================================
--- Shipwright/lib/Shipwright/Script/Import.pm	(original)
+++ Shipwright/lib/Shipwright/Script/Import.pm	Thu Feb  7 04:03:12 2008
@@ -4,7 +4,7 @@
 use warnings;
 use Carp;
 
-use base qw/App::CLI::Command Class::Accessor::Fast/;
+use base qw/App::CLI::Command Class::Accessor::Fast Shipwright::Script/;
 __PACKAGE__->mk_accessors(
     qw/repository log_level comment source follow build_script require_yml
       name test_script extra_tests overwrite min_perl_version skip/
@@ -57,7 +57,7 @@
 
     if ( $self->name ) {
         if ( $self->name =~ /::/ ) {
-            warn "we saw '::' in the name, will treat it as '-'";
+            $self->log->warn("we saw '::' in the name, will treat it as '-'");
             my $name = $self->name;
             $name =~ s/::/-/g;
             $self->name( $name );
@@ -77,6 +77,7 @@
         skip             => $self->skip,
     );
 
+
     if ( $self->source ) {
 
         $self->source(
@@ -168,15 +169,16 @@
 
                     if ( $shipwright->backend->info( "dists/$dist" ) && !
                             $self->overwrite ) {
-                        warn
-"have $dist in repo already, skip it. use --overwrite to overwrite";
+                        $self->log->warn(
+"have $dist in repo already, skip it. use --overwrite to overwrite");
                         next;
                     }
 
                     my ($s) = grep { $_ eq $dist } @sources;
                     unless ($s) {
-                        warn "we don't have $dist in source which is for "
-                          . $self->source;
+                        $self->log->warn(
+                            "we don't have $dist in source which is for "
+                              . $self->source );
                         next;
                     }
 
@@ -253,7 +255,7 @@
         push @commands, "clean: make clean";
     }
     else {
-        warn "I have no idea how to build this distribution";
+        $self->log->warn( "I have no idea how to build this distribution" );
     }
 
     open my $fh, '>', File::Spec->catfile( $script_dir, 'build' ) or die $@;

Modified: Shipwright/lib/Shipwright/Script/Initialize.pm
==============================================================================
--- Shipwright/lib/Shipwright/Script/Initialize.pm	(original)
+++ Shipwright/lib/Shipwright/Script/Initialize.pm	Thu Feb  7 04:03:12 2008
@@ -4,7 +4,7 @@
 use warnings;
 use Carp;
 
-use base qw/App::CLI::Command Class::Accessor::Fast/;
+use base qw/App::CLI::Command Class::Accessor::Fast Shipwright::Script/;
 __PACKAGE__->mk_accessors(qw/repository log_level/);
 
 use Shipwright;

Modified: Shipwright/lib/Shipwright/Script/Maintain.pm
==============================================================================
--- Shipwright/lib/Shipwright/Script/Maintain.pm	(original)
+++ Shipwright/lib/Shipwright/Script/Maintain.pm	Thu Feb  7 04:03:12 2008
@@ -4,7 +4,7 @@
 use warnings;
 use Carp;
 
-use base qw/App::CLI::Command Class::Accessor::Fast/;
+use base qw/App::CLI::Command Class::Accessor::Fast Shipwright::Script/;
 __PACKAGE__->mk_accessors(
     qw/repository log_level update_order keep_recommends
       keep_build_requires keep_requires for_dists/



More information about the Bps-public-commit mailing list