[Bps-public-commit] r10177 - bpsbuilder/BPB/lib/BPB/Source

sunnavy at bestpractical.com sunnavy at bestpractical.com
Sat Dec 29 05:38:48 EST 2007


Author: sunnavy
Date: Sat Dec 29 05:38:41 2007
New Revision: 10177

Modified:
   bpsbuilder/BPB/lib/BPB/Source/Base.pm
   bpsbuilder/BPB/lib/BPB/Source/CPAN.pm
   bpsbuilder/BPB/lib/BPB/Source/Compressed.pm
   bpsbuilder/BPB/lib/BPB/Source/Directory.pm

Log:
rename _require.yml to __require.yml; move _copy method to Base.pm

Modified: bpsbuilder/BPB/lib/BPB/Source/Base.pm
==============================================================================
--- bpsbuilder/BPB/lib/BPB/Source/Base.pm	(original)
+++ bpsbuilder/BPB/lib/BPB/Source/Base.pm	Sat Dec 29 05:38:41 2007
@@ -31,6 +31,7 @@
     my $self = shift;
     my $cmd  = $self->_cmd;
     $self->_run($cmd);
+    $self->_copy(@_) if @_;
 }
 
 # you should subclass this method.
@@ -45,7 +46,7 @@
 sub _follow {
     my $self         = shift;
     my $path         = shift;
-    my $require_path = File::Spec->catfile( $path, '_require.yml' );
+    my $require_path = File::Spec->catfile( $path, '__require.yml' );
     my $map          = {};
 
     if ( -e $self->map_path ) {
@@ -113,7 +114,7 @@
         BPB::Config::DumpFile( $require_path, $require );
     }
     else {
-        croak "invalid _require.yml in $path";
+        croak "invalid __require.yml in $path";
     }
 
 }
@@ -148,6 +149,16 @@
 
 }
 
+sub _copy {
+    my $self = shift;
+    my %file = @_;
+    for ( keys %file ) {
+        my $cmd = join ' ', 'cp', $file{$_},
+           File::Spec->catfile($self->path,  $_);
+        system($cmd);
+    }
+}
+
 1;
 
 __END__

Modified: bpsbuilder/BPB/lib/BPB/Source/CPAN.pm
==============================================================================
--- bpsbuilder/BPB/lib/BPB/Source/CPAN.pm	(original)
+++ bpsbuilder/BPB/lib/BPB/Source/CPAN.pm	Sat Dec 29 05:38:41 2007
@@ -49,7 +49,7 @@
     my $self = shift;
     $self->SUPER::run();
     my $compressed = BPB::Source::Compressed->new(%$self);
-    $compressed->run;
+    $compressed->run(@_);
 }
 
 sub _run {

Modified: bpsbuilder/BPB/lib/BPB/Source/Compressed.pm
==============================================================================
--- bpsbuilder/BPB/lib/BPB/Source/Compressed.pm	(original)
+++ bpsbuilder/BPB/lib/BPB/Source/Compressed.pm	Sat Dec 29 05:38:41 2007
@@ -13,8 +13,7 @@
 
 sub run {
     my $self = shift;
-    my $ret = $self->SUPER::run();
-    $self->_copy( @_ );
+    my $ret = $self->SUPER::run(@_);
     $self->_follow($self->path) if $self->follow;
     return $self->path;
 }
@@ -41,15 +40,6 @@
     return File::Spec->catfile( $self->directory, $paths[0] );
 }
 
-sub _copy {
-    my $self = shift;
-    my %file = @_;
-    for ( keys %file ) {
-        my $cmd = join ' ', 'cp', $file{$_},
-           File::Spec->catfile($self->path,  $_);
-        system($cmd);
-    }
-}
 
 sub _cmd {
     my $self = shift;

Modified: bpsbuilder/BPB/lib/BPB/Source/Directory.pm
==============================================================================
--- bpsbuilder/BPB/lib/BPB/Source/Directory.pm	(original)
+++ bpsbuilder/BPB/lib/BPB/Source/Directory.pm	Sat Dec 29 05:38:41 2007
@@ -24,7 +24,7 @@
 
 sub run {
     my $self = shift;
-    $self->SUPER::run();
+    $self->SUPER::run(@_);
     $self->_follow($self->path) if $self->follow;
     return $self->path;
 }



More information about the Bps-public-commit mailing list