Changeset 712
- Timestamp:
- 10/30/06 21:02:43 (2 years ago)
- Files:
-
- branches/wheeljack/build/Build.pm (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/wheeljack/build/Build.pm
r711 r712 201 201 # Set the full name to use for the distribution (e.g. MT-3.3b1-fr-r12345-20061225). 202 202 $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. 204 204 $self->{'export-dir=s'} .= "-$self->{'short-lang=s'}" if $self->{'prod'}; 205 205 } … … 361 361 my $cwd = cwd(); 362 362 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" ); 366 373 367 374 # Do we have a current symlink? … … 377 384 $current_db = 'stage_' . $current_db; 378 385 379 # Grabthe literal build directory name.386 # Set the stage_dir to the literal build directory name. 380 387 my $stage_dir = fileparse( $dest, @{ $self->{'arch=s@'} } ); 388 # Reset the staging root directory. 389 $stage_root = File::Spec->catdir( $stage_root, $stage_dir ); 381 390 382 391 # Remove any existing distro, with the same path name. 383 if( -d $stage_ dir) {384 rmtree( $stage_ dir) or385 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 $!" ) 386 395 unless $self->{'debug'}; 387 $self->verbose( "Remove: $stage_ dir" );396 $self->verbose( "Remove: $stage_root" ); 388 397 } 389 398 … … 410 419 411 420 # 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 $!" ) 413 422 unless $self->{'debug'}; 414 $self->verbose( "Change to $stage_ dir" );423 $self->verbose( "Change to $stage_root" ); 415 424 416 425 # Our database is named the same as the distribution (but with _'s) except for LDAP. … … 422 431 423 432 # 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 ); 426 440 427 441 # Give unto us a shiny, new config file.
