[Bps-public-commit] r15480 - in Shipwright/trunk: share/bin

sunnavy at bestpractical.com sunnavy at bestpractical.com
Tue Aug 26 10:52:47 EDT 2008


Author: sunnavy
Date: Tue Aug 26 10:52:39 2008
New Revision: 15480

Modified:
   Shipwright/trunk/   (props changed)
   Shipwright/trunk/share/bin/shipwright-builder

Log:
 r16100 at sunnavys-mb:  sunnavy | 2008-08-26 22:51:12 +0800
 clean each dist right after each dist is installed


Modified: Shipwright/trunk/share/bin/shipwright-builder
==============================================================================
--- Shipwright/trunk/share/bin/shipwright-builder	(original)
+++ Shipwright/trunk/share/bin/shipwright-builder	Tue Aug 26 10:52:39 2008
@@ -193,10 +193,6 @@
         clean();
     }
     install();
-    unless ( $args{'noclean-after-install'} ) {
-        clean();
-        print "install finished, the dists are at $args{'install-base'}\n";
-    }
 }
 
 sub install {
@@ -205,8 +201,10 @@
     open $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} };
 
@@ -281,15 +279,15 @@
 
     mkdir 'dists' unless -e 'dists';
     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";
 }
@@ -341,7 +339,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";
@@ -357,16 +355,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";
@@ -529,7 +530,7 @@
     }
     else {
         for my $dist (@$order) {
-            _clean($dist, $log);
+            _clean( $dist, $log );
             chdir $build_base;
         }
     }



More information about the Bps-public-commit mailing list