Subversion Repositories DevTools

Rev

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

Rev 6364 Rev 6730
Line 270... Line 270...
270
#                   Scan packages for the Debian package specified
270
#                   Scan packages for the Debian package specified
271
#                   The user provides the base name of the package
271
#                   The user provides the base name of the package
272
#                   A Debian Package name has several fields
272
#                   A Debian Package name has several fields
273
#                   These are:
273
#                   These are:
274
#                       1) Base Name - Provided by the user
274
#                       1) Base Name - Provided by the user
275
#                       2) Version - Version will be wildcarded
275
#                       2) Version - Default Version will be wildcarded if it hadn't been provided by user
276
#                       3) Architecture - Wildcarded. Uses bin/arch directory
276
#                       3) Architecture - Wildcarded. Uses bin/arch directory
277
#
277
#
278
#                   Expect to find Debian Packages in the bin/PLATFORM subdir
278
#                   Expect to find Debian Packages in the bin/PLATFORM subdir
279
#
279
#
280
# Inputs          : Debian base name, complete with suboptions
280
# Inputs          : Debian base name, complete with suboptions
Line 287... Line 287...
287
    Verbose("LocateDebianFile: Processing: $arg");
287
    Verbose("LocateDebianFile: Processing: $arg");
288
 
288
 
289
    my @type = qw( P D );
289
    my @type = qw( P D );
290
    my @debian_file_path;
290
    my @debian_file_path;
291
    my @searchPath;
291
    my @searchPath;
-
 
292
    my $version='*';
292
 
293
 
293
    #
294
    #
294
    #   Extract sub-options
295
    #   Extract sub-options
295
    #       --Prod[uction]
296
    #       --Prod[uction]
296
    #       --Debug
297
    #       --Debug
297
    #       --Arch[itecture]=yyy
298
    #       --Arch[itecture]=yyy
298
    #       --Product=yyy
299
    #       --Product=yyy
-
 
300
    #       --Version=yy.yy.yyyyy  default value is wildcard 
299
    #
301
    #
300
    my ($base_name, @opts) = split( ',', $arg );
302
    my ($base_name, @opts) = split( ',', $arg );
301
    foreach ( @opts )
303
    foreach ( @opts )
302
    {
304
    {
303
        if ( m/^--Arch(.*)=(.+)/ ) {
305
        if ( m/^--Arch(.*)=(.+)/ ) {
Line 306... Line 308...
306
            $product=$1;
308
            $product=$1;
307
        } elsif ( m/^--Prod/ ) {
309
        } elsif ( m/^--Prod/ ) {
308
            @type = 'P';
310
            @type = 'P';
309
        } elsif ( m/^--Debug/ ) {
311
        } elsif ( m/^--Debug/ ) {
310
            @type = 'D';
312
            @type = 'D';
-
 
313
        } elsif ( m/^--Version=(.+)/ ) {
-
 
314
            $version=$1;
311
        } else {
315
        } else {
312
            Warning ('--Debian: Unknown Option: ' . $_);
316
            Warning ('--Debian: Unknown Option: ' . $_);
313
        }
317
        }
314
    }
318
    }
315
 
319
 
Line 333... Line 337...
333
                foreach my $joiner ( qw(/ .) )
337
                foreach my $joiner ( qw(/ .) )
334
                {
338
                {
335
                    my $dir = "$package_dir/bin$joiner$prd$type";
339
                    my $dir = "$package_dir/bin$joiner$prd$type";
336
                    UniquePush(\@searchPath, $dir);
340
                    UniquePush(\@searchPath, $dir);
337
                    next unless ( -d $dir );
341
                    next unless ( -d $dir );
338
                    my @files = glob ( "$dir/${base_name}_*.deb" );
342
                    my @files = glob ( "$dir/${base_name}_${version}_*.deb" );
339
                    next unless ( @files );
343
                    next unless ( @files );
340
                    push @debian_file_path, @files;
344
                    push @debian_file_path, @files;
341
                    $package_dirs{$package_dir}{used} = 1;
345
                    $package_dirs{$package_dir}{used} = 1;
342
                }
346
                }
343
            }
347
            }
Line 346... Line 350...
346
        {
350
        {
347
            foreach my $prd ( @products )
351
            foreach my $prd ( @products )
348
            {
352
            {
349
                my $dir = "$package_dir";
353
                my $dir = "$package_dir";
350
                UniquePush(\@searchPath, $dir);
354
                UniquePush(\@searchPath, $dir);
351
                next unless ( -d $dir );
355
                next unless ( -d $dir ); 
-
 
356
                if ( $version eq "*" ){
352
                my @files = glob ( "$dir/${base_name}_*_${prd}_${type}.deb" );
357
                    my @files = glob ( "$dir/${base_name}_${version}_${prd}_${type}.deb" );
353
                next unless ( @files );
358
                    if ( @files ){
354
                push @debian_file_path, @files;
359
                        push @debian_file_path, @files;
-
 
360
                        $package_dirs{$package_dir}{used} = 1;
-
 
361
                    }
-
 
362
                }
-
 
363
                else{
-
 
364
                    if( -e "$dir/${base_name}_${version}_${prd}_${type}.deb" ) {
-
 
365
                        my $file = "$dir/${base_name}_${version}_${prd}_${type}.deb";
-
 
366
                        push(@debian_file_path, $file);
-
 
367
                        $package_dirs{$package_dir}{used} = 1;
-
 
368
                    } elsif ( -e "$dir/${base_name}_${version}_${prd}.deb") {
-
 
369
                        my $file = "$dir/${base_name}_${version}_${prd}.deb";
-
 
370
                        push(@debian_file_path, $file);
355
                $package_dirs{$package_dir}{used} = 1;
371
                        $package_dirs{$package_dir}{used} = 1;
-
 
372
                    } 
-
 
373
                }
356
            }
374
            }
357
        }
375
        }
358
    }
376
    }
359
 
377
 
360
    #
378
    #
Line 363... Line 381...
363
    #
381
    #
364
    if (IsVerbose(1) || IsDebug(1) || $#debian_file_path != 0)
382
    if (IsVerbose(1) || IsDebug(1) || $#debian_file_path != 0)
365
    {
383
    {
366
        Message ("Search for ($base_name). In search Path", @searchPath);
384
        Message ("Search for ($base_name). In search Path", @searchPath);
367
    }
385
    }
368
 
386
    
369
    ReportError ("Required Debian package not found: $base_name") unless @debian_file_path;
387
    ReportError ("Required Debian package not found: $base_name") unless @debian_file_path;
370
    ReportError ("Multiple matching Debian Packages located: $base_name", @debian_file_path ) if ( $#debian_file_path > 0 );
388
    ReportError ("Multiple matching Debian Packages located: $base_name", @debian_file_path ) if ( $#debian_file_path > 0 );
371
    return $debian_file_path[0];
389
    return $debian_file_path[0];
372
}
390
}
373
 
391