Index: trunk/ippScripts/scripts/warp_overlap.pl
===================================================================
--- trunk/ippScripts/scripts/warp_overlap.pl	(revision 12021)
+++ trunk/ippScripts/scripts/warp_overlap.pl	(revision 12043)
@@ -16,4 +16,5 @@
 use PS::IPP::Metadata::Config;
 use PS::IPP::Metadata::Stats;
+use PS::IPP::Metadata::List qw( parse_md_list );
 
 use PS::IPP::Config qw(
@@ -84,21 +85,30 @@
 	$imfile->{skycell_id} = 'default';
 	$imfile->{tess_id} = 'default';
+	$imfile->{fault} = 0;
     }
 }
-    
+
+if (defined $workdir) {
+    $workdir = $ipprc->convert_filename_absolute( $workdir );
+} else {
+    my $example = $ipprc->convert_filename_absolute( $$imfiles[0]->{uri} );
+    my ($vol, $dir, $file) = File::Spec->splitpath( $example );
+    $workdir = $dir;
+}
 
 # Generate a MDC file with the overlaps
-$workdir = $ipprc->convert_filename_absolute( $workdir );
-my $overlapName = File::Spec->catfile( $workdir, $warp_id . '.overlap.mdc' ); 
-open my $overlapFile, "> $overlapName" or
-    &my_die("Unable to open mdc file $overlapName", $warp_id, $PS_EXIT_DATA_ERROR);
+my $overlapName = File::Spec->catfile( $workdir, $warp_id . '.overlap.mdc' );
+open my $overlapFile, "> $overlapName" or die "Unable to open mdc file $overlapName";
 print $overlapFile "warpSkyCellMap MULTI\n\n";
 foreach my $imfile (@$imfiles) {
-    print $overlapFile "warp_id\t\tS32\t" . $imfile->{warp_id} . "\n";
-    print $overlapFile "skycell_id\tSTR\t" . $imfile->{skycell_id} . "\n";
-    print $overlapFile "tess_id\t\tSTR\t" . $imfile->{tess_id} . "\n";
-    print $overlapFile "exp_tag\t\tSTR\t" . $imfile->{exp_tag} . "\n";
-    print $overlapFile "p3_version\tS32\t" . $imfile->{p3_version} . "\n";
-    print $overlapFile "class_id\t\tSTR\t" . $imfile->{class_id} . "\n";
+    print $overlapFile "warpSkyCellMap\tMETADATA\n";
+    print $overlapFile "\twarp_id\tS32\t" . $warp_id . "\n";
+    print $overlapFile "\tskycell_id\tSTR\t" . $imfile->{skycell_id} . "\n";
+    print $overlapFile "\ttess_id\t\tSTR\t" . $imfile->{tess_id} . "\n";
+    print $overlapFile "\texp_tag\t\tSTR\t" . $imfile->{exp_tag} . "\n";
+    print $overlapFile "\tcam_version\tS32\t" . $imfile->{cam_version} . "\n";
+    print $overlapFile "\tclass_id\t\tSTR\t" . $imfile->{class_id} . "\n";
+    print $overlapFile "\tfault\tS16\t" . $imfile->{fault} . "\n";
+    print $overlapFile "END\n\n";
 }
 close $overlapFile;
@@ -106,5 +116,5 @@
 # Add the processed file to the database
 unless ($no_update) {
-    my $command = "$warptool -addoverlap -warp_id $warp_id -info $overlapName"; # Command to run warptool
+    my $command = "$warptool -addoverlap -mapfile $overlapName"; # Command to run warptool
     $command .= " -dbname $dbname" if defined $dbname;
 
@@ -129,9 +139,6 @@
 
     warn($msg);
-    if ($warp_id and not $no_update) {
-	my $command = "$warptool -addoverlap -warp_id $warp_id -code $exit_code";
-	$command .= " -dbname $dbname" if defined $dbname;
-        system ($command);
-    }
+
+    # No failure option on warptool for this mode, so just die.
     exit $exit_code;
 }
