Subversion Repositories DevTools

Rev

Rev 391 | Rev 3965 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 391 Rev 3890
Line 440... Line 440...
440
    (@_ == 1) ? $_[0] :
440
    (@_ == 1) ? $_[0] :
441
    (@_ == 2) ? join(" and ", @_)  :
441
    (@_ == 2) ? join(" and ", @_)  :
442
                    join("$sepchar ", @_[0 .. ($#_-1)], "and $_[-1]");
442
                    join("$sepchar ", @_[0 .. ($#_-1)], "and $_[-1]");
443
}
443
}
444
 
444
 
-
 
445
#-------------------------------------------------------------------------------
-
 
446
# Function        : ToolsetFile
-
 
447
#
-
 
448
# Description     : Maintain a datastructure of files that are created
-
 
449
#                   by the makefile creation process.
-
 
450
#
-
 
451
#                   Used to simplify the clobber process
-
 
452
#
-
 
453
#                   Maintains a in-memory datastructure
-
 
454
#
-
 
455
# Inputs          : fileList        - Files to add to the list
-
 
456
#
-
 
457
# Returns         : Nothing
-
 
458
#
-
 
459
our %GBE_TOOLSETFiles;
-
 
460
sub ToolsetFile
-
 
461
{
-
 
462
    my (@fileList) = @_;
-
 
463
    Verbose2 ("ToolsetFile:", @fileList);
-
 
464
    Error ("Internal: ToolsetFile. ScmRoot or ScmInterface not defined")
-
 
465
        unless ( defined $::ScmRoot && defined $::ScmInterface );
-
 
466
 
-
 
467
    my $dataFile = "$::ScmRoot/$::ScmInterface/GbeFiles.cfg";
-
 
468
 
-
 
469
    Error ("Internal: ToolsetFile. Cwd not defined")
-
 
470
        unless ( defined $::Cwd );
-
 
471
 
-
 
472
 
-
 
473
    #
-
 
474
    #   Initial read of data structure
-
 
475
    #   Only read on first call
-
 
476
    #
-
 
477
    unless ( %GBE_TOOLSETFiles )
-
 
478
    {
-
 
479
        if ( -f  $dataFile )
-
 
480
        {
-
 
481
            require ( $dataFile );
-
 
482
        }
-
 
483
 
-
 
484
        # Capture the package root directory
-
 
485
        $GBE_TOOLSETFiles{Root} = AbsPath($::ScmRoot)
-
 
486
            unless defined $GBE_TOOLSETFiles{Root};
-
 
487
    }
-
 
488
 
-
 
489
    #
-
 
490
    #   Add files
-
 
491
    #       Need to be full paths
-
 
492
    #
-
 
493
    $GBE_TOOLSETFiles{Files}{RelPath(AbsPath($_), $GBE_TOOLSETFiles{Root} )} = 1 foreach ( @fileList );
-
 
494
 
-
 
495
    #
-
 
496
    #   Save file
-
 
497
    #   Simply rewrite the file
-
 
498
    #
-
 
499
    my $fh = ConfigurationFile::New( $dataFile );
-
 
500
    $fh->Header( "ToolsetFile",
-
 
501
                              "Toolset Files" );
-
 
502
    $fh->Dump( [\%GBE_TOOLSETFiles], [qw(*GBE_TOOLSETFiles)] );
-
 
503
    $fh->Close();
-
 
504
    
-
 
505
}
445
 
506
 
446
1;  #success
507
1;  #success
447
 
508