IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 20, 2008, 5:37:35 PM (17 years ago)
Author:
Paul Price
Message:

Allow products to be specified.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/diff_outputs.pl

    r20616 r20811  
    2323my ($diff_id);                  # Diff of interest
    2424my ($input);                    # Input list
     25my ($products);                 # Products of interest
    2526
    2627GetOptions(
     
    3031           'dbpass=s' => \$db_pw, # Database p/w
    3132           'diff_id=s' => \$diff_id, # Diff identifier
     33           'products=s' => \$products, # Products of interest
    3234           ) or die "Unable to parse arguments.\n";
    3335die "Unknown option: @ARGV\n" if @ARGV;
     
    5456                                     ) or die "Unable to execute SQL: $DBI::errstr";
    5557
     58my @products;                   # Array of products
     59if (defined $products) {
     60    @products = split /,/, $products;
     61} else {
     62    @products = keys %{EXTENSIONS()};
     63}
     64
    5665foreach my $diff ( @$diffs ) {
    57     copy_extensions( $diff, EXTENSIONS() );
     66    foreach my $product ( @products ) {
     67        copy_extension( $diff, ${EXTENSIONS()}{$product} );
     68    }
    5869}
     70
    5971
    6072# Pau.
    6173
    6274
    63 sub copy_extensions
     75sub copy_extension
    6476{
    6577    my $path = shift;           # Path to copy
    66     my $extensions = shift;     # Extensions structure
     78    my $ext = shift;            # Extension to copy
    6779
    68     foreach my $type ( keys %$extensions ) {
    69         my $ext = $$extensions{$type}; # Extension
    70         my $file = "$path$ext"; # File
    71         my $source = `ipp_datapath.pl $file` or die "Unable to locate $file\n"; # Actual file
    72         chomp $source;
    73         my ($target) = $source =~ m|^.*[:/](.*)|; # Target name
    74         !system "cp $source $target" or die "Unable to copy $source\n";
    75     }
     80    my $file = "$path$ext";     # File
     81    my $source = `ipp_datapath.pl $file` or die "Unable to locate $file\n"; # Actual file
     82    chomp $source;
     83    my ($target) = $source =~ m|^.*[:/](.*)|; # Target name
     84    !system "cp $source $target" or die "Unable to copy $source\n";
    7685}
Note: See TracChangeset for help on using the changeset viewer.