Index: trunk/MagicSoft/Mars/datacenter/scripts/dbchk
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/dbchk	(revision 8063)
+++ trunk/MagicSoft/Mars/datacenter/scripts/dbchk	(revision 8065)
@@ -6,4 +6,6 @@
 # directory where the sequence files are stored
 sequencedir=/magic/sequences
+callistodir=/magic/data/callisto
+stardir=/magic/data/star
 # access to the sql database
 alias mymysql='mysql -s -u MAGIC -h hercules --password=d99swMT!'
@@ -17,8 +19,10 @@
 # Cross check sequences in Sequence and other databases
 # added switch which allows to correct for the problems immediatly
+# unify the checks (especially 1b and 1c)
+# for the sequences better use 0* instead of 0+ ?
 
 
 # CHECK 1
-echo Checking if all sequences in Sequences have a corresponding sequence files
+echo Checking if all sequence files have a corresponding entry in Sequences
 files=`find $sequencedir -type f`
 for file in $files
@@ -27,5 +31,5 @@
    if [ "$sequence" = "" ]
    then
-      echo No sequence file: $sequence
+      echo No sequence file: $file
       continue
    fi
@@ -34,5 +38,45 @@
    if ! [ "$sequence" = "$var" ]
    then
-      echo Sequence-File $sequence exist but it is not in the db.
+      echo Sequence-File $sequence exist but it is not in Sequences.
+      continue
+   fi
+done
+
+# CHECK 1b (callisto)
+echo Checking if all sequences in $callistodir have a corresponding sequence in Sequence
+dirs=`find $callistodir -type d`
+for dir in $dirs
+do
+   sequence=`echo $file | sed -e "s/^.*\/0\+\([0-9]\+\)$/\1/"`
+   if [ "$sequence" = "" ]
+   then
+      echo Invalid directory: $dir
+      continue
+   fi
+
+   var=`echo SELECT fSequenceFirst FROM $db.Sequences WHERE fSequenceFirst=$sequence | mymysql`
+   if ! [ "$sequence" = "$var" ]
+   then
+      echo $dir exists but no corresponding sequence in Sequences.
+      continue
+   fi
+done
+
+# CHECK 1c (star)
+echo Checking if all sequences in $stardir have a corresponding sequence in Sequence
+dirs=`find $stardir -type d`
+for dir in $dirs
+do
+   sequence=`echo $file | sed -e "s/^.*\/0\+\([0-9]\+\)$/\1/"`
+   if [ "$sequence" = "" ]
+   then
+      echo Invalid directory: $dir
+      continue
+   fi
+
+   var=`echo SELECT fSequenceFirst FROM $db.Sequences WHERE fSequenceFirst=$sequence | mymysql`
+   if ! [ "$sequence" = "$var" ]
+   then
+      echo $dir exists but no corresponding sequence in Sequences.
       continue
    fi
@@ -40,9 +84,9 @@
 
 # CHECK 2
-echo Checking if all sequence files have a corresponding entry in Sequences
+echo Checking if all sequences in Sequences have a corresponding sequence files
 sequences=`echo SELECT fSequenceFirst FROM $db.Sequences | mymysql`
 for sequence in $sequences
 do
-   var=`find $sequencedir -regex .*/sequence0+${sequence}\.txt$`
+   var=`find $sequencedir -type f -regex .*/sequence0+${sequence}\.txt$`
    if [ "$var" = "" ]
    then
Index: trunk/MagicSoft/Mars/datacenter/scripts/sourcefile
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/sourcefile	(revision 8063)
+++ trunk/MagicSoft/Mars/datacenter/scripts/sourcefile	(revision 8065)
@@ -114,6 +114,7 @@
 
 
-# alias
-alias 'intgrep'='grep -E ^\\\(int\\\)[0-9]+$ | sed -e s\/\(int\)\/\/'
+# alias (we cannot check the beginning of the line due to
+# color codes in filldotraw.C)
+alias 'intgrep'='grep -E -o \\\(int\\\)[0-9]+$'
 
 # in the following the functions, which are needed by several scripts, are 
