X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=scripts%2Fclam%2Ftarget_runner.sh;fp=scripts%2Fclam%2Ftarget_runner.sh;h=d915a9aa9e0e32b2806cd4673603a2c1f3eca014;hb=e6e7566f88a1af46322a9727c81b67a7ed14ed33;hp=0000000000000000000000000000000000000000;hpb=6f7b84ee324f49d78c718ac5e88f23f25fac485f;p=feisty_meow.git diff --git a/scripts/clam/target_runner.sh b/scripts/clam/target_runner.sh new file mode 100644 index 00000000..d915a9aa --- /dev/null +++ b/scripts/clam/target_runner.sh @@ -0,0 +1,39 @@ +#!/bin/bash +############## +# Name : target_runner.sh +# Author : Chris Koeritz +# Rights : Copyright (C) 2012-$now by Feisty Meow Concerns, Ltd. +############## +# This script is free software; you can modify/redistribute it under the terms +# of the GNU General Public License. [ http://www.gnu.org/licenses/gpl.html ] +# Feel free to send updates to: [ fred@gruntose.com ] +############## +# +# Runs the programs listed in clam's RUN_TARGETS and reports any errors seen. + +#echo entering target_runner with variables: +#echo -e "\tRUN_TARGETS=${RUN_TARGETS}" +#echo -e "\tDIRTY_FILE=${DIRTY_FILE}" +#echo -e "\tSUBMAKE_FLAG=${SUBMAKE_FLAG}" +#echo -e "\tFAILURE_FILE=${FAILURE_FILE}" + +if [ ! -z "${RUN_TARGETS}" ]; then + if [ -f "${DIRTY_FILE}" -o -f "${SUBMAKE_FLAG}" ]; then + total_exitval=0; + for program_name in ${RUN_TARGETS}; do + base=$(basename $program_name); + "$program_name"; + exitval=$?; + if [ $exitval -ne 0 ]; then + echo "ERROR: $program_name exits with $exitval at $(date)"; + total_exitval=$(($total_exitval + 1)); + fi; + done; + if [ $total_exitval -ne 0 ]; then + echo "FAILURE: $total_exitval errors occurred in RUN_TARGETS."; + echo yep >"${FAILURE_FILE}"; + exit 1; + fi; + fi; +fi +