Show
Ignore:
Timestamp:
02/09/07 22:59:24 (2 years ago)
Author:
gboggs
Message:

- More gracefully handle the missing plugin prereq error.
- Cleaned up the svn export sprintf() calls.
- Refactored the plugin export method so that it actually works.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/wheeljack/build/Build.pm

    r1057 r1061  
    136136    my $prereq = 'ExtUtils::Install 1.37_02'; 
    137137    eval "use $prereq"; 
    138     die( "ERROR: Can't handle plugin directory manipulation: $@" ) 
    139         if ref($@) or $@ ne ''
     138    die( "ERROR: Can't handle @{ $self->{'plugin=s@'} } plugin installation: $prereq needed." ) 
     139        if $@ && @{ $self->{'plugin=s@'} }
    140140 
    141141    # Do we have SSL support? 
     
    629629    return unless $self->{'export!'}; 
    630630    # NOTE Subversion auto-creates the export directory. 
    631     $self->verbose_command( sprintf( '%s export --quiet %s %s', 
    632         'svn', $self->{'repo-uri=s'}, $self->{'export-dir=s'} 
     631    $self->verbose_command( sprintf( 'svn export --quiet %s %s', 
     632        $self->{'repo-uri=s'}, $self->{'export-dir=s'} 
    633633    )); 
    634634} 
     
    648648        my $path = "plugins/$plugin"; 
    649649        $self->verbose_command( 
    650             sprintf( '%s export %s %s', 'svn', $uri, $path ) 
     650            sprintf( 'svn export --quiet %s %s', $uri, $path ) 
    651651        ); 
    652652        die "ERROR: Plugin not exported: $uri" 
     
    654654 
    655655        # Handle the plugin subdirectory. 
    656         my $subdir = "$path/plugins/$plugin"; 
     656        $path = 'plugins'; 
     657        my $subdir = "plugins/$plugin/$path"; 
    657658        if( -d $subdir && !$self->{debug} ) { 
    658659            $self->dirmove( $subdir, $path ) or 
    659                 die( "Can't move $subdir up to $path: $!" ); 
    660             $self->verbose( "Moved $subdir up to $path" ); 
    661             $subdir = "$path/plugins"; 
    662             rmtree( $subdir ) or 
    663                 die( "Can't rmtree() the $subdir $!" ); 
    664             $self->verbose( "Removed $subdir" ); 
    665         } 
    666  
     660                die( "Can't move $subdir to $path: $!" ); 
     661            $self->verbose( "Moved $subdir to $path" ); 
     662        } 
    667663        # Handle the mt-static subdirectory. 
    668         my $static = "mt-static/plugins/$plugin"; 
    669         $subdir = "$path/$static"; 
     664        $path = "mt-static/plugins"; 
     665        $subdir = "plugins/$plugin/$path"; 
    670666        if( -d $subdir && !$self->{debug} ) { 
    671             unless( -d $static ) { 
    672                 mkdir( $static ) or die( "Can't mkdir $static: $!" ); 
    673                 $self->verbose( "Created $static" ); 
    674             } 
    675             $self->dirmove( $subdir, $static ) or 
    676                 die( "Can't move directory $subdir to $static: $!" ); 
    677             $self->verbose( "Moved $subdir to $static" ); 
    678             $subdir = "$path/mt-static"; 
    679             rmtree( $subdir ) or 
    680                 die( "Can't rmtree() the $subdir: $!" ); 
    681             $self->verbose( "Removed $subdir" ); 
    682         } 
     667            $self->dirmove( $subdir, $path ) or 
     668                die( "Can't move directory $subdir to $path $!" ); 
     669            $self->verbose( "Moved $subdir to $path" ); 
     670        } 
     671 
     672        $path = "plugins/$plugin"; 
     673        rmtree( $path ) or 
     674            die( "Can't rmtree() $path: $!" ); 
     675        $self->verbose( "Removed $path" ); 
    683676    } 
    684677