From 488f0c66ddd69744a121673b05f2dccad8a7f206 Mon Sep 17 00:00:00 2001 From: jdh8d <jdh8d@git.zephyr-software.com> Date: Thu, 17 Mar 2016 15:07:39 +0000 Subject: [PATCH] added checking for unused --step name=on options Former-commit-id: 2afcee6536378508582ebfe076d01e49aa02cc0f --- tools/ps_analyze.sh | 43 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 37 insertions(+), 6 deletions(-) diff --git a/tools/ps_analyze.sh b/tools/ps_analyze.sh index d10163b27..ffa657c04 100755 --- a/tools/ps_analyze.sh +++ b/tools/ps_analyze.sh @@ -130,6 +130,7 @@ check_step_option() } + set_step_option() { step=`echo $1 | cut -d: -f1` @@ -169,8 +170,8 @@ usage() echo " --tempdir <dir> Specify where the temporary analysis files are stored, default is peasoup_executable_directory.<exe>.<pid>" echo " --backend <zipr|strata> Specify the backend rewriting technology to use. Default: Strata" echo " -b <zipr|strata> same as --backend " - echo " --stop_after <step> Stop ps_analyze after completeling the specified step." - echo " --stop_before <step> Stop ps_analyze before starting the specified step." + echo " --stop-after <step> Stop ps_analyze after completeling the specified step." + echo " --stop-before <step> Stop ps_analyze before starting the specified step." } @@ -214,8 +215,8 @@ check_options() --long tempdir: --long help --long usage - --long stop_after: - --long stop_before: + --long stop-after: + --long stop-before: " # solaris does not support long option names @@ -294,11 +295,11 @@ check_options() usage exit 1 ;; - --stop_before) + --stop-before) stop_before_step=$2 shift 2 ;; - --stop_after) + --stop-after) stop_after_step=$2 shift 2 ;; @@ -428,6 +429,33 @@ check_dependencies() return 1 } +check_steps_completed() +{ + #echo "Checking steps: $phases_spec" + for step_spec in $phases_spec + do + # if step is on. + if [ $(basename "$step_spec" =off) = "$step_spec" ]; then + # didn't find =off + step_name=$(basename $step_spec =on) + #echo "step name is: $step_name" + + echo "$performed_steps" | egrep "$step_name" > /dev/null + grep_res=$? + if [ $grep_res -ne 0 ] ; then + echo "*********************************************************" + echo "*********************************************************" + echo " Warning! Step requested, but not performed: $step_name " + echo "*********************************************************" + echo "*********************************************************" + warnings=1 + fi + + fi + + done +} + # # Detect if this step of the computation is on, and execute it. # @@ -439,6 +467,8 @@ perform_step() shift command="$*" + performed_steps="$performed_steps $step" + logfile=logs/$step.log if [ "$step" = "$stop_before_step" ]; then @@ -1105,6 +1135,7 @@ if [ ! -z $TIMER_PID ]; then kill -9 $TIMER_PID fi +check_steps_completed # # return success if we created a script to invoke the pgm and zipr is off. -- GitLab