Index: trunk/ippScripts/scripts/minidvodb_merge.pl
===================================================================
--- trunk/ippScripts/scripts/minidvodb_merge.pl	(revision 28211)
+++ trunk/ippScripts/scripts/minidvodb_merge.pl	(revision 28221)
@@ -138,4 +138,5 @@
             if (scalar @$stdout_buf == 0 ) { #it lists nothing if it is the first
                 $this_is_the_first =1;
+		print "listing nothing\n";
             } else {
                 my $metadata = $mdcParser->parse(join "", @$stdout_buf) or
@@ -150,21 +151,25 @@
                     &my_die("Unable to parse minidvodb_name", $minidvodb_id, $PS_EXIT_PROG_ERROR);
                 } #but just to make sure, have it grab a minidvodb_name, to make sure it's not junk.
+		print "found at least 1 minidvodbrun in merged state\n";
                 $this_is_the_first = 0;
             }
         }
-	{
-	    if (!-e "$mergedvodb/Image.dat") {
-		$this_is_the_first = 1; #the first time it copied maybe it failed? we want it to copy this time
+	print "$this_is_the_first $mergedvodb/Image.dat\n";
 	
+	 
+	if (-e "$mergedvodb/Image.dat") {
+	    if ($this_is_the_first == 1) {
+		&my_die("refusing to merge, this is the first, but files already exist in dir", $minidvodb_id, 4);
 	    }
-
+	    $this_is_the_first =0;
 	}
-
+	
+	print "$this_is_the_first $mergedvodb/Image.dat\n";
         {
             my $merge_command;
 	    my $mjd_merge_start = DateTime->now->mjd;   # MJD of starting script
             if ($this_is_the_first) {
+		
 		$merge_command = "cp -rp $minidvodb/* $mergedvodb";
-		print "$merge_command\n";
 	    } else {
                 $merge_command = "$dvomerge $minidvodb into $mergedvodb";
