[Bps-public-commit] r9986 - in bpsbuilder/BPB: docs examples lib/BPB

sunnavy at bestpractical.com sunnavy at bestpractical.com
Tue Dec 18 01:33:02 EST 2007


Author: sunnavy
Date: Tue Dec 18 01:33:01 2007
New Revision: 9986

Modified:
   bpsbuilder/BPB/docs/tutorial
   bpsbuilder/BPB/examples/config.yml
   bpsbuilder/BPB/lib/BPB/Build.pm
   bpsbuilder/BPB/lib/BPB/Script/Build.pm

Log:
rename build_directory, install_directory to ..._base

Modified: bpsbuilder/BPB/docs/tutorial
==============================================================================
--- bpsbuilder/BPB/docs/tutorial	(original)
+++ bpsbuilder/BPB/docs/tutorial	Tue Dec 18 01:33:01 2007
@@ -10,7 +10,7 @@
     source:
         min_perl_version: 5.008008
     build:
-        install_directory: '/tmp/install'
+        install_base: '/tmp/install'
         perl: '/usr/bin/perl'
         skip_test: 0
 

Modified: bpsbuilder/BPB/examples/config.yml
==============================================================================
--- bpsbuilder/BPB/examples/config.yml	(original)
+++ bpsbuilder/BPB/examples/config.yml	Tue Dec 18 01:33:01 2007
@@ -5,7 +5,7 @@
     source:
         min_perl_version: 5.008008
     build:
-        install_directory: '/tmp/install'
+        install_base: '/tmp/install'
         perl: '/usr/bin/perl'
         skip_test: 0
 svk:
@@ -17,7 +17,7 @@
         skip:
             - '^SVN::'
     build:
-        install_directory: '/tmp/svk'
+        install_base: '/tmp/svk'
         perl: '/usr/bin/perl'
         skip_test: 1
 

Modified: bpsbuilder/BPB/lib/BPB/Build.pm
==============================================================================
--- bpsbuilder/BPB/lib/BPB/Build.pm	(original)
+++ bpsbuilder/BPB/lib/BPB/Build.pm	Tue Dec 18 01:33:01 2007
@@ -7,7 +7,7 @@
 use base qw/Class::Accessor::Fast/;
 
 __PACKAGE__->mk_accessors(
-    qw/install_directory perl build_directory skip_test commands/);
+    qw/install_base perl build_base skip_test commands/);
 
 use File::Spec;
 use File::Temp qw/tempdir/;
@@ -18,7 +18,7 @@
 sub new {
     my $class = shift;
     my $self  = {@_};
-    $self->{build_directory} =
+    $self->{build_base} =
       File::Spec->catfile( tempdir( CLEANUP => 0 ), 'build' );
     bless $self, $class;
 }
@@ -31,14 +31,14 @@
         $self->$_( $args{$_} ) if $args{$_};
     }
 
-    mkdir $self->install_directory unless -e $self->install_directory;
+    mkdir $self->install_base unless -e $self->install_base;
 
-    chdir $self->build_directory;
+    chdir $self->build_base;
 
-    dircopy( 'etc', File::Spec->catfile( $self->install_directory, 'etc' ) );
+    dircopy( 'etc', File::Spec->catfile( $self->install_base, 'etc' ) );
 
     chmod 0755,
-      File::Spec->catfile( $self->install_directory, 'etc',
+      File::Spec->catfile( $self->install_base, 'etc',
         'bpb-script-wrapper' );
 
     my $order =
@@ -47,7 +47,7 @@
     for (@$order) {
         s/::/-/g;
         $self->_install($_);
-        chdir $self->build_directory;
+        chdir $self->build_base;
     }
 
     $self->_wrapper();
@@ -67,13 +67,13 @@
     }
     elsif ( -f 'configure' ) {
         @commands = (
-            './configure --prefix=' . $self->install_directory,
+            './configure --prefix=' . $self->install_base,
             'make', 'make install'
         );
     }
     elsif ( -f 'Build.PL' ) {
         push @commands,
-          $self->perl . " Build.PL --install_base=" . $self->install_directory;
+          $self->perl . " Build.PL --install_base=" . $self->install_base;
         unless ( $self->skip_test ) {
             push @commands, "./Build test";
         }
@@ -81,7 +81,7 @@
     }
     elsif ( -f 'Makefile.PL' ) {
         push @commands,
-          $self->perl . " Makefile.PL INSTALL_BASE=" . $self->install_directory;
+          $self->perl . " Makefile.PL INSTALL_BASE=" . $self->install_base;
         unless ( $self->skip_test ) {
             push @commands, 'make test';
         }
@@ -111,13 +111,13 @@
         return unless $file and -f $file;
         return if $seen{$File::Find::name}++;
         my $dir = ( File::Spec->splitdir($File::Find::dir) )[-1];
-        mkdir File::Spec->catfile( $self->install_directory, "$dir-wrapped" )
-          unless -d File::Spec->catfile( $self->install_directory,
+        mkdir File::Spec->catfile( $self->install_base, "$dir-wrapped" )
+          unless -d File::Spec->catfile( $self->install_base,
             "$dir-wrapped" );
         move( $file =>
-              File::Spec->catfile( $self->install_directory, "$dir-wrapped" ) )
+              File::Spec->catfile( $self->install_base, "$dir-wrapped" ) )
           or die $!;
-        link File::Spec->catfile( $self->install_directory, 'etc',
+        link File::Spec->catfile( $self->install_base, 'etc',
             'bpb-script-wrapper' ) => $file
           or die $!;
     };
@@ -125,11 +125,12 @@
     for my $dir (qw(bin sbin libexec)) {
         find( $sub,
             grep { -d $_ }
-              map { File::Spec->catfile( $self->install_directory, $_ ) }
+              map { File::Spec->catfile( $self->install_base, $_ ) }
               qw/bin sbin libexec/ );
     }
 }
 
+
 1;
 
 __END__

Modified: bpsbuilder/BPB/lib/BPB/Script/Build.pm
==============================================================================
--- bpsbuilder/BPB/lib/BPB/Script/Build.pm	(original)
+++ bpsbuilder/BPB/lib/BPB/Script/Build.pm	Tue Dec 18 01:33:01 2007
@@ -6,7 +6,7 @@
 
 use base qw/App::CLI::Command Class::Accessor::Fast/;
 __PACKAGE__->mk_accessors(
-    qw/config name install_directory build_directory skip_test/ );
+    qw/config name install_base build_base skip_test/ );
 
 use BPB;
 
@@ -14,22 +14,22 @@
     (
         'n|name=s'              => 'name',
         'c|config=s'            => 'config',
-        'i|install_directory=s' => 'install_directory',
+        'i|install_base=s' => 'install_base',
         'skip_test'             => 'skip_test',
     );
 }
 
 sub run {
     my $self              = shift;
-    my $install_directory = shift;
-    $self->install_directory($install_directory) if $install_directory;
+    my $install_base = shift;
+    $self->install_base($install_base) if $install_base;
 
     my $bpb = BPB->new( config => $self->config, name => $self->name );
-    $bpb->backend->export( target => $bpb->build->build_directory );
+    $bpb->backend->export( target => $bpb->build->build_base );
 
     # yeah, export's target is the source for build
     $bpb->build->run( map { $_ => $self->$_ }
-          qw/install_directory skip_test/ );
+          qw/install_base skip_test/ );
 }
 
 1;



More information about the Bps-public-commit mailing list