Changeset 20721
- Timestamp:
- Nov 13, 2008, 10:43:34 AM (17 years ago)
- File:
-
- 1 edited
-
trunk/tools/warp_outputs.pl (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/warp_outputs.pl
r20657 r20721 22 22 my ($skycell_id); # Skycell of interest 23 23 my ($input); # Input list 24 my ($products); # Products of interest 24 25 25 26 GetOptions( … … 30 31 'warp_id=s' => \$warp_id, # Warp identifier 31 32 'skycell_id=s' => \$skycell_id, # Skycell identifier 33 'products=s' => \$products, # Products of interest 32 34 ) or die "Unable to parse arguments.\n"; 33 35 die "Unknown option: @ARGV\n" if @ARGV; … … 47 49 48 50 # Query to run 49 my $sql = "SELECT path_base FROM warpSkyfile WHERE warp_id = $warp_id ";51 my $sql = "SELECT path_base FROM warpSkyfile WHERE warp_id = $warp_id AND ignored = 0"; 50 52 $sql .= " AND skycell_id = $skycell_id" if defined $skycell_id; 51 53 … … 55 57 ) or die "Unable to execute SQL: $DBI::errstr"; 56 58 59 my @products; # Array of products 60 if (defined $products) { 61 @products = split /,/, $products; 62 } else { 63 @products = keys %{EXTENSIONS()}; 64 } 65 57 66 foreach my $warp ( @$warps ) { 58 copy_extensions( $warp, EXTENSIONS() ); 67 foreach my $product ( @products ) { 68 copy_extension( $warp, ${EXTENSIONS()}{$product} ); 69 } 59 70 } 60 71 … … 62 73 63 74 64 sub copy_extension s75 sub copy_extension 65 76 { 66 77 my $path = shift; # Path to copy 67 my $ext ensions = shift; # Extensions structure78 my $ext = shift; # Extension to copy 68 79 69 foreach my $type ( keys %$extensions ) { 70 my $ext = $$extensions{$type}; # Extension 71 my $file = "$path$ext"; # File 72 my $source = `ipp_datapath.pl $file` or die "Unable to locate $file\n"; # Actual file 73 chomp $source; 74 my ($target) = $source =~ m|^.*[:/](.*)|; # Target name 75 !system "cp $source $target" or die "Unable to copy $source\n"; 76 } 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"; 77 85 }
Note:
See TracChangeset
for help on using the changeset viewer.
