[Bps-public-commit] Shipwright branch, master, updated. e428bf5758d1207bdbfd2190f30fafb7f50db578
? sunnavy
sunnavy at bestpractical.com
Mon Jun 6 02:23:21 EDT 2011
The branch, master has been updated
via e428bf5758d1207bdbfd2190f30fafb7f50db578 (commit)
from 7c6426ff4cee8c48afe5029e0e3df4f67ad42e05 (commit)
Summary of changes:
lib/Shipwright/Backend/Base.pm | 38 ++++++++++++++--------------------
lib/Shipwright/Backend/Git.pm | 2 +-
lib/Shipwright/Script/Import.pm | 12 +++++-----
lib/Shipwright/Source/Base.pm | 16 +++++++-------
lib/Shipwright/Source/CPAN.pm | 4 +-
lib/Shipwright/Source/Compressed.pm | 2 +-
lib/Shipwright/Source/Directory.pm | 4 +--
lib/Shipwright/Source/FTP.pm | 2 +-
lib/Shipwright/Source/Git.pm | 2 +-
lib/Shipwright/Source/HTTP.pm | 2 +-
lib/Shipwright/Source/SVK.pm | 2 +-
lib/Shipwright/Source/SVN.pm | 2 +-
lib/Shipwright/Source/Shipyard.pm | 2 +-
lib/Shipwright/Util.pm | 6 ++--
14 files changed, 44 insertions(+), 52 deletions(-)
- Log -----------------------------------------------------------------
commit e428bf5758d1207bdbfd2190f30fafb7f50db578
Author: sunnavy <sunnavy at bestpractical.com>
Date: Mon Jun 6 14:23:02 2011 +0800
tweak log msg: make them consistent
diff --git a/lib/Shipwright/Backend/Base.pm b/lib/Shipwright/Backend/Base.pm
index f5a16b1..46df44a 100644
--- a/lib/Shipwright/Backend/Base.pm
+++ b/lib/Shipwright/Backend/Base.pm
@@ -218,7 +218,7 @@ sub import {
if ( $args{_extra_tests} ) {
$self->delete( path => "/t/extra" ) if $args{delete};
- $self->log->info( "import extra tests to " . $self->repository );
+ $self->log->info( "importing extra tests to " . $self->repository );
for my $cmd ( $self->_cmd( import => %args, name => $name ) ) {
run_cmd($cmd);
}
@@ -227,15 +227,13 @@ sub import {
if ( $self->info( path => "/scripts/$name" )
&& not $args{overwrite} )
{
- $self->log->warn(
-"path /scripts/$name alreay exists, need to set overwrite arg to overwrite"
- );
+ $self->log->warn("/scripts/$name exists already");
}
else {
$self->delete( path => "/scripts/$name" ) if $args{delete};
- $self->log->info(
- "import $args{source}'s scripts to " . $self->repository );
+ $self->log->info( "importing $args{source}'s scripts to "
+ . $self->repository );
for my $cmd ( $self->_cmd( import => %args, name => $name ) ) {
run_cmd($cmd);
}
@@ -248,15 +246,13 @@ sub import {
if ( $self->info( path => "/sources/$name/$args{as}" )
&& not $args{overwrite} )
{
- $self->log->warn(
-"path sources/$name/$args{as} alreay exists, need to set overwrite arg to overwrite"
- );
+ $self->log->warn( "sources/$name/$args{as} exists already" );
}
else {
$self->delete( path => "/sources/$name/$args{as}" )
if $args{delete};
$self->log->info(
- "import $args{source} to " . $self->repository );
+ "importing $args{source} to " . $self->repository );
$self->_add_to_order($name);
my $version = $self->version;
@@ -301,14 +297,12 @@ sub import {
if ( $self->info( path => "/dists/$name" )
&& not $args{overwrite} )
{
- $self->log->warn(
-"path dists/$name alreay exists, need to set overwrite arg to overwrite"
- );
+ $self->log->warn( "dists/$name exists already" );
}
else {
$self->delete( path => "/dists/$name" ) if $args{delete};
$self->log->info(
- "import $args{source} to " . $self->repository );
+ "importing $args{source} to " . $self->repository );
$self->_add_to_order($name);
my $version = $self->version;
@@ -341,7 +335,7 @@ sub export {
my %args = @_;
my $path = $args{path} || '';
$self->log->info(
- 'export ' . $self->repository . "/$path to $args{target}" );
+ 'exporting ' . $self->repository . "/$path to $args{target}" );
for my $cmd ( $self->_cmd( export => %args ) ) {
run_cmd($cmd);
}
@@ -356,7 +350,7 @@ sub checkout {
my %args = @_;
my $path = $args{path} || '';
$self->log->info(
- 'export ' . $self->repository . "/$path to $args{target}" );
+ 'exporting ' . $self->repository . "/$path to $args{target}" );
for my $cmd ( $self->_cmd( checkout => %args ) ) {
run_cmd($cmd);
}
@@ -371,7 +365,7 @@ A wrapper around svn's commit command.
sub commit {
my $self = shift;
my %args = @_;
- $self->log->info( 'commit ' . $args{path} );
+ $self->log->info( 'committing ' . $args{path} );
for my $cmd ( $self->_cmd( commit => @_ ) ) {
run_cmd( $cmd, 1 );
}
@@ -384,7 +378,7 @@ sub _add_to_order {
my $order = $self->order;
unless ( grep { $name eq $_ } @$order ) {
- $self->log->info( "add $name to order for " . $self->repository );
+ $self->log->info( "adding $name to order for " . $self->repository );
push @$order, $name;
$self->order($order);
}
@@ -400,7 +394,7 @@ sub update_order {
my $self = shift;
my %args = @_;
- $self->log->info( "update order for " . $self->repository );
+ $self->log->info( "updating order for " . $self->repository );
my @dists = @{ $args{for_dists} || [] };
unless (@dists) {
@@ -437,7 +431,7 @@ sub graph_deps {
my $self = shift;
my %args = @_;
- $self->log->info( "Outputting a graphviz order for " . $self->repository );
+ $self->log->info( "outputting a graphviz order for " . $self->repository );
my @dists = @{ $args{for_dists} || [] };
unless (@dists) {
@@ -635,7 +629,7 @@ sub delete {
my %args = @_;
my $path = $args{path} || '';
if ( $self->info( path => $path ) ) {
- $self->log->info( "delete " . $self->repository . $path );
+ $self->log->info( "deleting " . $self->repository . $path );
for my $cmd ( $self->_cmd( delete => path => $path ) ) {
run_cmd( $cmd, 1 );
}
@@ -680,7 +674,7 @@ sub move {
my $new_path = $args{new_path} || '';
if ( $self->info( path => $path ) ) {
$self->log->info(
- "move " . $self->repository . "/$path to /$new_path" );
+ "moving " . $self->repository . "/$path to /$new_path" );
for my $cmd (
$self->_cmd(
move => path => $path,
diff --git a/lib/Shipwright/Backend/Git.pm b/lib/Shipwright/Backend/Git.pm
index d5c44fe..151b717 100644
--- a/lib/Shipwright/Backend/Git.pm
+++ b/lib/Shipwright/Backend/Git.pm
@@ -179,7 +179,7 @@ sub check_repository {
}
else {
$self->log->fatal(
- "git backend only supports creating local repository");
+ "git backend doesn't support remote repository");
return;
}
}
diff --git a/lib/Shipwright/Script/Import.pm b/lib/Shipwright/Script/Import.pm
index 5c5be3b..e91884d 100644
--- a/lib/Shipwright/Script/Import.pm
+++ b/lib/Shipwright/Script/Import.pm
@@ -113,9 +113,9 @@ sub run {
if ( $self->name ) {
if ( $self->name =~ /::/ ) {
- $self->log->warn(
- "we saw '::' in the name, will treat it as '-'");
my $name = $self->name;
+ $self->log->warn(
+ "$name contains '::', will treat it as '-'");
$name =~ s/::/-/g;
$self->name($name);
}
@@ -223,7 +223,7 @@ sub run {
load_yaml_file( $shipwright->source->branches_path );
$branches ||= {} if
- $self->log->fatal( "import $name" );
+ $self->log->fatal( "importing $name" );
$shipwright->backend->import(
source => $source,
comment => $self->comment || 'import ' . $source,
@@ -288,7 +288,7 @@ sub _import_req {
my $script_dir = shift;
my $name = (splitdir( $source ))[-1];
- $self->log->info( "import requirements for $name" );
+ $self->log->info( "going to import requirements for $name" );
my $require_file = catfile( $source, '__require.yml' );
$require_file = catfile( $script_dir, 'require.yml' )
@@ -321,7 +321,7 @@ sub _import_req {
my ($name) = grep { $_ eq $dist } @sources;
unless ($name) {
$self->log->warn(
- "we don't have $dist in source which is for "
+ "missing $dist in source which is for "
. $source );
next;
}
@@ -436,7 +436,7 @@ sub _generate_build {
unknown build system for this dist; you MUST manually edit /scripts/$name/build
or provide a build.pl file or this dist will not be built!
EOF
- $self->log->warn("I have no idea how to build this distribution");
+ $self->log->warn("no idea how to build $source_dir");
# stub build file to provide the user something to go from
@commands = (
diff --git a/lib/Shipwright/Source/Base.pm b/lib/Shipwright/Source/Base.pm
index 07407f7..6c452dc 100644
--- a/lib/Shipwright/Source/Base.pm
+++ b/lib/Shipwright/Source/Base.pm
@@ -17,7 +17,7 @@ __PACKAGE__->mk_accessors(
min_perl_version map_path skip map skip_recommends skip_all_recommends
skip_installed include_dual_lifed
keep_build_requires name log url_path version_path branches_path version
- skip_all_test_requires skip_all_build_requires installed
+ skip_all_test_requires skip_all_build_requires installed store
/
);
@@ -105,7 +105,7 @@ sub _follow {
chdir catdir($path);
if ( $path =~ /\bcpan-Bundle-(.*)/ ) {
- $self->log->info("is a CPAN Bundle");
+ $self->log->info("$path is a CPAN Bundle distribution");
my $file = $1;
$file =~ s!-!/!;
@@ -150,7 +150,7 @@ sub _follow {
}
elsif ( -e 'Build.PL' ) {
- $self->log->info("is a Module::Build based dist");
+ $self->log->info("$path is a Module::Build based distribution");
run_cmd(
[
@@ -176,7 +176,8 @@ sub _follow {
my $makefile = read_file('Makefile.PL')
or confess_or_die "can't read Makefile.PL: $!";
if ( $makefile =~ /inc::Module::Install/ ) {
- $self->log->info("is a Module::Install based dist");
+ $self->log->info(
+ "$path is a Module::Install based distribution");
# in case people call another file, which contains
# keywords like requires, features, etc
@@ -465,7 +466,7 @@ EOF
&& Module::CoreList->first_release( $module, $version )
&& Module::CoreList->first_release( $module, $version ) <= $self->min_perl_version)
{
- $self->log->info("Skipping $module because it's in core");
+ $self->log->info("skipping $module because it's in core");
delete $require->{$type}{$module};
next;
}
@@ -481,8 +482,7 @@ EOF
version->parse($version) )
{
$self->log->info(
-"Skipping $module because a new enough version is already installed"
- );
+ "skipping $module because it's installed" );
delete $require->{$type}{$module};
next;
}
@@ -674,7 +674,7 @@ sub _is_skipped {
}
if ($skip) {
- $self->log->info("$module is skipped");
+ $self->log->info("skipping $module");
return 1;
}
}
diff --git a/lib/Shipwright/Source/CPAN.pm b/lib/Shipwright/Source/CPAN.pm
index ca63433..1de78ec 100644
--- a/lib/Shipwright/Source/CPAN.pm
+++ b/lib/Shipwright/Source/CPAN.pm
@@ -84,7 +84,7 @@ sub new {
sub run {
my $self = shift;
- $self->log->info( "prepare to run source: " . $self->source );
+ $self->log->info( "preparing to run source: " . $self->source );
my $result = $self->_run;
if ( $result && $result == 1) {
@@ -103,7 +103,7 @@ sub run {
#deletion
confess_or_die $error;
} else {
- $self->log->warn("Removing source ".$self->source);
+ $self->log->warn("removing source ".$self->source);
return;
}
}
diff --git a/lib/Shipwright/Source/Compressed.pm b/lib/Shipwright/Source/Compressed.pm
index 5773436..faf5e0a 100644
--- a/lib/Shipwright/Source/Compressed.pm
+++ b/lib/Shipwright/Source/Compressed.pm
@@ -19,7 +19,7 @@ sub run {
$self->name( $self->just_name( $self->path ) ) unless $self->name;
$self->version( $self->just_version( $self->path ) ) unless $self->version;
- $self->log->info( 'run source ' . $self->name . ': ' . $self->source );
+ $self->log->info( 'running source ' . $self->name . ': ' . $self->source );
$self->_update_version( $self->name, $self->version );
diff --git a/lib/Shipwright/Source/Directory.pm b/lib/Shipwright/Source/Directory.pm
index 8149178..e7b1619 100644
--- a/lib/Shipwright/Source/Directory.pm
+++ b/lib/Shipwright/Source/Directory.pm
@@ -27,12 +27,10 @@ sub new {
sub run {
my $self = shift;
- $self->log->info(
- 'run source ' . ( $self->name || $self->path ) . ': ' . $self->source );
$self->name( $self->just_name( $self->path ) ) unless $self->name;
$self->version( $self->just_version( $self->path ) ) unless $self->version;
- $self->log->info( 'run source ' . $self->name . ': ' . $self->source );
+ $self->log->info( 'running source ' . $self->name . ': ' . $self->source );
$self->_update_version( $self->name, $self->version );
diff --git a/lib/Shipwright/Source/FTP.pm b/lib/Shipwright/Source/FTP.pm
index 29fae14..e5bc190 100644
--- a/lib/Shipwright/Source/FTP.pm
+++ b/lib/Shipwright/Source/FTP.pm
@@ -15,7 +15,7 @@ use Shipwright::Util;
sub run {
my $self = shift;
- $self->log->info( "prepare to run source: " . $self->source );
+ $self->log->info( "preparing to run source: " . $self->source );
if ( $self->_run ) {
my $compressed =
Shipwright::Source::Compressed->new( %$self, _no_update_url => 1 );
diff --git a/lib/Shipwright/Source/Git.pm b/lib/Shipwright/Source/Git.pm
index 1d98154..7e7a81d 100644
--- a/lib/Shipwright/Source/Git.pm
+++ b/lib/Shipwright/Source/Git.pm
@@ -28,7 +28,7 @@ sub new {
sub run {
my $self = shift;
- $self->log->info( "prepare to run source: " . $self->source );
+ $self->log->info( "preparing to run source: " . $self->source );
$self->_update_url( $self->name, 'git:' . $self->source );
$self->_run();
diff --git a/lib/Shipwright/Source/HTTP.pm b/lib/Shipwright/Source/HTTP.pm
index f7c501b..ac25a2c 100644
--- a/lib/Shipwright/Source/HTTP.pm
+++ b/lib/Shipwright/Source/HTTP.pm
@@ -15,7 +15,7 @@ use Shipwright::Util;
sub run {
my $self = shift;
- $self->log->info( "prepare to run source: " . $self->source );
+ $self->log->info( "preparing to run source: " . $self->source );
if ( $self->_run ) {
my $compressed =
diff --git a/lib/Shipwright/Source/SVK.pm b/lib/Shipwright/Source/SVK.pm
index df37186..3a7070e 100644
--- a/lib/Shipwright/Source/SVK.pm
+++ b/lib/Shipwright/Source/SVK.pm
@@ -26,7 +26,7 @@ sub new {
sub run {
my $self = shift;
- $self->log->info( "prepare to run source: " . $self->source );
+ $self->log->info( "preparing to run source: " . $self->source );
$self->_update_url( $self->name, 'svk:' . $self->source );
diff --git a/lib/Shipwright/Source/SVN.pm b/lib/Shipwright/Source/SVN.pm
index 88db93f..5a9eacc 100644
--- a/lib/Shipwright/Source/SVN.pm
+++ b/lib/Shipwright/Source/SVN.pm
@@ -26,7 +26,7 @@ sub new {
sub run {
my $self = shift;
- $self->log->info( "prepare to run source: " . $self->source );
+ $self->log->info( "preparing to run source: " . $self->source );
$self->_update_url( $self->name, 'svn:' . $self->source );
$self->_run;
diff --git a/lib/Shipwright/Source/Shipyard.pm b/lib/Shipwright/Source/Shipyard.pm
index 71756d4..4366409 100644
--- a/lib/Shipwright/Source/Shipyard.pm
+++ b/lib/Shipwright/Source/Shipyard.pm
@@ -14,7 +14,7 @@ use base qw/Shipwright::Source::Base/;
sub run {
my $self = shift;
- $self->log->info( "prepare to run source: " . $self->source );
+ $self->log->info( "preparing to run source: " . $self->source );
my ( $base, $dist ) = $self->source =~ m{(.*)/([^/]+)};
my $source_shipwright = Shipwright->new( repository => $base );
diff --git a/lib/Shipwright/Util.pm b/lib/Shipwright/Util.pm
index a0aac43..7386050 100644
--- a/lib/Shipwright/Util.pm
+++ b/lib/Shipwright/Util.pm
@@ -91,13 +91,13 @@ sub run_cmd {
my $log = Log::Log4perl->get_logger('Shipwright::Util');
my ( $out, $err );
- $log->info( "run cmd: " . join ' ', @$cmd );
+ $log->info( "running cmd: " . join ' ', @$cmd );
select_fh('null');
run3( $cmd, undef, \$out, \$err );
select_fh('stdout');
- $log->debug("run output:\n$out") if $out;
- $log->error("run err:\n$err") if $err;
+ $log->debug("output:\n$out") if $out;
+ $log->error("err:\n$err") if $err;
if ($?) {
$log->error(
-----------------------------------------------------------------------
More information about the Bps-public-commit
mailing list