[Bps-public-commit] r16043 - in Shipwright/branches/1.10/lib/Shipwright: Script

sunnavy at bestpractical.com sunnavy at bestpractical.com
Tue Sep 23 20:51:51 EDT 2008


Author: sunnavy
Date: Tue Sep 23 20:51:50 2008
New Revision: 16043

Modified:
   Shipwright/branches/1.10/lib/Shipwright/Script/Update.pm
   Shipwright/branches/1.10/lib/Shipwright/Source/Base.pm

Log:
merge 16040@ and 16042@ to 1.1

Modified: Shipwright/branches/1.10/lib/Shipwright/Script/Update.pm
==============================================================================
--- Shipwright/branches/1.10/lib/Shipwright/Script/Update.pm	(original)
+++ Shipwright/branches/1.10/lib/Shipwright/Script/Update.pm	Tue Sep 23 20:51:50 2008
@@ -124,6 +124,11 @@
             confess 'invalid name ' . $name . "\n";
         }
 
+        unless ( $s ) {
+            warn "can't find the source of $name, skipping";
+            next;
+        }
+
         $shipwright->source(
             Shipwright::Source->new(
                 source  => "cpan:$s",

Modified: Shipwright/branches/1.10/lib/Shipwright/Source/Base.pm
==============================================================================
--- Shipwright/branches/1.10/lib/Shipwright/Source/Base.pm	(original)
+++ Shipwright/branches/1.10/lib/Shipwright/Source/Base.pm	Tue Sep 23 20:51:50 2008
@@ -159,9 +159,9 @@
 #     ],
 # );
                for ( my $j = 0; $j < @{$mods->[$i]}; $j++ ) {
-                    if ( $mods->[$i][$j+1] =~ /^[\d\.]+$/ ) {
+                    if ( $mods->[$i][$j+1] =~ /^[\d\.]*$/ ) {
                         $shipwright_req->{recommends}{$mods->[$i][$j]} 
-                            = $mods->[$i][$j+1];
+                            = $mods->[$i][$j+1] || 0;
                         $j++;
                     }
                     else {
@@ -172,9 +172,9 @@
                 next;
             }
 
-            if ( $mods->[$i+1] =~ /^[\d\.]+$/ ) {
+            if ( $mods->[$i+1] =~ /^[\d\.]*$/ ) {
                 # index $i+1 is a version
-                $shipwright_req->{recommends}{$mods->[$i]} = $mods->[$i+1];
+                $shipwright_req->{recommends}{$mods->[$i]} = $mods->[$i+1] || 0;
                 $i++;
             }
             else {
@@ -260,6 +260,9 @@
         for my $type (qw/requires recommends build_requires/) {
             for my $module ( keys %{ $require->{$type} } ) {
 
+#the name shouldn't be undefined, but it _indeed_ happens in reality sometimes
+                next unless $module;
+
                 # we don't want to require perl
                 if ( $module eq 'perl' ) {
                     delete $require->{$type}{$module};



More information about the Bps-public-commit mailing list