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

sunnavy at bestpractical.com sunnavy at bestpractical.com
Mon Jul 7 05:37:15 EDT 2008


Author: sunnavy
Date: Mon Jul  7 05:37:04 2008
New Revision: 13819

Modified:
   Shipwright/trunk/   (props changed)
   Shipwright/trunk/lib/Shipwright/Build.pm
   Shipwright/trunk/share/bin/shipwright-builder

Log:
 r14080 at sunnavys-mb:  sunnavy | 2008-07-07 17:36:45 +0800
 better way to detect alread wrapped files, the previous one is buggy


Modified: Shipwright/trunk/lib/Shipwright/Build.pm
==============================================================================
--- Shipwright/trunk/lib/Shipwright/Build.pm	(original)
+++ Shipwright/trunk/lib/Shipwright/Build.pm	Mon Jul  7 05:37:04 2008
@@ -273,22 +273,30 @@
     my $sub = sub {
         my $file = $_;
         return unless $file and -f $file;
+
+        # return if it's been wrapped already
+        if ( -l $file ) {
+            $self->log->warn(
+                "seems $file has been already wrapped, skipping\n");
+            return;
+        }
+
         my $dir = ( File::Spec->splitdir($File::Find::dir) )[-1];
         mkdir File::Spec->catfile( $self->install_base,       "$dir-wrapped" )
           unless -d File::Spec->catfile( $self->install_base, "$dir-wrapped" );
 
-        # return if it's been wrapped already
         if (
             -e File::Spec->catfile( $self->install_base, "$dir-wrapped", $file )
           )
         {
             $self->log->warn(
-                'found '
+                'found old '
                   . File::Spec->catfile( $self->install_base, "$dir-wrapped",
                     $file )
-                  . ', skipping' . "\n"
+                  . ', deleting' . "\n"
             );
-            return;
+            unlink File::Spec->catfile( $self->install_base, "$dir-wrapped",
+                $file );
         }
 
         my $type;

Modified: Shipwright/trunk/share/bin/shipwright-builder
==============================================================================
--- Shipwright/trunk/share/bin/shipwright-builder	(original)
+++ Shipwright/trunk/share/bin/shipwright-builder	Mon Jul  7 05:37:04 2008
@@ -394,22 +394,30 @@
 
     my $sub = sub {
         my $file = $_;
+
         return unless -f $file;
+
+        # return if it's been wrapped already
+        if ( -l $file ) {
+            print $log "seems $file has been already wrapped, skipping\n";
+            return;
+        }
+
         my $dir = ( File::Spec->splitdir($File::Find::dir) )[-1];
         mkdir File::Spec->catfile( $args{'install-base'}, "$dir-wrapped" )
           unless -d File::Spec->catfile( $args{'install-base'},
             "$dir-wrapped" );
 
-        # return if it's been wrapped already
         if (
             -e File::Spec->catfile( $args{'install-base'}, "$dir-wrapped",
                 $file ) )
         {
-            print $log 'found '
+            print $log 'found old '
               . File::Spec->catfile( $args{'install-base'}, "$dir-wrapped",
                 $file )
-              . ', skipping' . "\n";
-            return;
+              . ', deleting' . "\n";
+            unlink File::Spec->catfile( $args{'install-base'}, "$dir-wrapped",
+                $file );
         }
 
         my $type;



More information about the Bps-public-commit mailing list