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

sunnavy at bestpractical.com sunnavy at bestpractical.com
Tue May 13 08:17:20 EDT 2008


Author: sunnavy
Date: Tue May 13 08:17:19 2008
New Revision: 12291

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

Log:
 r12304 at sunnavys-mb:  sunnavy | 2008-05-13 17:22:15 +0800
 friendly convert - to :: in cpan source if it's not a distribution name


Modified: Shipwright/trunk/lib/Shipwright/Source.pm
==============================================================================
--- Shipwright/trunk/lib/Shipwright/Source.pm	(original)
+++ Shipwright/trunk/lib/Shipwright/Source.pm	Tue May 13 08:17:19 2008
@@ -53,7 +53,14 @@
     # prefix that can't be omitted
     return 'Compressed' if $$source =~ s/^file://i;
     return 'Directory'  if $$source =~ s/^dir(ectory)?://i;
-    return 'CPAN'       if $$source =~ s/^cpan://i;
+
+    if ( $$source =~ s/^cpan://i ) {
+
+        # if it's not a distribution name, like 
+        # 'S/SU/SUNNAVY/IP-QQWry-v0.0.15.tar.gz', convert '-' to '::'.
+        $$source =~ s/-/::/g unless $$source =~ /\.tar\.gz$/;
+        return 'CPAN';
+    }
 
     # prefix that can be omitted
     for my $type (qw/svn http ftp/) {



More information about the Bps-public-commit mailing list