Subversion Repositories DevTools

Rev

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

Rev 6192 Rev 6276
Line 68... Line 68...
68
            TOOLDIRS        => [],
68
            TOOLDIRS        => [],
69
            THXDIRS         => [],
69
            THXDIRS         => [],
70
        };
70
        };
71
    return bless $self, __PACKAGE__;
71
    return bless $self, __PACKAGE__;
72
}
72
}
-
 
73
#-------------------------------------------------------------------------------
-
 
74
# Function        : New 
-
 
75
#
-
 
76
# Description     : Create a new instance of the PackageEntry class
-
 
77
#
-
 
78
# Inputs          : $base           - Path to the package
-
 
79
#                   $name           - Package Name
-
 
80
#                   $version        - Version
-
 
81
#                   $type           - 'link' or 'build'
-
 
82
#                   $local          - Is from a local archive
-
 
83
#                                     No version check.
-
 
84
#                                     Display path to package
-
 
85
#                   $pkgSig         - Package Signature
-
 
86
#
-
 
87
# Returns         : 
-
 
88
#
73
 
89
 
74
sub New
90
sub New
75
{
91
{
76
    my ($base, $name, $version, $sandbox, $type, $local) = @_;
92
    my ($base, $name, $version, $type, $local, $pkgSig) = @_;
77
    my $self = EmptyEntry();
93
    my $self = EmptyEntry();
78
 
94
 
79
    #   Load package description ...
95
    #   Load package description ...
80
    #
-
 
81
    #       If a sandbox link, parse the build.pl and retrieve the BuildName()
-
 
82
    #       otherwise, load the description from the 'descpkg'.
-
 
83
    #
-
 
84
    #   Note:   The results are cached within DescPkgCache
96
    #   Note:   The results are cached within DescPkgCache
85
    #..
97
    #..
86
    if ( ! exists( $DescPkgCache{$base} ) )
98
    if ( ! exists( $DescPkgCache{$base} ) )
87
    {
99
    {
88
        my ($rec);
100
        my ($rec);
89
        my ($desc) = "";
101
        my ($desc) = "";
90
 
102
 
91
        if ( $sandbox )
-
 
92
        {
-
 
93
            open (BUILDPL, "$base/build.pl") ||
-
 
94
                ::Error( "cannot open '$base/build.pl'" );
-
 
95
            while (<BUILDPL>) {
-
 
96
                if ( $_ =~ /^\s*BuildName\s*\(\s*[\"\'](.*)[\'\"]\s*\)/ ) {
-
 
97
                    $desc = $1;                 # BuildName() argument
-
 
98
                    ($rec->{NAME}, $rec->{VERSION}, $rec->{PROJ}) = split( ' ', $desc );
-
 
99
                    last;
-
 
100
                }
-
 
101
            }
-
 
102
            close (BUILDPL);
-
 
103
        }
-
 
104
        elsif ( -f "$base/descpkg" )
103
        if ( -f "$base/descpkg" )
105
        {
104
        {
106
            $rec = ::ReadDescpkg( "$base/descpkg", 1 );
105
            $rec = ::ReadDescpkg( "$base/descpkg", 1 );
107
        }
106
        }
108
        else
107
        else
109
        {                                       # doesn't exist
108
        {                                       # doesn't exist
Line 116... Line 115...
116
            unless ( $rec );
115
            unless ( $rec );
117
 
116
 
118
        ::Warning( "Package names do not match: $rec->{NAME}, $name" )
117
        ::Warning( "Package names do not match: $rec->{NAME}, $name" )
119
            if ( $rec->{NAME} ne $name );
118
            if ( $rec->{NAME} ne $name );
120
 
119
 
121
        if ( $local || substr($version,0,8) eq '!current' ||
120
        if ( $local )
122
                substr($version,0,8) eq '!sandbox' )
-
 
123
        {                                       # display results
121
        {                                       # display results
124
            my $logPrefix = "               ->";
122
            my $logPrefix = "               ->";
125
            if ( $local ) {
-
 
126
                ::Log( "$logPrefix $base" );
123
            ::Log( "$logPrefix $base" );
127
            } elsif ($rec->{NAME} eq "") {
-
 
128
                ::Log( "$logPrefix n/a" );
-
 
129
            } else {
-
 
130
                ::Log( "$logPrefix $rec->{NAME} $rec->{VERSION} $rec->{PROJ}" );
-
 
131
            }
-
 
132
        }
124
        }
133
        elsif ( $rec->{VERSION_FULL} ne $version )
125
        elsif ( $rec->{VERSION_FULL} ne $version )
134
        {
126
        {
135
            ::Warning( "Package versions do not match: $name : $rec->{VERSION_FULL}, $version" );
127
            ::Warning( "Package versions do not match: $name : $rec->{VERSION_FULL}, $version" );
136
        }
128
        }
Line 147... Line 139...
147
        $rec->{UNAME}    = $name;
139
        $rec->{UNAME}    = $name;
148
        $rec->{UVERSION} = $version;
140
        $rec->{UVERSION} = $version;
149
        $rec->{UVNUM}    = $vnum;
141
        $rec->{UVNUM}    = $vnum;
150
        $rec->{UPROJ}    = $proj;
142
        $rec->{UPROJ}    = $proj;
151
        $rec->{type}     = $type;
143
        $rec->{type}     = $type;
-
 
144
        $rec->{PKGSIG}   = $pkgSig;
152
 
145
 
153
        $PackageDefined{$name}{$proj}{$vnum} = $base;
146
        $PackageDefined{$name}{$proj}{$vnum} = $base;
154
        push @PackageList, $base;
147
        push @PackageList, $base;
155
 
148
 
156
        $DescPkgCache{$base} = $rec;                  # cache result
149
        $DescPkgCache{$base} = $rec;                  # cache result
Line 159... Line 152...
159
#   Build the package entry record
152
#   Build the package entry record
160
#..
153
#..
161
    my ($descpkg) = $DescPkgCache{$base};       # descpkg details
154
    my ($descpkg) = $DescPkgCache{$base};       # descpkg details
162
 
155
 
163
    $self->{'base'}         = $base;
156
    $self->{'base'}         = $base;
164
    $self->{'base'}         .= "/local"
-
 
165
        if ( $sandbox );
-
 
166
 
157
 
167
    $self->{'name'}         = $name;
158
    $self->{'name'}         = $name;
168
    $self->{'version'}      = $version;
159
    $self->{'version'}      = $version;
169
    $self->{'sandbox'}      = $sandbox;
-
 
170
    $self->{'dname'}        = $descpkg->{NAME};
160
    $self->{'dname'}        = $descpkg->{NAME};
171
    $self->{'dversion'}     = $descpkg->{VERSION};
161
    $self->{'dversion'}     = $descpkg->{VERSION};
172
    $self->{'dproj'}        = $descpkg->{PROJ} || $descpkg->{UPROJ} || '';
162
    $self->{'dproj'}        = $descpkg->{PROJ} || $descpkg->{UPROJ} || '';
173
    $self->{'packages'}     = $descpkg->{PACKAGES};
163
    $self->{'packages'}     = $descpkg->{PACKAGES};
174
    $self->{'type'}         = $type;
164
    $self->{'type'}         = $type;
175
    $self->{'cfgdir'}       = "/gbe"
165
    $self->{'cfgdir'}       = "/gbe" if ( -d $base."/gbe" );
176
        if ( $sandbox || -d $base."/gbe" );
166
#    $self->{pkgsig}         = $descpkg->{PKGSIG};
177
 
167
 
178
    return $self;
168
    return $self;
179
}
169
}
180
 
170
 
181
#-------------------------------------------------------------------------------
171
#-------------------------------------------------------------------------------
Line 193... Line 183...
193
    my $self = EmptyEntry();
183
    my $self = EmptyEntry();
194
 
184
 
195
    $self->{'base'}         = $base;
185
    $self->{'base'}         = $base;
196
    $self->{'name'}         = 'INTERFACE';
186
    $self->{'name'}         = 'INTERFACE';
197
    $self->{'version'}      = '0.0.0';
187
    $self->{'version'}      = '0.0.0';
198
    $self->{'sandbox'}      = 0;
-
 
199
    $self->{'dname'}        = $self->{'name'};
188
    $self->{'dname'}        = $self->{'name'};
200
    $self->{'dversion'}     = $self->{'version'};
189
    $self->{'dversion'}     = $self->{'version'};
201
    $self->{'dproj'}        = '';
190
    $self->{'dproj'}        = '';
202
    $self->{'packages'}     = '';
191
    $self->{'packages'}     = '';
203
    $self->{'type'}         = 'interface';
192
    $self->{'type'}         = 'interface';
Line 215... Line 204...
215
    my( $list ) = $self->{PINCDIRS};
204
    my( $list ) = $self->{PINCDIRS};
216
 
205
 
217
    return if ( $$examined{$path} );
206
    return if ( $$examined{$path} );
218
    $$examined{$path} = 1;
207
    $$examined{$path} = 1;
219
 
208
 
220
    push @$list, $path      if ( $self->{'sandbox'} || -d $self->{'base'}.$path );
209
    push @$list, $path      if ( -d $self->{'base'}.$path );
221
}
210
}
222
 
211
 
223
#
212
#
224
#   Examine Path to ensure that it is a directory and that it contains files
213
#   Examine Path to ensure that it is a directory and that it contains files
225
#   Simplify Lib Path searching by removing useless paths.
214
#   Simplify Lib Path searching by removing useless paths.
Line 253... Line 242...
253
    my( $list ) = $self->{PLIBDIRS};
242
    my( $list ) = $self->{PLIBDIRS};
254
 
243
 
255
    return if ( $$examined{$path} );
244
    return if ( $$examined{$path} );
256
    $$examined{$path} = 1;
245
    $$examined{$path} = 1;
257
 
246
 
258
    push @$list, $path."D"  if ( $self->{'sandbox'} || isUsefulDir($self->{'base'}.$path."D") );
247
    push @$list, $path."D"  if ( isUsefulDir($self->{'base'}.$path."D") );
259
    push @$list, $path."P"  if ( $self->{'sandbox'} || isUsefulDir($self->{'base'}.$path."P") );
248
    push @$list, $path."P"  if ( isUsefulDir($self->{'base'}.$path."P") );
260
    push @$list, $path      if ( $self->{'sandbox'} || isUsefulDir($self->{'base'}.$path) );
249
    push @$list, $path      if ( isUsefulDir($self->{'base'}.$path) );
261
}
250
}
262
 
251
 
263
#-------------------------------------------------------------------------------
252
#-------------------------------------------------------------------------------
264
# Function        : ExamineToolPath
253
# Function        : ExamineToolPath
265
#
254
#
Line 554... Line 543...
554
    }
543
    }
555
 
544
 
556
    return @list;
545
    return @list;
557
}
546
}
558
 
547
 
-
 
548
#-------------------------------------------------------------------------------
-
 
549
# Function        : GetPackageSignature
-
 
550
#
-
 
551
# Description     : A class function to return a packages signature
-
 
552
#
-
 
553
#
-
 
554
# Inputs          : None
-
 
555
#
-
 
556
# Returns         : An array of version list entries
-
 
557
#                   Each element of the form: "name (version)"
-
 
558
#
-
 
559
sub GetPackageSignature
-
 
560
{
-
 
561
    my ($tag) = @_;
-
 
562
    my $rec = $DescPkgCache{$tag};
-
 
563
    return $rec->{PKGSIG};
-
 
564
}
559
 
565
 
560
#-------------------------------------------------------------------------------
566
#-------------------------------------------------------------------------------
561
# Function        : Dump 
567
# Function        : Dump 
562
#
568
#
563
# Description     : Internal diagnostic tool
569
# Description     : Internal diagnostic tool