[Bps-public-commit] r10182 - bpsbuilder/BPB/lib/BPB/Source

sunnavy at bestpractical.com sunnavy at bestpractical.com
Sat Dec 29 13:47:54 EST 2007


Author: sunnavy
Date: Sat Dec 29 13:47:54 2007
New Revision: 10182

Modified:
   bpsbuilder/BPB/lib/BPB/Source/Base.pm

Log:
we'd better use dist names instead of Module names in require.yml

Modified: bpsbuilder/BPB/lib/BPB/Source/Base.pm
==============================================================================
--- bpsbuilder/BPB/lib/BPB/Source/Base.pm	(original)
+++ bpsbuilder/BPB/lib/BPB/Source/Base.pm	Sat Dec 29 13:47:54 2007
@@ -102,13 +102,26 @@
             my @sources = readdir $dir;
             close $dir;
 
-            my $name = $map->{$module} || $module;
-            $name =~ s/::/-/g;
+            my $name;
+            if ( $map->{$module} ) {
+                $name = $map->{$module};
+            }
+            else {
+                $name = $module;
+                $name =~ s/::/-/g;
+            }
 
             unless ( grep { $name eq $_ } @sources ) {
                 my $cpan = BPB::Source->new( %$self, source => $module );
                 $cpan->run();
             }
+
+            # reload map
+            if ( -e $self->map_path ) {
+                $map = BPB::Config::LoadFile( $self->map_path );
+            }
+
+            $require->{ $map->{$module} || $name } = delete $require->{$module};
         }
 
         BPB::Config::DumpFile( $require_path, $require );
@@ -154,7 +167,7 @@
     my %file = @_;
     for ( keys %file ) {
         my $cmd = join ' ', 'cp', $file{$_},
-           File::Spec->catfile($self->path,  $_);
+          File::Spec->catfile( $self->path, $_ );
         system($cmd);
     }
 }



More information about the Bps-public-commit mailing list