[Bps-public-commit] r15482 - in Shipwright/branches/1.10: lib/Shipwright/Backend

sunnavy at bestpractical.com sunnavy at bestpractical.com
Tue Aug 26 10:54:19 EDT 2008


Author: sunnavy
Date: Tue Aug 26 10:54:19 2008
New Revision: 15482

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

Log:
merged 15480:15481 to 1.1

Modified: Shipwright/branches/1.10/lib/Shipwright/Backend/Base.pm
==============================================================================
--- Shipwright/branches/1.10/lib/Shipwright/Backend/Base.pm	(original)
+++ Shipwright/branches/1.10/lib/Shipwright/Backend/Base.pm	Tue Aug 26 10:54:19 2008
@@ -279,6 +279,7 @@
         if ( grep { $_ eq $maker } @$order ) {
             @$order = grep { $_ ne $maker } @$order;
             my $first_cpan_index = firstidx { /^cpan-/ } @$order;
+            $first_cpan_index = scalar @$order if $first_cpan_index == -1;
             splice @$order, $first_cpan_index, 0, $maker;
 
             if ( $maker eq 'cpan-Module-Build' ) {

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	Tue Aug 26 10:54:19 2008
@@ -189,19 +189,18 @@
         clean();
     }
     install();
-    unless ( $args{'noclean-after-install'} ) {
-        clean();
-        print "install finished, the dists are at $args{'install-base'}\n";
-    }
 }
 
 sub install {
+
     # for install
     open my $log, '>', 'build.log' or confess $!;
 
     # set clean flag again
-    open my $tmp_fh, '>', '__need_clean' or confess $!;
-    close $tmp_fh;
+    if ( $args{'noclean-after-install'} ) {
+        open my $tmp_fh, '>', '__need_clean' or confess $!;
+        close $tmp_fh;
+    }
 
     process_tmp_dists() if keys %{ $args{with} };
 
@@ -275,15 +274,15 @@
       catfile( $args{'install-base'}, 'tools', 'shipwright-utility' );
 
     for my $dist (@$order) {
-        _install($dist, $log);
-        _record($dist, $log);
+        _install( $dist, $log );
+        _record( $dist, $log );
         chdir $build_base;
     }
 
     mkdir catfile( $args{'install-base'},       'bin' )
       unless -e catfile( $args{'install-base'}, 'bin' );
 
-    wrap_bin( $log );
+    wrap_bin($log);
 
     print "install finished, the dists are at $args{'install-base'}\n";
     print $log "install finished, the dists are at $args{'install-base'}\n";
@@ -328,7 +327,7 @@
 
         for (@$cmds) {
             my ( $type, $cmd ) = @$_;
-            next if $type eq 'clean';
+            next if $type eq 'clean' && $args{'noclean-after-install'};
 
             if ( $skip_test && $type eq 'test' ) {
                 print $log "skip build $type part in $dir\n";
@@ -344,16 +343,19 @@
                     if ( $args{force} ) {
                         print $log
 "although tests failed, will install anyway since we have force arg\n";
-                        next;
                     }
                     ## no critic
                     elsif ( eval "$ktf->{$dir}" ) {
                         print $log
 "although tests failed, will install anyway since it's a known failure\n";
-                        next;
                     }
+                    next;
+                }
+                elsif ( $type ne 'clean' ) {
+
+                    # clean is trivial, we'll just ignore if 'clean' fails
+                    confess "build $dir $type part with failure.\n";
                 }
-                confess "build $dir $type part with failure.\n";
             }
             else {
                 print $log "build $dir $type part with success!\n";
@@ -513,14 +515,13 @@
 
     chdir $build_base;
     for my $dist (@$order) {
-        _clean($dist, $log);
+        _clean( $dist, $log );
         chdir $build_base;
     }
 
     unlink '__need_clean';
 }
 
-
 sub _clean {
     my $dir = shift;
     my $log = shift;



More information about the Bps-public-commit mailing list