[Bps-public-commit] r10126 - bpsbuilder/BPB/lib/BPB

sunnavy at bestpractical.com sunnavy at bestpractical.com
Wed Dec 26 10:29:57 EST 2007


Author: sunnavy
Date: Wed Dec 26 10:29:52 2007
New Revision: 10126

Modified:
   bpsbuilder/BPB/lib/BPB/Backend.pm

Log:
added simple log for build script

Modified: bpsbuilder/BPB/lib/BPB/Backend.pm
==============================================================================
--- bpsbuilder/BPB/lib/BPB/Backend.pm	(original)
+++ bpsbuilder/BPB/lib/BPB/Backend.pm	Wed Dec 26 10:29:52 2007
@@ -53,7 +53,7 @@
 ;
 
 our $BUILDER = <<'EOF'
-#!/usr/bin/perl
+#!perl
 use warnings;
 use strict;
 
@@ -64,6 +64,7 @@
 use Config;
 use Getopt::Long;
 use Cwd;
+
 my $build_base = getcwd;
 
 my %args;
@@ -79,15 +80,16 @@
 $ENV{LD_LIBRARY_PATH} = File::Spec->catfile( $args{'install-base'}, 'lib' ) .
     ':' . $ENV{LD_LIBRARY_PATH};
 
+open my $fh, '>', 'build.log' or die $!;
+close $fh;
+
 mkdir $args{'install-base'} unless -e $args{'install-base'};
 
 mkdir File::Spec->catfile( $args{'install-base'},       'etc' )
   unless -e File::Spec->catfile( $args{'install-base'}, 'etc' );
 
-copy(
-    File::Spec->catfile( 'etc',                 'bpb-script-wrapper' ),
-    File::Spec->catfile( $args{'install-base'}, 'etc', 'bpb-script-wrapper' )
-);
+copy( File::Spec->catfile( 'etc', 'bpb-script-wrapper' ),
+    File::Spec->catfile( $args{'install-base'}, 'etc', 'bpb-script-wrapper' ) );
 
 chmod 0755,
   File::Spec->catfile( $args{'install-base'}, 'etc', 'bpb-script-wrapper' );
@@ -111,7 +113,7 @@
       . File::Spec->catfile( $args{'install-base'}, 'lib', 'perl5',
         $Config{archname} );
 
-    if ( ! -f '__build' ) {
+    if ( !-f '__build' ) {
         my @commands;
 
         if ( -f 'configure' ) {
@@ -152,7 +154,14 @@
         substitute('__build');
     }
     chmod 0755, '__build';
-    system('./__build');
+    open my $fh, '>>', '../../build.log' or die $!;
+    my $exit = system('./__build');
+    if ( $exit ) {
+        print $fh "build $dir with failure: $!\n";
+    }
+    else {
+        print $fh "build $dir with success!\n";
+    }
 }
 
 sub wrap_bin {
@@ -217,7 +226,6 @@
     return $order;
 }
 
-
 EOF
 ;
 1;



More information about the Bps-public-commit mailing list