#!/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
# 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#
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
# $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
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
# $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
# $2 - list 2
# Output:
# difference is stdout
-
+ export ALIROOT_FORCE_COREDUMP=1
list1=$1
list2=$2
shift 2
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