Subversion Repositories DevTools

Rev

Rev 6353 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6353 Rev 7352
Line 146... Line 146...
146
#                   within a consumed package
146
#                   within a consumed package
147
#
147
#
148
#                   The DPACKAGE file should use the 'Interface()' directive
148
#                   The DPACKAGE file should use the 'Interface()' directive
149
#                   to add the created package onto the Interface list
149
#                   to add the created package onto the Interface list
150
#
150
#
151
# Inputs          : $dir            - Config directory within the package
-
 
152
#                   $file           - DPACKAGE file within the dir
-
 
153
#                   $dpackage       - Name of the Package containg file to load
151
# Inputs          : $dpackage       - Name of the Package containing file to load
154
#                   $root           - Base directory of the package
152
#                   $root           - Base directory of the package
155
#                   $project        - Package project suffix (optional)
153
#                   $project        - Package project suffix (optional)
-
 
154
#                   @files          - Files to load
156
#
155
#
157
# Returns         : Nothing
156
# Returns         : Nothing
158
#
157
#
159
sub Load
158
sub Load
160
{
159
{
161
    my ($dir, $file, $dpackage, $root, $project) = @_;
160
    my ($dpackage, $root, $project, @files) = @_;
162
 
161
 
163
    #
162
    #
164
    #   Create the basic template class
163
    #   Create the basic template class
165
    #
164
    #
166
    my $if = Template ($dpackage, $project);
165
    my $if = Template ($dpackage, $project);
Line 168... Line 167...
168
    #
167
    #
169
    #   Insert essential information into the Interface
168
    #   Insert essential information into the Interface
170
    #   Invoke functions within the Interface Class to do this
169
    #   Invoke functions within the Interface Class to do this
171
    #
170
    #
172
    $if->setRoot($root);
171
    $if->setRoot($root);
173
    $if->ReadFiles( "$dir/DPACKAGE.CFG", "$dir/$file" );
172
    $if->ReadFiles( @files );
174
}
173
}
175
 
174
 
176
#-------------------------------------------------------------------------------
175
#-------------------------------------------------------------------------------
177
# Function        : Template
176
# Function        : Template
178
#
177
#
Line 430... Line 429...
430
# Description     : Scan all external packages and locate DPACKAGE files
429
# Description     : Scan all external packages and locate DPACKAGE files
431
#                   This will (must) be in the JATS config directory (gbe)
430
#                   This will (must) be in the JATS config directory (gbe)
432
#
431
#
433
#                   Once found they will be loaded into the system
432
#                   Once found they will be loaded into the system
434
#                   This will effectivly extend the base toolset
433
#                   This will effectivly extend the base toolset
-
 
434
#                   
-
 
435
#                   There are three forms of DPACKAGE file
-
 
436
#                   Manually created and Old format
-
 
437
#                       DPACKAGE
-
 
438
#                   First improvement
-
 
439
#                       DPACKAGE.GBE_MACHTYPE
-
 
440
#                   Second improvement
-
 
441
#                       DPACKAGE_?.cfg
-
 
442
#                       Where ? is the makefile uid number to provide sequencing        
435
#
443
#
436
# Inputs          : $platform               - target platform
444
# Inputs          : $platform               - target platform
437
#                                             Only used to locate packages
445
#                                             Only used to locate packages
438
#                                             Not 'really' used
446
#                                             Not 'really' used
439
#
447
#
Line 450... Line 458...
450
    foreach my $package ( @{$pPlatform} )
458
    foreach my $package ( @{$pPlatform} )
451
    {
459
    {
452
        if ( defined( $package->{'CFGDIR'} ) )
460
        if ( defined( $package->{'CFGDIR'} ) )
453
        {
461
        {
454
            my ($dir) = $package->{'ROOT'}.$package->{'CFGDIR'};
462
            my ($dir) = $package->{'ROOT'}.$package->{'CFGDIR'};
455
 
-
 
456
            #
463
            #
457
            #   Look for both forms:
464
            #   Look for all forms:
-
 
465
            #       DPACKAGE_?.cfg          ( Newer format. Mutally exclusive with New format)
458
            #       DPACKAGE.GBE_MACHTYPE   ( New format )
466
            #       DPACKAGE.GBE_MACHTYPE   ( New format )
459
            #       DPACKAGE                ( Manually created and Old format )
467
            #       DPACKAGE                ( Manually created and Old format )
460
            #   Use only the first
468
            #   Use only the first form found
461
            #
469
            #
-
 
470
            my $dpackage;
-
 
471
            my @processList;
-
 
472
 
-
 
473
            # Select the first (newest) form found
462
            foreach my $ext ( '.' . $::GBE_MACHTYPE, '' )
474
            my @newform = glob ("$dir/DPACKAGE_*.cfg");
-
 
475
            if (@newform) {
-
 
476
                @processList = sort @newform;
-
 
477
 
-
 
478
                #
-
 
479
                #   If consuming files from the interface directory, then they are our own files
-
 
480
                #   Cannot consume ALL of them, only those created by makefiles that have been
-
 
481
                #   created before this one ( Otherwise we start to need multiple parsing of the file )
463
            {
482
                #
464
                my $dpackage = "DPACKAGE" . $ext;
483
                if ($package->{'TYPE'} eq 'interface') {
465
                ::Debug( "Examine $dir/$dpackage" );
484
                    my $listIdx = -1;
-
 
485
                    foreach  ( @processList ) {
466
                if ( -e "$dir/$dpackage" )
486
                        $listIdx++;
467
                {                                   # .. load interface
487
                        m~/DPACKAGE_(.*)\.cfg~;
-
 
488
                        my $index = $1;
468
                    ::Debug( "Loading $dir/$dpackage ($package->{'NAME'}) ..." );
489
                        if (int($index) >= int($::ScmMakeUid)) {
469
                    MakeIf::Load( $dir, $dpackage, $package->{'NAME'}, $package->{'ROOT'}, $package->{'DPROJ'} );
490
                            splice( @processList, $listIdx); 
-
 
491
                            last;
470
                    last;
492
                        }
-
 
493
                    }
-
 
494
                }
-
 
495
 
-
 
496
            } else {
-
 
497
                $dpackage = "$dir/DPACKAGE." . $::GBE_MACHTYPE;
-
 
498
                if ( -e $dpackage ) {
-
 
499
                    push @processList, $dpackage;
471
                }
500
                }
472
            }
501
            }
-
 
502
 
-
 
503
            # This one may always be present
-
 
504
            $dpackage = "$dir/DPACKAGE";
-
 
505
            if ( -e $dpackage ) {
-
 
506
                push @processList, $dpackage;
-
 
507
            }
-
 
508
 
-
 
509
            if (@processList) {
-
 
510
                ::Debug( "Loading ($package->{'NAME'}) ...", @processList );
-
 
511
                MakeIf::Load( $package->{'NAME'}, $package->{'ROOT'}, $package->{'DPROJ'}, @processList );
-
 
512
            }
473
        }
513
        }
474
    }
514
    }
475
}
515
}
476
 
516
 
477
#-------------------------------------------------------------------------------
517
#-------------------------------------------------------------------------------