Subversion Repositories DevTools

Rev

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

Rev 261 Rev 271
Line 40... Line 40...
40
our (@ISA, @EXPORT, %EXPORT_TAGS, @EXPORT_OK);
40
our (@ISA, @EXPORT, %EXPORT_TAGS, @EXPORT_OK);
41
@ISA         = qw(Exporter);
41
@ISA         = qw(Exporter);
42
@EXPORT      = qw(  ReadBuildConfig
42
@EXPORT      = qw(  ReadBuildConfig
43
                    getPlatformParts
43
                    getPlatformParts
44
                    getPackagePaths
44
                    getPackagePaths
-
 
45
                    getPackageList
45
                );
46
                );
46
@EXPORT_OK =  qw(   $InterfaceVersion
47
@EXPORT_OK =  qw(   $InterfaceVersion
47
                    $ScmBuildMachType
48
                    $ScmBuildMachType
48
                    $ScmInterfaceVersion
49
                    $ScmInterfaceVersion
49
                    $ScmBuildName
50
                    $ScmBuildName
Line 318... Line 319...
318
    }
319
    }
319
 
320
 
320
    return @result;
321
    return @result;
321
}
322
}
322
 
323
 
-
 
324
#-------------------------------------------------------------------------------
-
 
325
# Function        : getPackageList
-
 
326
#
-
 
327
# Description     : Returns a list of package entries
-
 
328
#                   Only real use of the returnd values is to iterate over it
-
 
329
#                   and pass the values into other functiosn within this
-
 
330
#                   class.
-
 
331
#
-
 
332
# Inputs          : Nothing
-
 
333
#
-
 
334
# Returns         : A list of refs to package data
-
 
335
#
-
 
336
sub getPackageList
-
 
337
{
-
 
338
    Error ("BuildConfig. Not initialised") unless ( $platform );
-
 
339
    my @result;
-
 
340
 
-
 
341
    foreach ( @ {$ScmBuildPkgRules{$platform} } )
-
 
342
    {
-
 
343
#        my %self;
-
 
344
#        $self{DATA} = $_;
-
 
345
        push @result, bless $_, "PackageEntry";
-
 
346
    }
-
 
347
    return ( @result );
-
 
348
}
-
 
349
 
-
 
350
################################################################################
-
 
351
#   PackageEntry
-
 
352
################################################################################
-
 
353
#
-
 
354
#   A class to access the data embedded into $ScmBuildPkgRules
-
 
355
#   Use a class interface to abstract the data
-
 
356
#
-
 
357
package PackageEntry;
-
 
358
 
-
 
359
#-------------------------------------------------------------------------------
-
 
360
# Function        : dump
-
 
361
#
-
 
362
# Description     : Diagnostic Dump of the body of the package entry
-
 
363
#
-
 
364
# Inputs          : None
-
 
365
#
-
 
366
# Returns         : None
-
 
367
#
-
 
368
sub dump
-
 
369
{
-
 
370
    my $self = shift;
-
 
371
    ::DebugDumpData("PackageEntry", $self );
-
 
372
}
-
 
373
 
-
 
374
#-------------------------------------------------------------------------------
-
 
375
# Function        : getBase
-
 
376
#
-
 
377
# Description     : Determine the base directory of the package
-
 
378
#
-
 
379
# Inputs          : $self                   - Class Ref
-
 
380
#                   $type                   - 0: Empty
-
 
381
#                                             1: abs dpkg_archive
-
 
382
#                                             2: May be in the interface
-
 
383
#
-
 
384
# Returns         : As above
-
 
385
#
-
 
386
sub getBase
-
 
387
{
-
 
388
    my ($self, $type ) = @_;
-
 
389
    if ( $type == 1 ) {
-
 
390
        return $self->{ROOT};
-
 
391
    } elsif ( $type == 2 ) {
-
 
392
        if ( $self->{TYPE} eq 'link' ) {
-
 
393
            return $self->{ROOT};
-
 
394
        } else {
-
 
395
            return $interface;
-
 
396
        }
-
 
397
    } else  {
-
 
398
        return '';
-
 
399
    }
-
 
400
}
-
 
401
 
-
 
402
 
-
 
403
 
-
 
404
#-------------------------------------------------------------------------------
-
 
405
# Function        : getLibDirs
-
 
406
#
-
 
407
# Description     : Return an array of library directories
-
 
408
#
-
 
409
# Inputs          : $self                   - Class ref
-
 
410
#                   $type                   - 0 : Relative to base of the package
-
 
411
#                                             1 : abs to the dpkg_archive package
-
 
412
#                                             2 : abs to the interface
-
 
413
#
-
 
414
# Returns         : An array
-
 
415
#
-
 
416
sub getLibDirs
-
 
417
{
-
 
418
    my ($self, $type ) = @_;
-
 
419
    my @result;
-
 
420
    my $prefix = getBase( $self, $type );
-
 
421
 
-
 
422
    foreach ( @{$self->{PLIBDIRS}} )
-
 
423
    {
-
 
424
        push @result, $prefix . $_;
-
 
425
    }
-
 
426
    return @result;
-
 
427
}
-
 
428
 
-
 
429
#-------------------------------------------------------------------------------
-
 
430
# Function        : getIncDirs
-
 
431
#
-
 
432
# Description     : Return an array of include directories
-
 
433
#
-
 
434
# Inputs          : $self                   - Class ref
-
 
435
#                   $type                   - 0 : Relative to base of the package
-
 
436
#                                             1 : abs to the dpkg_archive package
-
 
437
#                                             2 : abs to the interface
-
 
438
#
-
 
439
# Returns         : An array
-
 
440
#
-
 
441
sub getIncDirs
-
 
442
{
-
 
443
    my ($self, $type ) = @_;
-
 
444
    my @result;
-
 
445
    my $prefix = getBase( $self, $type );
-
 
446
 
-
 
447
    foreach ( @{$self->{PINCDIRS}} )
-
 
448
    {
-
 
449
        push @result, $prefix . $_;
-
 
450
    }
-
 
451
    return @result;
-
 
452
}
-
 
453
 
323
#------------------------------------------------------------------------------
454
#------------------------------------------------------------------------------
324
1;
455
1;