Subversion Repositories DevTools

Rev

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

Rev 261 Rev 267
Line 147... Line 147...
147
# Function        : locate
147
# Function        : locate
148
#
148
#
149
# Description     : Locate all build files within a given directory tree
149
# Description     : Locate all build files within a given directory tree
150
#                   Collects the data and builds up a data structure
150
#                   Collects the data and builds up a data structure
151
#
151
#
-
 
152
#                   If the file is an xml file, then we are looking for
-
 
153
#                   an ant pair of files.
-
 
154
#
152
# Inputs          : $self
155
# Inputs          : $self
153
#
156
#
154
# Returns         : Number of buildfiles found 0,1 ....
157
# Returns         : Number of buildfiles found 0,1 ....
155
#
158
#
156
sub locate
159
sub locate
Line 163... Line 166...
163
 
166
 
164
    our  $ff_datap = \@{$self->{info}};
167
    our  $ff_datap = \@{$self->{info}};
165
    our  $ff_file = $self->{file};
168
    our  $ff_file = $self->{file};
166
    our  $ff_all = $self->{locateAll};
169
    our  $ff_all = $self->{locateAll};
167
    our  $ff_self = $self;
170
    our  $ff_self = $self;
-
 
171
    our  $ff_ant = ( $ff_file =~ m~(.+)\.xml$~i ) ? $1 : '';
168
 
172
 
169
    sub find_file_wanted
173
    sub find_file_wanted
170
    {
174
    {
171
        if ( $_ eq $ff_file  )
175
        if ( $_ eq $ff_file  )
172
        {
176
        {
-
 
177
            if ( $ff_ant )
-
 
178
            {
-
 
179
                if ( -f (${ff_ant} . 'depends.xml') )
-
 
180
                {
-
 
181
                    Verbose ("find_file_wanted: FOUND $File::Find::dir, $_");
-
 
182
                    push @{$ff_datap}, BuildEntry( $File::Find::dir, $_, 2);
-
 
183
                }
-
 
184
            }
-
 
185
            else
-
 
186
            {
173
            Verbose ("find_file_wanted: FOUND $File::Find::dir, $_");
187
                Verbose ("find_file_wanted: FOUND $File::Find::dir, $_");
174
            push @{$ff_datap}, BuildEntry( $File::Find::dir, $_, 1);
188
                push @{$ff_datap}, BuildEntry( $File::Find::dir, $_, 1);
-
 
189
            }
-
 
190
            return;    
175
        }
191
        }
176
 
192
 
177
        #
193
        #
178
        #   Detect ANT {packagename}depends.xml file
194
        #   Detect ANT {packagename}depends.xml file
179
        #   These are file pairs (mostly)
195
        #   These are file pairs (mostly)
Line 422... Line 438...
422
 
438
 
423
    $self->{match} = [];
439
    $self->{match} = [];
424
 
440
 
425
    foreach my $be ( @{$self->{info}} )
441
    foreach my $be ( @{$self->{info}} )
426
    {
442
    {
-
 
443
        next unless ( $be->{name} &&  $be->{version}  );
427
        if ( $package eq $be->{mname} || $package eq $be->{full} )
444
        if ( $package eq $be->{mname} || $package eq $be->{full} )
428
        {
445
        {
429
            push @{$self->{match}}, $be;
446
            push @{$self->{match}}, $be;
430
        }
447
        }
431
    }
448
    }
Line 511... Line 528...
511
    #
528
    #
512
    #   Travserse the internal data
529
    #   Travserse the internal data
513
    #
530
    #
514
    foreach my $be ( @{$self->{info}} )
531
    foreach my $be ( @{$self->{info}} )
515
    {
532
    {
516
        my $package = $be->{mname};
533
        my $package = $be->{mname} || '-Undefined-';
517
        my $path = "$be->{dir}/$be->{file}";
534
        my $path = "$be->{dir}/$be->{file}";
518
        my $len = length $path;
535
        my $len = length $path;
519
        $max_len = $len if ( $len > $max_len );
536
        $max_len = $len if ( $len > $max_len );
520
        $data{$path} = $package;
537
        $data{$path} = $package;
521
    }
538
    }