[Bps-public-commit] r10752 - Shipwright/lib/Shipwright/Script

sunnavy at bestpractical.com sunnavy at bestpractical.com
Thu Feb 7 02:29:33 EST 2008


Author: sunnavy
Date: Thu Feb  7 02:29:31 2008
New Revision: 10752

Modified:
   Shipwright/lib/Shipwright/Script/Import.pm

Log:
try to do the right thing if people specify invalid name

Modified: Shipwright/lib/Shipwright/Script/Import.pm
==============================================================================
--- Shipwright/lib/Shipwright/Script/Import.pm	(original)
+++ Shipwright/lib/Shipwright/Script/Import.pm	Thu Feb  7 02:29:31 2008
@@ -55,6 +55,18 @@
         die "need $_ arg" unless $self->$_();
     }
 
+    if ( $self->name ) {
+        if ( $self->name =~ /::/ ) {
+            warn "we saw '::' in the name, will treat it as '-'";
+            my $name = $self->name;
+            $name =~ s/::/-/g;
+            $self->name( $name );
+        }
+        if ( $self->name !~ /^[-\w]+$/ ) {
+            die 'name can only have alphanumeric characters and -';
+        }
+    }
+
     my $shipwright = Shipwright->new(
         repository       => $self->repository,
         log_level        => $self->log_level,
@@ -268,7 +280,7 @@
    --log-level(-l)    specify the log level
    --comment(-m)      specify the comment
    --source(-s)       specify the source path
-   --name             specify the sorce name
+   --name             specify the sorce name( only alphanumeric characters and - )
    --build-script     specify the build script
    --require-yml      specify the require.yml
    --follow           follow the dependent chain or not



More information about the Bps-public-commit mailing list