[Bps-public-commit] r18406 - in Shipwright/trunk: lib/Shipwright/Source

sunnavy at bestpractical.com sunnavy at bestpractical.com
Sun Feb 15 03:17:42 EST 2009


Author: sunnavy
Date: Sun Feb 15 03:17:41 2009
New Revision: 18406

Modified:
   Shipwright/trunk/   (props changed)
   Shipwright/trunk/lib/Shipwright/Source/Compressed.pm

Log:
 r19880 at sunnavys-mb:  sunnavy | 2009-02-15 16:10:25 +0800
 improve a bit when checking compressed file


Modified: Shipwright/trunk/lib/Shipwright/Source/Compressed.pm
==============================================================================
--- Shipwright/trunk/lib/Shipwright/Source/Compressed.pm	(original)
+++ Shipwright/trunk/lib/Shipwright/Source/Compressed.pm	Sun Feb 15 03:17:41 2009
@@ -55,14 +55,15 @@
     my $files = $ae->files;
 
     my $base_dir = $files->[0];
+# sunnavy found that the 1st file is not the directory name when extracting
+# HTML-Strip-1.06.tar.gz, which is weird but valid compressed file.
+    $base_dir =~ s![/\\].*!!; 
 
     if ( @$files != grep { /^\Q$base_dir\E/ } @$files ) {
         croak 'only support compressed file which contains only one directory: '
           . $base_dir;
     }
 
-    $base_dir =~ s![/\\]$!!; # trim the last / or \\ if possible
-
     $self->{_path} = $base_dir;
 
     return $base_dir;



More information about the Bps-public-commit mailing list