Changeset 712

Show
Ignore:
Timestamp:
10/30/06 21:02:43 (2 years ago)
Author:
gboggs
Message:

- Name the exported directory (and archive) with the language for --prod builds but not the VERSION_ID.
- Dear Gene, Make sure we stage --prod builds -under- the /Production_Builds directory (if it exists). KTHX, Love Gene.

Files:

Legend:

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

    r711 r712  
    201201    # Set the full name to use for the distribution (e.g. MT-3.3b1-fr-r12345-20061225). 
    202202    $self->{'export-dir=s'} = "$self->{'pack=s'}-$self->{'stamp=s'}"; 
    203     # Production builds are explicitly named with their language code. 
     203    # Name the exported directory (and archive) with the language. 
    204204    $self->{'export-dir=s'} .= "-$self->{'short-lang=s'}" if $self->{'prod'}; 
    205205} 
     
    361361    my $cwd = cwd(); 
    362362 
    363     chdir $self->{'stage-dir=s'} or 
    364         die( "ERROR: Can't chdir to $self->{'stage-dir=s'}: $!" ); 
    365     $self->verbose( "Change to staging root $self->{'stage-dir=s'}" ); 
     363    my $prod = $self->{'prod'} && $self->{'stage'} && $self->{'prod-dir=s'} && -e File::Spec->catdir( $self->{'stage-dir=s'}, $self->{'prod-dir=s'} ); 
     364 
     365    # Add the prod-dir to the staged directory if appropriate. 
     366    my $stage_root = $self->{'stage-dir=s'}; 
     367    $stage_root = File::Spec->catdir( $self->{'stage-dir=s'}, $self->{'prod-dir=s'} ) 
     368        if $prod; 
     369 
     370    chdir $stage_root or 
     371        die( "ERROR: Can't chdir to $stage_root $!" ); 
     372    $self->verbose( "Change to staging root $stage_root" ); 
    366373 
    367374    # Do we have a current symlink? 
     
    377384    $current_db = 'stage_' . $current_db; 
    378385 
    379     # Grab the literal build directory name. 
     386    # Set the stage_dir to the literal build directory name. 
    380387    my $stage_dir = fileparse( $dest, @{ $self->{'arch=s@'} } ); 
     388    # Reset the staging root directory. 
     389    $stage_root = File::Spec->catdir( $stage_root, $stage_dir ); 
    381390 
    382391    # Remove any existing distro, with the same path name. 
    383     if( -d $stage_dir ) { 
    384         rmtree( $stage_dir ) or 
    385             die( "ERROR: Can't rmtree the old $stage_dir $!" ) 
     392    if( -d $stage_root ) { 
     393        rmtree( $stage_root ) or 
     394            die( "ERROR: Can't rmtree the old $stage_root $!" ) 
    386395            unless $self->{'debug'}; 
    387         $self->verbose( "Remove: $stage_dir" ); 
     396        $self->verbose( "Remove: $stage_root" ); 
    388397    } 
    389398 
     
    410419 
    411420    # Change to the distribution directory. 
    412     chdir( $stage_dir ) or die( "ERROR: Can't chdir $stage_dir: $!" ) 
     421    chdir( $stage_root ) or die( "ERROR: Can't chdir $stage_root $!" ) 
    413422        unless $self->{'debug'}; 
    414     $self->verbose( "Change to $stage_dir" ); 
     423    $self->verbose( "Change to $stage_root" ); 
    415424 
    416425    # Our database is named the same as the distribution (but with _'s) except for LDAP. 
     
    422431 
    423432    # Set the staging URL to a real location now. 
    424     my $url = sprintf '%s/%s/', 
    425         $self->{'stage-uri=s'}, ($self->{'symlink!'} ? $link : $stage_dir); 
     433    my $url = sprintf '%s/%s/', $self->{'stage-uri=s'}, 
     434        ($prod 
     435            ? File::Spec->catdir( $self->{'prod-dir=s'}, $stage_dir ) 
     436            : $self->{'symlink!'} 
     437                ? $link 
     438                : $stage_dir 
     439        ); 
    426440 
    427441    # Give unto us a shiny, new config file.