Subversion Repositories DevTools

Rev

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

Rev 271 Rev 299
Line 142... Line 142...
142
#                   within a consumed package
142
#                   within a consumed package
143
#
143
#
144
#                   The DPACKAGE file should use the 'Interface()' directive
144
#                   The DPACKAGE file should use the 'Interface()' directive
145
#                   to add the created package onto the Interface list
145
#                   to add the created package onto the Interface list
146
#
146
#
147
# Inputs          : $dpackage       - Name of the Package containg file to load
147
# Inputs          : $dir            - Config directory within the package
148
#                   $dir            - Config directory within the package
148
#                   $file           - DPACKAGE file within the dir
-
 
149
#                   $dpackage       - Name of the Package containg file to load
149
#                   $root           - Base directory of the package
150
#                   $root           - Base directory of the package
150
#                   $project        - Package project suffix (optional)
151
#                   $project        - Package project suffix (optional)
151
#
152
#
152
# Returns         : Nothing
153
# Returns         : Nothing
153
#
154
#
154
sub Load
155
sub Load
155
{
156
{
156
    my ($dpackage, $dir, $root, $project) = @_;
157
    my ($dir, $file, $dpackage, $root, $project) = @_;
157
    my ($package, $template, $cfgfile, $pkgfile, $code);
-
 
158
 
158
 
159
    #
159
    #
160
    #   Create the basic template class
160
    #   Create the basic template class
161
    #
161
    #
162
    my $if = Template ($dpackage, $project);
162
    my $if = Template ($dpackage, $project);
Line 164... Line 164...
164
    #
164
    #
165
    #   Insert essential information into the Interface
165
    #   Insert essential information into the Interface
166
    #   Invoke functions within the Interface Class to do this
166
    #   Invoke functions within the Interface Class to do this
167
    #
167
    #
168
    $if->setRoot($root);
168
    $if->setRoot($root);
169
    $if->ReadFiles( $dir . "/DPACKAGE.CFG", $dir . "/DPACKAGE" );
169
    $if->ReadFiles( "$dir/DPACKAGE.CFG", "$dir/$file" );
170
}
170
}
171
 
171
 
172
#-------------------------------------------------------------------------------
172
#-------------------------------------------------------------------------------
173
# Function        : Template
173
# Function        : Template
174
#
174
#
Line 441... Line 441...
441
    {
441
    {
442
        if ( defined( $package->{'CFGDIR'} ) )
442
        if ( defined( $package->{'CFGDIR'} ) )
443
        {
443
        {
444
            my ($dir) = $package->{'ROOT'}.$package->{'CFGDIR'};
444
            my ($dir) = $package->{'ROOT'}.$package->{'CFGDIR'};
445
 
445
 
-
 
446
            #
-
 
447
            #   Look for both forms:
-
 
448
            #       DPACKAGE.GBE_MACHTYPE   ( New format )
-
 
449
            #       DPACKAGE                ( Manually created and Old format )
-
 
450
            #   Use only the first
-
 
451
            #
-
 
452
            foreach my $ext ( '.' . $::GBE_MACHTYPE, '' )
-
 
453
            {
-
 
454
                my $dpackage = "DPACKAGE" . $ext;
446
            ::Debug( "Examine $dir/DPACKAGE" );
455
                ::Debug( "Examine $dir/$dpackage" );
447
            if ( -e "$dir/DPACKAGE" )
456
                if ( -e "$dir/$dpackage" )
448
            {                                   # .. load interface
457
                {                                   # .. load interface
449
                ::Debug( "Loading $dir/DPACKAGE ($package->{'NAME'}) ..." );
458
                    ::Debug( "Loading $dir/$dpackage ($package->{'NAME'}) ..." );
450
 
459
 
451
                MakeIf::Load( $package->{'NAME'}, $dir, $package->{'ROOT'}, $package->{'DPROJ'} );
460
                    MakeIf::Load( $dir, $dpackage, $package->{'NAME'}, $package->{'ROOT'}, $package->{'DPROJ'} );
-
 
461
                    last;
-
 
462
                }
452
            }
463
            }
453
        }
464
        }
454
    }
465
    }
455
}
466
}
456
 
467