[Bps-public-commit] r13330 - in Shipwright/trunk: .

sunnavy at bestpractical.com sunnavy at bestpractical.com
Mon Jun 16 14:32:26 EDT 2008


Author: sunnavy
Date: Mon Jun 16 14:32:26 2008
New Revision: 13330

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

Log:
 r13452 at sunnavys-mb:  sunnavy | 2008-06-17 02:16:30 +0800
 tiny fixes


Modified: Shipwright/trunk/lib/Shipwright/Source.pm
==============================================================================
--- Shipwright/trunk/lib/Shipwright/Source.pm	(original)
+++ Shipwright/trunk/lib/Shipwright/Source.pm	Mon Jun 16 14:32:26 2008
@@ -42,14 +42,14 @@
     my $class = shift;
     my %args = %{ merge( \%DEFAULT, {@_} ) };
 
-    croak "need source option" unless $args{source};
+    croak "need source arg" unless exists $args{source};
 
     my $type = type( \$args{source} );
 
-    croak "invalid source $args{source}" unless $type;
+    croak "invalid source: $args{source}" unless $type;
 
     my $module = 'Shipwright::Source::' . $type;
-    $module->require or die $@;
+    $module->require;
     return $module->new(%args);
 }
 
@@ -61,7 +61,7 @@
     my $source = shift;
 
     # prefix that can't be omitted
-    return 'Compressed' if $$source =~ s/^file://i;
+    return 'Compressed' if $$source =~ s/^file:.*(tar\.gz|tar\.bz2|tgz)$//i;
     return 'Directory'  if $$source =~ s/^dir(ectory)?://i;
 
     if ( $$source =~ s/^cpan://i ) {



More information about the Bps-public-commit mailing list