Index: trunk/ippScripts/scripts/minidvodb_merge.pl
===================================================================
--- trunk/ippScripts/scripts/minidvodb_merge.pl	(revision 32701)
+++ trunk/ippScripts/scripts/minidvodb_merge.pl	(revision 32712)
@@ -93,6 +93,26 @@
     if (defined $mergedvodbReal) {
 
-	#this is chopped into several parts:  addstar, relphot, dvoverify, merge
-
+	#this is chopped into several parts: firstcheck, addstar, relphot, dvoverify, merge
+        
+        #first check that there were no faulted merges before. If there are, fault this merge with PS_EXIT_UNKNOWN_ERROR
+	{
+	    my $nothing_faulted = 0;
+	    my $mdcParser = PS::IPP::Metadata::Config->new;
+
+            my $command = "$addtool -listminidvodbprocessed -faulted -minidvodb_group " . $minidvodb_group;
+            $command .= " -dbname $dbname" if defined $dbname;
+
+            my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
+                    run(command => $command, verbose => $verbose);
+            &my_die( "Unable to get list of faulted minidvodbs", $minidvodb_id, $PS_EXIT_SYS_ERROR) unless $success;
+            if (scalar @$stdout_buf == 0 ) { #it lists nothing if nothign has faulted
+                $nothing_faulted =1;
+		print "previous merges are okay.\n";
+            } 
+	    &my_die( "Previous merges faulted, do not proceed until they are investigated:", $minidvodb_group, $PS_EXIT_UNKNOWN_ERROR) unless $nothing_faulted;
+
+
+ 
+	}
 
 	#addstar
