ocdbregex='raw://'
if [[ ${ocdbStorage} =~ ${ocdbregex} ]]; then
- alien-token-init
+ alien-token-init ${alienUserName}
+ #this is a hack! alien-token init seems not enough
+ #but the gclient_env script messes up the LD_LIBRARY_PATH
+ while read x; do
+ eval ${x};
+ done < <(grep -v "LD_LIBRARY_PATH" /tmp/gclient_env_${UID})
fi
updateQA $@
for detectorScript in $ALICE_ROOT/PWGPP/QA/detectorQAscripts/*; do
echo
echo "##############################################"
+ echo $(date)
unset planB
[[ ! ${detectorScript} =~ .*\.sh$ ]] && continue
detector=${detectorScript%.sh}
echo " outputDir=$outputDir"
echo " tmpPrefix=$tmpPrefix"
+ #unset the detector functions from previous iterations (detectors)
unset -f runLevelQA
unset -f periodLevelQA
unset -f runLevelHighPtTreeQA
declare -A arrOfTouchedProductions
while read qaFile; do
echo
+ echo $(date)
#first check if input file exists
[[ ! -f ${qaFile%\#*} ]] && echo "file ${qaFile%\#*} not accessible" && continue
cd ${tmpProductionDir}
echo
echo "running period level stuff in ${tmpProductionDir}"
+ echo $(date)
productionDir=${outputDir}/${tmpProductionDir#${tmpPrefix}}
echo productionDir=${outputDir}/${tmpProductionDir#${tmpPrefix}}
echo
echo "trouble detected, sending email to ${MAILTO}"
- cat ${logSummary} | mail -s "qa in need of assistance" ${MAILTO}
+ grep BAD ${logSummary} | mail -s "qa in need of assistance" ${MAILTO}
fi
}
parseConfig()
{
+ args=("$@")
+
#config file
configFile=""
#where to search for qa files
#logs
logDirectory=${workingDirectory}/logs
#OCDB storage
- #ocdbStorage="raw://"
+ ocdbStorage="raw://"
#email to
#MAILTO="fbellini@cern.ch"
#first, check if the config file is configured
#is yes - source it so that other options can override it
#if any
- for opt in $@; do
+ for opt in "${args[@]}"; do
if [[ ${opt} =~ configFile=.* ]]; then
eval "${opt}"
[[ ! -f ${configFile} ]] && echo "configFile ${configFile} not found, exiting..." && return 1
+ echo "using config file: ${configFile}"
source "${configFile}"
break
fi
done
#then, parse the options as they override the options from file
- while [[ -n ${1} ]]; do
- local var=${1#--}
- if [[ ${var} =~ .*=.* ]]; then
- eval "${var}"
- else
+ for opt in "${args[@]}"; do
+ if [[ ! "${opt}" =~ .*=.* ]]; then
echo "badly formatted option ${var}, should be: option=value, stopping..."
return 1
fi
- shift
+ local var="${opt%%=*}"
+ local value="${opt#*=}"
+ echo "${var} = ${value}"
+ export ${var}="${value}"
done
}