Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 8851)
+++ trunk/MagicSoft/Mars/Changelog	(revision 8857)
@@ -18,4 +18,12 @@
 
                                                  -*-*- END OF LINE -*-*-
+
+ 2008/02/08 Stefan Ruegamer
+
+   * datacenter/scripts/checkmd5sum
+     - added check to prevent that checksums of files not read from tape
+       enter the .lapalma file
+
+
 
  2008/02/01 Stefan Ruegamer
Index: trunk/MagicSoft/Mars/datacenter/scripts/checkmd5sum
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/checkmd5sum	(revision 8851)
+++ trunk/MagicSoft/Mars/datacenter/scripts/checkmd5sum	(revision 8857)
@@ -1,3 +1,3 @@
-#!/bin/sh
+#!/bin/bash
 #
 # ========================================================================
@@ -46,19 +46,19 @@
 if [ ! -f $file ]
 then
-	echo "tape $file not found -> aborting"
-        exit
+   echo "tape $file not found -> aborting"
+   exit
 fi
 
-if [ ${checkpath}/tape_${id}.md5.lapalma ] || [ -f ${checkpath}/tape_${id}.md5.wue ]
+if [ -f ${checkpath}/tape_${id}.md5.lapalma ] || [ -f ${checkpath}/tape_${id}.md5.wue ]
 then
-	echo "Output files already existing. Are you sure you wish to continue (yes/no)?"
-        read cont
-        if [ ! $cont == "yes" ]
-        then
-        	echo "Aborting."
-	        exit
-        fi
+   echo "Output files already existing. Are you sure you wish to continue (yes/no)?"
+   read cont
+   if [ ! $cont == "yes" ]
+   then
+      echo "Aborting."
+      exit
+   fi
 fi
-        
+
 date | tee ${checkpath}/tape_${id}.md5.lapalma | tee ${checkpath}/tape_${id}.md5.wue
 
@@ -66,15 +66,24 @@
 while read line
 do
-	muxchk=`echo $line | cut -d/ -f1`
-        # only check muxdata, not cc-, caco- or drivelog-files
-        if [ "$muxchk" = "muxdata" ]
-        then
-		sum=($line)
-                # reformat the files and checksums correctly and compare them
-	        echo "${sum[1]}  ${sum[0]}" >> ${checkpath}/tape_${id}.md5.lapalma
-		
-         	ssh -nx phoenix nice -n 19 /opt/csw/bin/gmd5sum /magic/datacenter/fromtape/${sum[0]} | sed -e 's/\/magic\/datacenter\/fromtape\///' >> ${checkpath}/tape_${id}.md5.wue
-                #md5sum /magic/datacenter/fromtape/${sum[0]} | sed -e 's/\/magic\/datacenter\/fromtape\///' >> ${checkpath}/tape_${id}.md5.wue
-        fi
+   muxchk=`echo $line | cut -d/ -f1`
+   type=`echo $line | cut -d_ -f7 | cut -c0-5`
+   # only check muxdata rawfiles, not cc-, caco- or drivelog-files
+   if [ "$muxchk" = "muxdata" ] && [ "$type" = "E.raw" ]
+   then
+      sum=($line)
+      
+      # check if the file has been extracted from tape; if not, don't write anything to the logfiles (so they can still be compared)
+      if [ ! -f /magic/datacenter/fromtape/${sum[0]} ]
+      then
+      	echo "File ${sum[0]} does not exist."
+        continue
+      fi
+      
+      # reformat the files and checksums correctly and compare them
+      echo "${sum[1]}  ${sum[0]}" >> ${checkpath}/tape_${id}.md5.lapalma
+      
+      ssh -nx phoenix nice -n 19 /opt/csw/bin/gmd5sum /magic/datacenter/fromtape/${sum[0]} | sed -e 's/\/magic\/datacenter\/fromtape\///' >> ${checkpath}/tape_${id}.md5.wue
+      #md5sum /magic/datacenter/fromtape/${sum[0]} | sed -e 's/\/magic\/datacenter\/fromtape\///' >> ${checkpath}/tape_${id}.md5.wue
+   fi
 done < $file
 
@@ -83,6 +92,6 @@
 if [ ! -f ${checkpath}/tape_${id}.md5.lapalma ] || [ ! -f ${checkpath}/tape_${id}.md5.wue ]
 then
-	echo "No output files written! Something went wrong... -> aborting"
-        exit
+   echo "No output files written! Something went wrong... -> aborting"
+   exit
 fi
 
@@ -95,7 +104,7 @@
 if [ "$output" = "" ]
 then
-	echo "All checksums are ok!"
+   echo "All checksums are ok! Launching movingrawfiles now."# to be included
 else
-	echo -e "The files are not identical! diff found the following differences:\n$output"
+   echo -e "The files are not identical! diff found the following differences:\n$output"
 fi
 
