]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWGPP/CalibMacros/AliOCDBtoolkit.sh
Merge branch 'feature-movesplit'
[u/mrichter/AliRoot.git] / PWGPP / CalibMacros / AliOCDBtoolkit.sh
old mode 100644 (file)
new mode 100755 (executable)
index 87ce236..f76fd88
@@ -1,6 +1,9 @@
 #!/bin/bash
 #
 # Shell script to compare content of the OCDB entries.
+# Usage:
+# 1) source functios 
+# source $ALICE_ROOT/PWGPP/CalibMacros/AliOCDBtoolkit.sh
 #
 # ocdbMakeTable() 
 #       Usage: bash $inputFile $flag $outputFile
@@ -10,6 +13,9 @@
 #       Usage: bash $inputFile1 $inputFile2 $object_name $dump_type [XML/MI] $outfile
 # Example usage:  see example functions below
 
+# Origin marian.ivanov@cern.ch,  j.wagner@cern.ch
+
+
 ocdbMakeTable(){
 #
 # create a text file with the OCDB setupt descriptors#
@@ -27,17 +33,18 @@ ocdbMakeTable(){
         echo "Usage: $0 \$inputFile \$flag \$outputFile"
         return 1
     fi
+    export ALIROOT_FORCE_COREDUMP=1
     local inFile=${1}
     local inFlag=${2}
     local outFile=${3}
     shift 3
-    if [ ! -f ${inFile} ] ; then 
-        echo ${inFile} not found!
-        return 1
-    fi
-    if [ -f ${outFile} ] ; then 
-        >${outFile}
-    fi
+    #if [ ! -f ${inFile} ] ; then 
+    #    echo ${inFile} not found!
+    #    return 1
+    #fi
+    #if [ -f ${outFile} ] ; then 
+    #    >${outFile}
+    #fi
 
     tmpscript=$(mktemp)
     cat > ${tmpscript} <<HEREDOC
@@ -61,6 +68,7 @@ dumpObject(){
 #    $3 type of the dump (XML or MI recursive dump )
 #  Output:
 #    $4 output file name   
+    export ALIROOT_FORCE_COREDUMP=1
     if [ $# -lt 4 ] ; then
         echo "Usage: $0 \$inputFile \$object_name \$dump_type [XML/MI] \$outfile"
         return 1
@@ -70,10 +78,10 @@ dumpObject(){
     local ftype=${3}
     local outFile=${4}
     shift 4
-    if [ ! -f ${inFile} ] ; then 
-        echo ${inFile} not found!
-        return 1
-    fi
+#    if [ ! -f ${inFile} ] ; then 
+#        echo ${inFile} not found!
+#        return 1
+#    fi
     if [ -f ${outFile} ] ; then 
         >${outFile}
     fi
@@ -107,6 +115,7 @@ diffObject(){
 #    $4 type of the dump (xml or MI recursive dump )
 #  Output:
 #    $5 output diff file name   
+    export ALIROOT_FORCE_COREDUMP=1
     if [ $# -lt 5 ] ; then
         echo "Usage: $0 \$inputFile1 \$inputFile2 \$object_name \$dump_type [XML/MI] \$outfile"
         return 1
@@ -145,7 +154,7 @@ dumpOCDBDiffTable(){
 #   $2  - list 2
 # Output:
 #   difference is stdout
-
+    export ALIROOT_FORCE_COREDUMP=1
     list1=$1
     list2=$2
     shift 2
@@ -196,3 +205,17 @@ developerTest(){
     example2
     example3
 }
+
+
+diffConfig(){
+    #
+    # diff configuaration files ignoring trivial differences between the OCDBprefixes 
+    #
+    file1=$1
+    file2=$2
+
+    cat $file1 | sed s_"alien://folder="_"ocdbprefix"_g | sed s_"alien://Folder="_"ocdbprefix"_g | sed s_"local://\${ALICE\_OCDB}"_"ocdbprefix"_g  >${file1}_ocdbstripped
+    cat $file2 | sed s_"alien://folder="_"ocdbprefix"_g | sed s_"alien://Folder="_"ocdbprefix"_g | sed s_"local://\${ALICE\_OCDB}"_"ocdbprefix"_g   >${file2}_ocdbstripped
+    diff  ${file1}_ocdbstripped  ${file2}_ocdbstripped  > ${file1}_ocdbstrippeddiff
+
+}
\ No newline at end of file