[Bps-public-commit] r15396 - in Shipwright/branches/1.10: share/bin

sunnavy at bestpractical.com sunnavy at bestpractical.com
Fri Aug 22 20:29:58 EDT 2008


Author: sunnavy
Date: Fri Aug 22 20:29:58 2008
New Revision: 15396

Modified:
   Shipwright/branches/1.10/lib/Shipwright/Build.pm
   Shipwright/branches/1.10/share/bin/shipwright-builder

Log:
merged 15392 to 1.1

Modified: Shipwright/branches/1.10/lib/Shipwright/Build.pm
==============================================================================
--- Shipwright/branches/1.10/lib/Shipwright/Build.pm	(original)
+++ Shipwright/branches/1.10/lib/Shipwright/Build.pm	Fri Aug 22 20:29:58 2008
@@ -43,22 +43,18 @@
 
     unless ( $self->install_base ) {
 
-        my $dir =
-          tempdir( 'vessel_' . $self->name . '-XXXXXX', TMPDIR => 1 );
+        my $dir = tempdir( 'vessel_' . $self->name . '-XXXXXX', TMPDIR => 1 );
         $self->install_base( catfile( $dir, $self->name ) );
     }
 
     no warnings 'uninitialized';
 
     $ENV{DYLD_LIBRARY_PATH} =
-      catfile( $self->install_base, 'lib' ) . ':'
-      . $ENV{DYLD_LIBRARY_PATH};
+      catfile( $self->install_base, 'lib' ) . ':' . $ENV{DYLD_LIBRARY_PATH};
     $ENV{LD_LIBRARY_PATH} =
-      catfile( $self->install_base, 'lib' ) . ':'
-      . $ENV{LD_LIBRARY_PATH};
+      catfile( $self->install_base, 'lib' ) . ':' . $ENV{LD_LIBRARY_PATH};
     $ENV{PERL5LIB} =
-        catfile( $self->install_base, 'lib', 'perl5', 'site_perl' )
-      . ':'
+        catfile( $self->install_base, 'lib', 'perl5', 'site_perl' ) . ':'
       . catfile( $self->install_base, 'lib', 'perl5' ) . ':'
       . $ENV{PERL5LIB};
     $ENV{PATH} =
@@ -66,10 +62,13 @@
       . catfile( $self->install_base, 'sbin' ) . ':'
       . $ENV{PATH};
     $ENV{PERL_MM_USE_DEFAULT} = 1;
+    $ENV{LDFLAGS} .= ' -L' . catfile( $args{'install-base'}, 'lib' );
+    $ENV{CFLAGS}  .= ' -I' . catfile( $args{'install-base'}, 'include' );
 
     require CPAN;
     require Module::Info;
     if ( Module::Info->new_from_module('CPAN::Config') ) {
+
         # keep original CPAN::Config info
         require CPAN::Config;
     }
@@ -108,8 +107,7 @@
         dircopy( 'etc', catfile( $self->install_base, 'etc' ) );
 
         my $installed_hash = {};
-        $installed_file =
-          catfile( $self->install_base, 'installed.yml' );
+        $installed_file = catfile( $self->install_base, 'installed.yml' );
         if ( -e $installed_file ) {
             $installed = Shipwright::Util::LoadFile($installed_file);
             $installed_hash = { map { $_ => 1 } @$installed };
@@ -125,7 +123,8 @@
         my ( $flags, $ktf );
         if ( -e catfile( 'shipwright', 'flags.yml' ) ) {
 
-            $flags = Shipwright::Util::LoadFile(
+            $flags =
+              Shipwright::Util::LoadFile(
                 catfile( 'shipwright', 'flags.yml' ) );
 
             # fill not specified but mandatory flags
@@ -143,7 +142,8 @@
 
         if ( -e catfile( 'shipwright', 'known_test_failures.yml' ) ) {
 
-            $ktf = Shipwright::Util::LoadFile(
+            $ktf =
+              Shipwright::Util::LoadFile(
                 catfile( 'shipwright', 'known_test_failures.yml' ) );
         }
         else {
@@ -170,8 +170,7 @@
         @$order = grep { !$installed_hash->{$_} } @$order;
 
         unless ( $self->perl && -e $self->perl ) {
-            my $perl =
-              catfile( $self->install_base, 'bin', 'perl' );
+            my $perl = catfile( $self->install_base, 'bin', 'perl' );
 
             # -e $perl makes sense when we install on to another vessel
             if ( ( grep { /^perl/ } @{$order} ) || -e $perl ) {
@@ -223,8 +222,7 @@
     }
     else {
 
-        my @cmds = read_file(
-            catfile( '..', '..', 'scripts', $dir, 'build' ) );
+        my @cmds = read_file( catfile( '..', '..', 'scripts', $dir, 'build' ) );
         chomp @cmds;
         @cmds = map { $self->_substitute($_) } @cmds;
 
@@ -292,18 +290,12 @@
         mkdir catfile( $self->install_base,       "$dir-wrapped" )
           unless -d catfile( $self->install_base, "$dir-wrapped" );
 
-        if (
-            -e catfile( $self->install_base, "$dir-wrapped", $file )
-          )
-        {
-            $self->log->warn(
-                'found old '
-                  . catfile( $self->install_base, "$dir-wrapped",
-                    $file )
-                  . ', deleting' . "\n"
-            );
-            unlink catfile( $self->install_base, "$dir-wrapped",
-                $file );
+        if ( -e catfile( $self->install_base, "$dir-wrapped", $file ) ) {
+            $self->log->warn( 'found old '
+                  . catfile( $self->install_base, "$dir-wrapped", $file )
+                  . ', deleting'
+                  . "\n" );
+            unlink catfile( $self->install_base, "$dir-wrapped", $file );
         }
 
         my $type;
@@ -326,33 +318,28 @@
             }
         }
 
-        move(
-            $file => catfile( $self->install_base, "$dir-wrapped" )
-        ) or die $!;
+        move( $file => catfile( $self->install_base, "$dir-wrapped" ) )
+          or die $!;
 
     # if we have this $type(e.g. perl) installed and have that specific wrapper,
     # then link to it, else link to the normal one
         if (   $type
             && -e catfile( '..', 'bin', $type )
-            && -e catfile( '..', 'etc', "shipwright-$type-wrapper" )
-          )
+            && -e catfile( '..', 'etc', "shipwright-$type-wrapper" ) )
         {
-            symlink catfile( '..', 'etc',
-                "shipwright-$type-wrapper" ) => $file
+            symlink catfile( '..', 'etc', "shipwright-$type-wrapper" ) => $file
               or die $!;
         }
         else {
 
-            symlink catfile( '..', 'etc',
-                'shipwright-script-wrapper' ) => $file
+            symlink catfile( '..', 'etc', 'shipwright-script-wrapper' ) => $file
               or die $!;
         }
     };
 
     my @dirs =
       grep { -d $_ }
-      map { catfile( $self->install_base, $_ ) }
-      qw/bin sbin/;
+      map { catfile( $self->install_base, $_ ) } qw/bin sbin/;
     find( $sub, @dirs ) if @dirs;
 }
 

Modified: Shipwright/branches/1.10/share/bin/shipwright-builder
==============================================================================
--- Shipwright/branches/1.10/share/bin/shipwright-builder	(original)
+++ Shipwright/branches/1.10/share/bin/shipwright-builder	Fri Aug 22 20:29:58 2008
@@ -115,12 +115,10 @@
 
 my $installed;
 my $installed_hash = {};
-my $installed_file =
-  catfile( $args{'install-base'}, 'installed.yml' );
+my $installed_file = catfile( $args{'install-base'}, 'installed.yml' );
 if ( -e $installed_file ) {
     $installed =
-      YAML::Tiny->read(
-        catfile( $args{'install-base'}, 'installed.yml' ) );
+      YAML::Tiny->read( catfile( $args{'install-base'}, 'installed.yml' ) );
     $installed_hash = { map { $_ => 1 } @{ $installed->[0] } };
 }
 else {
@@ -130,26 +128,21 @@
 $args{'install-base'} = abs_path( $args{'install-base'} );
 
 # YAML::Tiny objects are array based.
-my $order =
-  ( YAML::Tiny->read( catfile( 'shipwright', 'order.yml' ) ) )->[0];
+my $order = ( YAML::Tiny->read( catfile( 'shipwright', 'order.yml' ) ) )->[0];
 
 my ( $flags, $ktf );
 
 if ( -e catfile( 'shipwright', 'flags.yml' ) ) {
-    $flags =
-      ( YAML::Tiny->read( catfile( 'shipwright', 'flags.yml' ) ) )
-      ->[0];
+    $flags = ( YAML::Tiny->read( catfile( 'shipwright', 'flags.yml' ) ) )->[0];
 }
 else {
     $flags = {};
 }
 
 if ( -e catfile( 'shipwright', 'known_test_failures.yml' ) ) {
-    $ktf = (
-        YAML::Tiny->read(
-            catfile( 'shipwright', 'known_test_failures.yml' )
-        )
-    )->[0];
+    $ktf =
+      ( YAML::Tiny->read( catfile( 'shipwright', 'known_test_failures.yml' ) ) )
+      ->[0];
 }
 else {
     $ktf = {};
@@ -257,12 +250,9 @@
           catfile( $args{'install-base'}, 'lib' ) . ':'
           . $ENV{DYLD_LIBRARY_PATH};
         $ENV{LD_LIBRARY_PATH} =
-          catfile( $args{'install-base'}, 'lib' ) . ':'
-          . $ENV{LD_LIBRARY_PATH};
+          catfile( $args{'install-base'}, 'lib' ) . ':' . $ENV{LD_LIBRARY_PATH};
         $ENV{PERL5LIB} =
-          catfile( $args{'install-base'}, 'lib', 'perl5',
-            'site_perl' )
-          . ':'
+            catfile( $args{'install-base'}, 'lib', 'perl5', 'site_perl' ) . ':'
           . catfile( $args{'install-base'}, 'lib', 'perl5' ) . ':'
           . $ENV{PERL5LIB};
         $ENV{PATH} =
@@ -270,6 +260,8 @@
           . catfile( $args{'install-base'}, 'sbin' ) . ':'
           . $ENV{PATH};
         $ENV{PERL_MM_USE_DEFAULT} = 1;
+        $ENV{LDFLAGS} .= ' -L' . catfile( $args{'install-base'}, 'lib' );
+        $ENV{CFLAGS}  .= ' -I' . catfile( $args{'install-base'}, 'include' );
     }
 
     mkpath $args{'install-base'} unless -e $args{'install-base'};
@@ -292,8 +284,7 @@
     }
 
     chmod oct 755,
-      catfile( $args{'install-base'}, 'tools',
-        'shipwright-utility' );
+      catfile( $args{'install-base'}, 'tools', 'shipwright-utility' );
 
     for my $dist (@$order) {
         install($dist);
@@ -343,8 +334,7 @@
         }
     }
     else {
-        my $cmds =
-          cmds( catfile( '..', '..', 'scripts', $dir, 'build' ) );
+        my $cmds = cmds( catfile( '..', '..', 'scripts', $dir, 'build' ) );
 
         for (@$cmds) {
             my ( $type, $cmd ) = @$_;
@@ -400,20 +390,14 @@
         }
 
         my $dir = ( splitdir($File::Find::dir) )[-1];
-        mkdir catfile( $args{'install-base'}, "$dir-wrapped" )
-          unless -d catfile( $args{'install-base'},
-            "$dir-wrapped" );
-
-        if (
-            -e catfile( $args{'install-base'}, "$dir-wrapped",
-                $file ) )
-        {
+        mkdir catfile( $args{'install-base'},       "$dir-wrapped" )
+          unless -d catfile( $args{'install-base'}, "$dir-wrapped" );
+
+        if ( -e catfile( $args{'install-base'}, "$dir-wrapped", $file ) ) {
             print $log 'found old '
-              . catfile( $args{'install-base'}, "$dir-wrapped",
-                $file )
+              . catfile( $args{'install-base'}, "$dir-wrapped", $file )
               . ', deleting' . "\n";
-            unlink catfile( $args{'install-base'}, "$dir-wrapped",
-                $file );
+            unlink catfile( $args{'install-base'}, "$dir-wrapped", $file );
         }
 
         my $type;
@@ -431,25 +415,21 @@
             }
         }
 
-        move( $file =>
-              catfile( $args{'install-base'}, "$dir-wrapped" ) )
+        move( $file => catfile( $args{'install-base'}, "$dir-wrapped" ) )
           or die $!;
 
     # if we have this $type(e.g. perl) installed and have that specific wrapper,
     # then link to it, else link to the normal one
         if (   $type
             && -e catfile( '..', 'bin', $type )
-            && -e catfile( '..', 'etc', "shipwright-$type-wrapper" )
-          )
+            && -e catfile( '..', 'etc', "shipwright-$type-wrapper" ) )
         {
-            symlink catfile( '..', 'etc',
-                "shipwright-$type-wrapper" ) => $file
+            symlink catfile( '..', 'etc', "shipwright-$type-wrapper" ) => $file
               or die $!;
         }
         else {
 
-            symlink catfile( '..', 'etc',
-                'shipwright-script-wrapper' ) => $file
+            symlink catfile( '..', 'etc', 'shipwright-script-wrapper' ) => $file
               or die $!;
         }
         chmod oct 755, $file;
@@ -457,8 +437,7 @@
 
     my @dirs =
       grep { -d $_ }
-      map { catfile( $args{'install-base'}, $_ ) }
-      qw/bin sbin/;
+      map { catfile( $args{'install-base'}, $_ ) } qw/bin sbin/;
     find( $sub, @dirs ) if @dirs;
 
 }
@@ -550,8 +529,7 @@
           '--clean';
     }
     else {
-        my $cmds =
-          cmds( catfile( '..', '..', 'scripts', $dir, 'build' ) );
+        my $cmds = cmds( catfile( '..', '..', 'scripts', $dir, 'build' ) );
 
         for (@$cmds) {
             my ( $type, $c ) = @$_;



More information about the Bps-public-commit mailing list