Index: branches/cnb_branch_20090113/tools/diff_inputs.pl
===================================================================
--- branches/eam_branch_20081230/tools/diff_inputs.pl	(revision 21072)
+++ branches/cnb_branch_20090113/tools/diff_inputs.pl	(revision 21120)
@@ -64,6 +64,6 @@
     "         OR warpSkyfile.warp_id = diffInputSkyfile.warp2)" .
     " WHERE diff_id = $diff_id";
-$sql .= " AND diffInputSkyfile.skycell_id = $skycell_id" if defined $skycell_id;
-$sql.= " UNION" .
+$sql .= " AND diffInputSkyfile.skycell_id = \'$skycell_id\'" if defined $skycell_id;
+$sql .= " UNION" .
     " SELECT" .
     "     NULL AS warp_path_base," .
@@ -75,5 +75,5 @@
     "         OR stackSumSkyfile.stack_id = diffInputSkyfile.stack2)" .
     " WHERE diff_id = $diff_id";
-$sql .= " AND diffInputSkyfile.skycell_id = $skycell_id" if defined $skycell_id;
+$sql .= " AND diffInputSkyfile.skycell_id = \'$skycell_id\'" if defined $skycell_id;
 
 
Index: branches/cnb_branch_20090113/tools/stack_outputs.pl
===================================================================
--- branches/eam_branch_20081230/tools/stack_outputs.pl	(revision 21072)
+++ branches/cnb_branch_20090113/tools/stack_outputs.pl	(revision 21120)
@@ -25,4 +25,5 @@
 my ($stack_id);                  # Stack of interest
 my ($input);                    # Input list
+my ($products);                 # Products of interest
 
 GetOptions(
@@ -32,4 +33,5 @@
            'dbpass=s' => \$db_pw, # Database p/w
            'stack_id=s' => \$stack_id, # Stack identifier
+           'products=s' => \$products, # Products of interest
            ) or die "Unable to parse arguments.\n";
 die "Unknown option: @ARGV\n" if @ARGV;
@@ -56,6 +58,15 @@
                                      ) or die "Unable to execute SQL: $DBI::errstr";
 
+my @products;                   # Array of products
+if (defined $products) {
+    @products = split /,/, $products;
+} else {
+    @products = keys %{EXTENSIONS()};
+}
+
 foreach my $stack ( @$stacks ) {
-    copy_extensions( $stack, EXTENSIONS() );
+    foreach my $product ( @products ) {
+        copy_extension( $stack, ${EXTENSIONS()}{$product} );
+    }
 }
 
@@ -63,16 +74,13 @@
 
 
-sub copy_extensions
+sub copy_extension
 {
     my $path = shift;           # Path to copy
-    my $extensions = shift;     # Extensions structure
+    my $ext = shift;            # Extension to copy
 
-    foreach my $type ( keys %$extensions ) {
-        my $ext = $$extensions{$type}; # Extension
-        my $neb = "$path$ext"; # Nebulous file
-        my $source = `neb-locate --path $neb` or die "Unable to locate $neb\n"; # Actual file
-        chomp $source;
-        my ($target) = $source =~ m|^.*:(.*)|; # Target name
-        !system "cp $source $target" or die "Unable to copy $source\n";
-    }
+    my $file = "$path$ext"; # File
+    my $source = `ipp_datapath.pl $file` or die "Unable to locate $file\n"; # Actual file
+    chomp $source;
+    my ($target) = $source =~ m|^.*[:/](.*)|; # Target name
+    !system "cp $source $target" or die "Unable to copy $source\n";
 }
