Subversion Repositories DevTools

Rev

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

Rev 7304 Rev 7319
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, $pkgSig) = @_;
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 119... Line 118...
119
            if ( $rec->{NAME} ne $name );
118
            if ( $rec->{NAME} ne $name );
120
 
119
 
121
        if ( $local )
120
        if ( $local )
122
        {                                       # display results
121
        {                                       # display results
123
            my $logPrefix = "               ->";
122
            my $logPrefix = "               ->";
124
            if ( $local ) {
-
 
125
                ::Log( "$logPrefix $base" );
123
            ::Log( "$logPrefix $base" );
126
            } elsif ($rec->{NAME} eq "") {
-
 
127
                ::Log( "$logPrefix n/a" );
-
 
128
            } else {
-
 
129
                ::Log( "$logPrefix $rec->{NAME} $rec->{VERSION} $rec->{PROJ}" );
-
 
130
            }
-
 
131
        }
124
        }
132
        elsif ( $rec->{VERSION_FULL} ne $version )
125
        elsif ( $rec->{VERSION_FULL} ne $version )
133
        {
126
        {
134
            ::Warning( "Package versions do not match: $name : $rec->{VERSION_FULL}, $version" );
127
            ::Warning( "Package versions do not match: $name : $rec->{VERSION_FULL}, $version" );
135
        }
128
        }
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" );
-
 
177
#    $self->{pkgsig}         = $descpkg->{PKGSIG};
166
#    $self->{pkgsig}         = $descpkg->{PKGSIG};
178
 
167
 
179
    return $self;
168
    return $self;
180
}
169
}
181
 
170
 
Line 194... Line 183...
194
    my $self = EmptyEntry();
183
    my $self = EmptyEntry();
195
 
184
 
196
    $self->{'base'}         = $base;
185
    $self->{'base'}         = $base;
197
    $self->{'name'}         = 'INTERFACE';
186
    $self->{'name'}         = 'INTERFACE';
198
    $self->{'version'}      = '0.0.0';
187
    $self->{'version'}      = '0.0.0';
199
    $self->{'sandbox'}      = 0;
-
 
200
    $self->{'dname'}        = $self->{'name'};
188
    $self->{'dname'}        = $self->{'name'};
201
    $self->{'dversion'}     = $self->{'version'};
189
    $self->{'dversion'}     = $self->{'version'};
202
    $self->{'dproj'}        = '';
190
    $self->{'dproj'}        = '';
203
    $self->{'packages'}     = '';
191
    $self->{'packages'}     = '';
204
    $self->{'type'}         = 'interface';
192
    $self->{'type'}         = 'interface';
Line 216... Line 204...
216
    my( $list ) = $self->{PINCDIRS};
204
    my( $list ) = $self->{PINCDIRS};
217
 
205
 
218
    return if ( $$examined{$path} );
206
    return if ( $$examined{$path} );
219
    $$examined{$path} = 1;
207
    $$examined{$path} = 1;
220
 
208
 
221
    push @$list, $path      if ( $self->{'sandbox'} || -d $self->{'base'}.$path );
209
    push @$list, $path      if ( -d $self->{'base'}.$path );
222
}
210
}
223
 
211
 
224
#
212
#
225
#   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
226
#   Simplify Lib Path searching by removing useless paths.
214
#   Simplify Lib Path searching by removing useless paths.
Line 254... Line 242...
254
    my( $list ) = $self->{PLIBDIRS};
242
    my( $list ) = $self->{PLIBDIRS};
255
 
243
 
256
    return if ( $$examined{$path} );
244
    return if ( $$examined{$path} );
257
    $$examined{$path} = 1;
245
    $$examined{$path} = 1;
258
 
246
 
259
    push @$list, $path."D"  if ( $self->{'sandbox'} || isUsefulDir($self->{'base'}.$path."D") );
247
    push @$list, $path."D"  if ( isUsefulDir($self->{'base'}.$path."D") );
260
    push @$list, $path."P"  if ( $self->{'sandbox'} || isUsefulDir($self->{'base'}.$path."P") );
248
    push @$list, $path."P"  if ( isUsefulDir($self->{'base'}.$path."P") );
261
    push @$list, $path      if ( $self->{'sandbox'} || isUsefulDir($self->{'base'}.$path) );
249
    push @$list, $path      if ( isUsefulDir($self->{'base'}.$path) );
262
}
250
}
263
 
251
 
264
#-------------------------------------------------------------------------------
252
#-------------------------------------------------------------------------------
265
# Function        : ExamineToolPath
253
# Function        : ExamineToolPath
266
#
254
#