]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
format(sh): format shell scripts, leaving errors and warnings raised by shellcheck
authorSONOLET Aymeric <aymeric.sonolet@cea.fr>
Tue, 19 Dec 2023 16:47:26 +0000 (17:47 +0100)
committerSONOLET Aymeric <aymeric.sonolet@cea.fr>
Tue, 19 Dec 2023 16:47:26 +0000 (17:47 +0100)
16 files changed:
eclipse.sh
env_linux.sh
findDOSfiles.sh
findEndLines.sh
find_duplicated_images.sh
launcher_env.sh
launcher_salome_env.sh
lcov_reports.sh
make.sh
salome_run.sh
solver.sh
squishide_run.sh
src/XAO/tests/coverage_report.sh
test.sh
test_squish.sh
vnc-run

index 7bfacff03734881bc44714c97864af973c19a7ad..e21275007170be657a4928eeb98a5cb509f8d225 100755 (executable)
@@ -15,4 +15,4 @@ CMAKE_ARGS="${CMAKE_ARGS} ${SOURCES_DIR}"
 
 cmake -G "Eclipse CDT4 - Unix Makefiles" ${CMAKE_ARGS}
 
-/dn48/newgeom/common/eclipse-4.4.0/eclipse&
+/dn48/newgeom/common/eclipse-4.4.0/eclipse &
index 5dbe200badf9cb7222a9a2038d16023e3f790d04..fd7f181dc8a0c4cd86f2cf7d7f84d25f73e78774 100644 (file)
@@ -6,11 +6,12 @@
 # SHAPER_ROOT_DIR - path of SHAPER installation
 
 for path in SHAPER_PDIR SHAPER_ROOT_DIR; do
-  if [[ -z ${!path+x} ]]; then
-    echo "${path} not found."; exit 1
-  else
-    echo "Found ${path}: ${!path}"
-  fi
+    if [[ -z ${!path+x} ]]; then
+        echo "${path} not found."
+        exit 1
+    else
+        echo "Found ${path}: ${!path}"
+    fi
 done
 
 #------ lcov ------
index c85ea00686ddb954af77de938b365a4e19d886fa..00a2a52096e7493c135ccd52496e26901b713e1b 100755 (executable)
@@ -1,26 +1,24 @@
 #!/bin/bash
 
-function isDOSFile
-{
-  local FILENAME="$1"
-  file "$FILENAME" | grep -q "CRLF line terminators"
+function isDOSFile {
+    local FILENAME="$1"
+    file "$FILENAME" | grep -q "CRLF line terminators"
 }
 
-if git-rev-parse --verify HEAD >/dev/null 2>&1 ; then
-  against=HEAD
+if git-rev-parse --verify HEAD >/dev/null 2>&1; then
+    against=HEAD
 else
-  # Initial commit: diff against an empty tree object
-  against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
+    # Initial commit: diff against an empty tree object
+    against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
 fi
 
 # Find files with DOS line endings
 FOUND=0
-for FILE in $(exec git diff-index --check --cached $against -- | sed '/^[+-]/d' | sed -r 's/:[0-9]+:.*//' | uniq) ; do
+for FILE in $(exec git diff-index --check --cached $against -- | sed '/^[+-]/d' | sed -r 's/:[0-9]+:.*//' | uniq); do
     isDOSFile "$FILE"
-    if (( $? == 0 ))
-    then
-      echo "\"$FILE\" has DOS line endings" >&2
-      FOUND=1
+    if (($? == 0)); then
+        echo "\"$FILE\" has DOS line endings" >&2
+        FOUND=1
     fi
 done
 
index 10e8377f4a1bb03e5746068eb2b8fcae14bb5d93..db60243c6d161f9cdb9d687bb9ca5b230eddae3d 100755 (executable)
@@ -2,31 +2,31 @@
 
 FIX_LINE_ENDINGS=0
 while [[ $# > 0 ]]; do
-  key="$1"
+    key="$1"
 
-  case $key in
+    case $key in
     fix)
-      FIX_LINE_ENDINGS=1
-      shift
-      ;;
+        FIX_LINE_ENDINGS=1
+        shift
+        ;;
     *)
-      shift
-      ;;
-  esac
+        shift
+        ;;
+    esac
 done
 
 source env.sh
 
-find . \( -name "*.h" -o -name "*.cpp" \) -exec cpplint.py --filter=-,+whitespace/end_of_line  --verbose=0 --counting=detailed {} \+ 2>&1 | grep -v Done | tee ./tofix
+find . \( -name "*.h" -o -name "*.cpp" \) -exec cpplint.py --filter=-,+whitespace/end_of_line --verbose=0 --counting=detailed {} \+ 2>&1 | grep -v Done | tee ./tofix
 
 WRONG=0
 if [ -s ./tofix ]; then
-  if [[ ${FIX_LINE_ENDINGS} == 1 ]]; then
-    python correction_auto_2.py --cpplint_output_file ./tofix
-    echo "NOTE: Line endings are fixed"
-  else
-    WRONG=1
-  fi
+    if [[ ${FIX_LINE_ENDINGS} == 1 ]]; then
+        python correction_auto_2.py --cpplint_output_file ./tofix
+        echo "NOTE: Line endings are fixed"
+    else
+        WRONG=1
+    fi
 fi
 
 rm ./tofix
index 0c9ea4136166a9ee3348fa227b35e83161368ace..81bbac68605fccca9b1863a64fc664208ca88d4a 100755 (executable)
@@ -1,7 +1,6 @@
 #!/bin/bash
 
-find_duplicated_images_usage()
-{
+find_duplicated_images_usage() {
     echo "Find duplicated images."
     echo
     echo "Usage: $(basename ${0}) [options]"
@@ -14,30 +13,31 @@ find_duplicated_images_usage()
     exit 0
 }
 
-
-
-find_duplicated_images_main()
-{
+find_duplicated_images_main() {
     local verbose=0
 
     local where=$(readlink -f $(dirname "${0}"))
 
     # parse command line
     local option
-    while getopts ":-:hp" option ${@}
-    do
-        if [ "${option}" = "-" ]
-        then
+    while getopts ":-:hp" option ${@}; do
+        if [ "${option}" = "-" ]; then
             case ${OPTARG} in
-                help ) find_duplicated_images_usage ;;
-                print ) verbose=1 ;;
-                * ) echo "Wrong option: --${OPTARG}" > /dev/stderr ; exit 1 ;;
+            help) find_duplicated_images_usage ;;
+            print) verbose=1 ;;
+            *)
+                echo "Wrong option: --${OPTARG}" >/dev/stderr
+                exit 1
+                ;;
             esac
         else
             case ${option} in
-                h ) find_duplicated_images_usage ;;
-                p ) verbose=1 ;;
-                ? ) echo "Wrong option" > /dev/stderr ; exit 1 ;;
+            h) find_duplicated_images_usage ;;
+            p) verbose=1 ;;
+            ?)
+                echo "Wrong option" >/dev/stderr
+                exit 1
+                ;;
             esac
         fi
     done
@@ -45,16 +45,14 @@ find_duplicated_images_main()
 
     local result=0
 
-    if [ "${verbose}" = "1" ]
-    then
-       local filename
-       for filename in $(find ${where} -type f -wholename "*/doc/*.png" -exec basename {} \; | sort | uniq -d)
-       do
-           find ${where} -type f -wholename "*/doc/*/${filename}"
-           result=$((result+1))
-       done
+    if [ "${verbose}" = "1" ]; then
+        local filename
+        for filename in $(find ${where} -type f -wholename "*/doc/*.png" -exec basename {} \; | sort | uniq -d); do
+            find ${where} -type f -wholename "*/doc/*/${filename}"
+            result=$((result + 1))
+        done
     else
-       result=$(find -type f -wholename "*/doc/*.png" -exec basename {} \; | sort | uniq -d | wc -l)
+        result=$(find -type f -wholename "*/doc/*.png" -exec basename {} \; | sort | uniq -d | wc -l)
     fi
 
     return ${result}
index d6084d850ce3d56f52ac7031d70b0eca4e14332b..ad6736c8ba40a61aebb7bf5c6c391e2927a6ad1c 100755 (executable)
@@ -7,7 +7,7 @@ export PATH=${SHAPER_ROOT_DIR}/bin:${PATH}
 cd ${BUILD_DIR}
 
 if [[ -n $@ ]]; then
-  $@
+    $@
 else
-  bash
+    bash
 fi
index 3dc1cfd512a4ac8e1fb6f3e691ca70a3a5c65e6b..7a500f21a93189de976f0c207855975d222157d0 100755 (executable)
@@ -5,7 +5,7 @@ source env.sh
 cd ${BUILD_DIR}
 
 if [[ -n $@ ]]; then
-  $@
+    $@
 else
-  bash
+    bash
 fi
index e2b48e3cade1f7c88ffacb85eeb6b63239075f04..566ac24de526ddea19c8b9b9c4f9b10d90cc50a6 100755 (executable)
@@ -10,8 +10,8 @@ lcov --capture --directory ${BUILD_DIR} --no-external --base-directory ${SOURCES
 cp -f coverage.info.noext covfile
 # remove all reports of GUI and external parts (for all the next kinds of reports)
 for MASK in '*wrap*' 'moc_*' 'XAO_*' 'SketcherPrs_*' 'GeomAlgoImpl_*' 'ModuleBase_*' '*Widget*' '*Splitter*'; do
-lcov -r covfile ${MASK} --output-file covfile_res -q
-mv -f covfile_res covfile
+    lcov -r covfile ${MASK} --output-file covfile_res -q
+    mv -f covfile_res covfile
 done
 
 ALL='BuildPlugin CollectionPlugin ConstructionPlugin ExchangePlugin FiltersPlugin FeaturesPlugin GDMLPlugin PrimitivesPlugin InitializationPlugin ParametersPlugin PartSetPlugin SketchPlugin'
@@ -23,24 +23,23 @@ cp -f covfile covAPI
 # remove all plugins data except the needed
 NEED='BuildAPI CollectionAPI ConnectorAPI ConstructionAPI ExchangeAPI FiltersAPI FeaturesAPI ModelHighAPI ParametersAPI PartSetAPI PrimitivesAPI SketchAPI'
 for MASK in $ALL; do
-  if ! [[ " $NEED " =~ " $MASK " ]]; then
-    lcov -r covAPI *${MASK}* --output-file covAPI_res -q
-    mv -f covAPI_res covAPI
-  fi
+    if ! [[ " $NEED " =~ " $MASK " ]]; then
+        lcov -r covAPI *${MASK}* --output-file covAPI_res -q
+        mv -f covAPI_res covAPI
+    fi
 done
 rm -rf lcov_htmlAPI
 genhtml covAPI --output-directory lcov_htmlAPI -q
 
-
 # prepare Direct report
 cp -f covfile covDirect
 # remove all plugins data except the needed
 NEED='GeomAlgoAPI GeomAPI'
 for MASK in $ALL; do
-  if ! [[ " $NEED " =~ " $MASK " ]]; then
-    lcov -r covDirect *${MASK}* --output-file covDirect_res -q
-    mv -f covDirect_res covDirect
-  fi
+    if ! [[ " $NEED " =~ " $MASK " ]]; then
+        lcov -r covDirect *${MASK}* --output-file covDirect_res -q
+        mv -f covDirect_res covDirect
+    fi
 done
 # exclude GeomAPI_AISObject as GUI-related object
 lcov -r covDirect GeomAPI_AISObject* --output-file covDirect_res -q
@@ -53,16 +52,15 @@ mv -f covDirect_res covDirect
 rm -rf lcov_htmlDirect
 genhtml covDirect --output-directory lcov_htmlDirect -q
 
-
 # prepare Else report
 cp -f covfile covElse
 # remove all plugins data except the needed
 NEED='BuildPlugin CollectionPlugin Config ConstructionPlugin Events ExchangePlugin FiltersPlugin FeaturesPlugin GeomData GeomDataAPI GeomValidators InitializationPlugin Model_ ModelAPI ModelGeomAlgo ParametersPlugin PartSetPlugin PrimitivesPlugin Selector SketchPlugin SketchSolver'
 for MASK in $ALL; do
-  if ! [[ " $NEED " =~ " $MASK " ]]; then
-    lcov -r covElse *${MASK}* --output-file covElse_res -q
-    mv -f covElse_res covElse
-  fi
+    if ! [[ " $NEED " =~ " $MASK " ]]; then
+        lcov -r covElse *${MASK}* --output-file covElse_res -q
+        mv -f covElse_res covElse
+    fi
 done
 rm -rf lcov_htmlElse
 genhtml covElse --output-directory lcov_htmlElse -q
diff --git a/make.sh b/make.sh
index 49d78c1f49a41d9d2aec9bc930821cf47f23b364..de97ea9cae343cd4a3e913fcc5425b55d28c4488 100755 (executable)
--- a/make.sh
+++ b/make.sh
@@ -1,43 +1,42 @@
 #!/bin/bash
 
 while [[ $# > 0 ]]; do
-  key="$1"
-
-  case $key in
-    debug|Debug)
-      BUILD_TYPE=Debug
-      shift
-      ;;
-    lcov|coverage)
-      BUILD_TYPE=Debug
-      USE_TEST_COVERAGE=ON
-      shift
-      ;;
-    models|test-models)
-      ADD_MODELS_TESTS=TRUE
-      shift
-      ;;
-    compatibility|test-compatibility)
-      ADD_COMPATIBILITY_TESTS=TRUE
-      shift
-      ;;
-    hdf|test-hdf-models)
-      ADD_HDF_TESTS=TRUE
-      shift
-      ;;
+    key="$1"
+
+    case $key in
+    debug | Debug)
+        BUILD_TYPE=Debug
+        shift
+        ;;
+    lcov | coverage)
+        BUILD_TYPE=Debug
+        USE_TEST_COVERAGE=ON
+        shift
+        ;;
+    models | test-models)
+        ADD_MODELS_TESTS=TRUE
+        shift
+        ;;
+    compatibility | test-compatibility)
+        ADD_COMPATIBILITY_TESTS=TRUE
+        shift
+        ;;
+    hdf | test-hdf-models)
+        ADD_HDF_TESTS=TRUE
+        shift
+        ;;
     *)
-      shift
-      ;;
-  esac
+        shift
+        ;;
+    esac
 done
 
 ## Preserve PTHONPATH in order to avoid problems with Sphinx on Fedora26 because of Pigments in ParaView
 export PYTHONPATH_OLD=$PYTHONPATH
 source env.sh
 
-if [[ ${OS_NAME} = Fedora26-64 ]]
-then
-  export PYTHONPATH=$PYTHONPATH_OLD
+if [[ ${OS_NAME} == Fedora26-64 ]]; then
+    export PYTHONPATH=$PYTHONPATH_OLD
 fi
 
 CMAKE_ARGS=""
index 07e15e4790dc1676df4b6d72932596f6d9e17eaa..282484390237672c2328f6933095727cb30a7a6b 100755 (executable)
@@ -6,15 +6,15 @@ ${TOOLS_DIR}/solver.sh "$@"
 
 # kill processes of previous SALOME run
 if [ -f .salomeport ]; then
-  SALOME_PORT=$(cat .salomeport)
-  ${KERNEL_ROOT_DIR}/bin/salome/killSalomeWithPort.py ${SALOME_PORT}
-  pkill -f "omniNames -start ${SALOME_PORT}"
-  rm .salomeport
+    SALOME_PORT=$(cat .salomeport)
+    ${KERNEL_ROOT_DIR}/bin/salome/killSalomeWithPort.py ${SALOME_PORT}
+    pkill -f "omniNames -start ${SALOME_PORT}"
+    rm .salomeport
 fi
 
 SALOME_ARGS=""
-if [[ "${SALOME_SQUISH_PREFS:-FALSE}" == "TRUE" ]]; then
-  SALOME_ARGS="${SALOME_ARGS} -r ${SOURCES_DIR}/test.squish/shared/testdata/SalomeApp.xml"
+if [[ ${SALOME_SQUISH_PREFS:-FALSE} == "TRUE" ]]; then
+    SALOME_ARGS="${SALOME_ARGS} -r ${SOURCES_DIR}/test.squish/shared/testdata/SalomeApp.xml"
 fi
 SALOME_ARGS="${SALOME_ARGS} --ns-port-log=$(pwd)/.salomeport"
 
index 39fdda42d4a7a3137fa6d79ea65201a60ad30479..d22cb8bbbd49211016bdf7b87ec883f8fdc39dd8 100755 (executable)
--- a/solver.sh
+++ b/solver.sh
@@ -5,35 +5,35 @@
 export PLUGINS_PATH=${PLUGINS_PATH:-${SHAPER_ROOT_DIR}/share/salome/resources/shaper/plugins.xml}
 
 while [[ $# > 0 ]]; do
-  key="$1"
-  case $key in
-    solvespace|ss)
-      export solver=SolveSpace
-      shift
-      ;;
-    planegcs|gcs)
-      export solver=PlaneGCS
-      shift
-      ;;
+    key="$1"
+    case $key in
+    solvespace | ss)
+        export solver=SolveSpace
+        shift
+        ;;
+    planegcs | gcs)
+        export solver=PlaneGCS
+        shift
+        ;;
     -p)
-      export PLUGINS_PATH="$2"
-      shift
-      shift
-      ;;
+        export PLUGINS_PATH="$2"
+        shift
+        shift
+        ;;
     *)
-      shift
-      ;;
-  esac
+        shift
+        ;;
+    esac
 done
 
 if [[ -z ${solver:-} ]]; then exit 0; fi
 
 case $solver in
-  PlaneGCS)
+PlaneGCS)
     export SWITCH_ON=PlaneGCSSolver
     export SWITCH_OFF=SolveSpaceSolver
     ;;
-  SolveSpace|*)
+SolveSpace | *)
     export SWITCH_ON=SolveSpaceSolver
     export SWITCH_OFF=PlaneGCSSolver
     ;;
@@ -41,10 +41,10 @@ esac
 
 echo "Switch $solver solver in ${PLUGINS_PATH}"
 
-cat ${PLUGINS_PATH} \
-  | tr '\n' '\r' \
-  | sed -e "s|\r  <plugin library=\"[^\r]*Solver\"\/>\r<!--|\r  <plugin library=\"${solver}Solver\"\/>\r<!--|" \
-  | tr '\r' '\n' \
-  ${PLUGINS_PATH}_out
+cat ${PLUGINS_PATH} |
+    tr '\n' '\r' |
+    sed -e "s|\r  <plugin library=\"[^\r]*Solver\"\/>\r<!--|\r  <plugin library=\"${solver}Solver\"\/>\r<!--|" |
+    tr '\r' '\n' \
+        >${PLUGINS_PATH}_out
 mv -f ${PLUGINS_PATH}_out ${PLUGINS_PATH}
 cat ${PLUGINS_PATH}
index 75627af13ded1e2a61ab13642d185773c1bc20d4..719556eeb43da46191846fa3961cd7d01adc1ce9 100755 (executable)
@@ -4,6 +4,9 @@ a_dir=$(dirname $0)
 
 source ${a_dir}/env_squish.sh
 
-export TEST_DATA_DIR=$(cd ${a_dir}; pwd)/test.squish/shared/testdata
+export TEST_DATA_DIR=$(
+    cd ${a_dir}
+    pwd
+)/test.squish/shared/testdata
 
 squishide
index 5eac9fc6211ffd6f91a625f6851cb2ba65ed6b06..ab24a2fff7a3ecda8921c0cff2d28bc389fecbb5 100755 (executable)
@@ -44,23 +44,19 @@ BROWSER=firefox
 TITLE=$1
 
 # initialize
-if [[ $TITLE == "--reset" ]]
-then
+if [[ $TITLE == "--reset" ]]; then
     lcov --base-directory . --directory . --zerocounters -q
     echo "Reset counters"
     exit 0
 fi
 
-
-if [ -z $TITLE ]
-then
+if [ -z $TITLE ]; then
     echo $TITLE "name is required"
     exit 1
 fi
 
 INFO_FILE=${TITLE}.info
-if [ -f $INFO_FILE ]
-then
+if [ -f $INFO_FILE ]; then
     rm -f $INFO_FILE
 fi
 
@@ -78,7 +74,6 @@ lcov --remove $INFO_FILE "*/tests/*" -o $INFO_FILE $QUIET
 # génération du rapport
 genhtml --output-directory $REPORT_PATH --title $TITLE --num-spaces 4 $INFO_FILE
 
-if [ ! -z $BROWSER ]
-then
+if [ ! -z $BROWSER ]; then
     $BROWSER $REPORT_PATH/index.html &
 fi
diff --git a/test.sh b/test.sh
index 7faf456b873ec3f33bcbb5ba2aafa9d7ed94797d..3770cbc0190024ed565747c651e4f87804b818f4 100755 (executable)
--- a/test.sh
+++ b/test.sh
@@ -11,11 +11,11 @@ export DISPLAY="localhost:0.0"
 # for correct parsing PYTHONPATH and use the actual version of SHAPER
 # instead of distributed with SALOME
 if [[ ! -f ${SHAPER_PYTHON_SCRIPTS_DIR}/salome/__init__.py ]]; then
-  touch ${SHAPER_PYTHON_SCRIPTS_DIR}/salome/__init__.py
+    touch ${SHAPER_PYTHON_SCRIPTS_DIR}/salome/__init__.py
 fi
 
 if [[ $# > 0 ]]; then
-  ctest --no-compress-output -T Test "$@" -R $1
+    ctest --no-compress-output -T Test "$@" -R $1
 else
-  ctest --no-compress-output -T Test "$@"
+    ctest --no-compress-output -T Test "$@"
 fi
index f62ab8adc369138b85efe31481fb107bbddb52dd..1314ff95d015eb952d7c499a6a024a85b081d7c1 100755 (executable)
@@ -13,7 +13,7 @@ SERVEROPTIONS_ARGS="${SERVEROPTIONS_ARGS} --port=${SQUISH_PORT}"
 
 # config squishserver
 for aut in linux_run.sh salome_run.sh; do
-  squishserver --config addAUT ${aut} ${AUT_DIR}
+    squishserver --config addAUT ${aut} ${AUT_DIR}
 done
 squishserver --config setAUTTimeout 120
 # stop previous version
@@ -28,18 +28,18 @@ squishrunner --port=${SQUISH_PORT} --config setCursorAnimation off
 RETVAL=0
 
 squishrunner-run() {
-  local TESTSUITE=$1
-  local TESTCASES="$2"
-
-  local SQUISHRUNNER_ARGS=""
-  SQUISHRUNNER_ARGS="${SQUISHRUNNER_ARGS} --testsuite ${SOURCES_DIR}/test.squish/${TESTSUITE}"
-  SQUISHRUNNER_ARGS="${SQUISHRUNNER_ARGS} --resultdir ${SOURCES_DIR}/test.squish_results/${TESTSUITE}"
-  SQUISHRUNNER_ARGS="${SQUISHRUNNER_ARGS} --reportgen xmljunit,${SOURCES_DIR}/test.squish_results/${TESTSUITE}_results.xml"
-  SQUISHRUNNER_ARGS="${SQUISHRUNNER_ARGS} ${TESTCASES}"
-  SQUISHRUNNER_ARGS="${SQUISHRUNNER_ARGS} --exitCodeOnFail 1"
-  squishrunner ${SERVEROPTIONS_ARGS} ${SQUISHRUNNER_ARGS}
-  EXIT_CODE=$?
-  if [ ${EXIT_CODE} = '1' ]; then RETVAL=1; fi
+    local TESTSUITE=$1
+    local TESTCASES="$2"
+
+    local SQUISHRUNNER_ARGS=""
+    SQUISHRUNNER_ARGS="${SQUISHRUNNER_ARGS} --testsuite ${SOURCES_DIR}/test.squish/${TESTSUITE}"
+    SQUISHRUNNER_ARGS="${SQUISHRUNNER_ARGS} --resultdir ${SOURCES_DIR}/test.squish_results/${TESTSUITE}"
+    SQUISHRUNNER_ARGS="${SQUISHRUNNER_ARGS} --reportgen xmljunit,${SOURCES_DIR}/test.squish_results/${TESTSUITE}_results.xml"
+    SQUISHRUNNER_ARGS="${SQUISHRUNNER_ARGS} ${TESTCASES}"
+    SQUISHRUNNER_ARGS="${SQUISHRUNNER_ARGS} --exitCodeOnFail 1"
+    squishrunner ${SERVEROPTIONS_ARGS} ${SQUISHRUNNER_ARGS}
+    EXIT_CODE=$?
+    if [ ${EXIT_CODE} = '1' ]; then RETVAL=1; fi
 }
 
 TESTCASES=""
@@ -128,7 +128,7 @@ TESTCASES=""
 # stop squishserver
 squishserver ${SERVEROPTIONS_ARGS} --verbose --stop
 for aut in linux_run.sh salome_run.sh; do
-  squishserver --config removeAUT ${aut} ${AUT_DIR}
+    squishserver --config removeAUT ${aut} ${AUT_DIR}
 done
 
 exit ${RETVAL}
diff --git a/vnc-run b/vnc-run
index 28aedd67716341984bd17876601feace1f0b3ba6..06b3932a5e174e17743b8381f016e6b18d5e379b 100755 (executable)
--- a/vnc-run
+++ b/vnc-run
@@ -25,17 +25,17 @@ if ! expr "$DEFCOLUMNS" : "[[:digit:]]\+$" >/dev/null 2>&1; then
 fi
 
 # Display a message, wrapping lines at the terminal width.
-message () {
+message() {
     echo "$PROGNAME: $*" | fmt -t -w ${COLUMNS:-$DEFCOLUMNS}
 }
 
 # Display an error message.
-error () {
+error() {
     message "error: $*" >&2
 }
 
 # Display a usage message.
-usage () {
+usage() {
     if [ -n "$*" ]; then
         message "usage error: $*"
     fi
@@ -71,15 +71,15 @@ find_free_servernum() {
 
     i=$SERVERNUM
     while [ -f /tmp/.X$i-lock ]; do
-        i=$(($i + 1))
+        i=$((i + 1))
     done
     echo $i
 }
 
 # Parse the command line.
 ARGS=$(getopt --options +ae:f:hn:lp:s:w: \
-       --long auto-servernum,error-file:auth-file:,help,server-num:,listen-tcp,xauth-protocol:,server-args:,wait: \
-       --name "$PROGNAME" -- "$@")
+    --long auto-servernum,error-file:auth-file:,help,server-num:,listen-tcp,xauth-protocol:,server-args:,wait: \
+    --name "$PROGNAME" -- "$@")
 GETOPT_STATUS=$?
 
 if [ $GETOPT_STATUS -ne 0 ]; then
@@ -91,19 +91,41 @@ eval set -- "$ARGS"
 
 while :; do
     case "$1" in
-        -a|--auto-servernum) SERVERNUM=$(find_free_servernum) ;;
-        -e|--error-file) ERRORFILE="$2"; shift ;;
-        -f|--auth-file) AUTHFILE="$2"; shift ;;
-        -h|--help) SHOWHELP="yes" ;;
-        -n|--server-num) SERVERNUM="$2"; shift ;;
-        -l|--listen-tcp) LISTENTCP="" ;;
-        -p|--xauth-protocol) XAUTHPROTO="$2"; shift ;;
-        -s|--server-args) VNCARGS="$2"; shift ;;
-        -w|--wait) STARTWAIT="$2"; shift ;;
-        --) shift; break ;;
-        *) error "internal error; getopt permitted \"$1\" unexpectedly"
-           exit 6
-           ;;
+    -a | --auto-servernum) SERVERNUM=$(find_free_servernum) ;;
+    -e | --error-file)
+        ERRORFILE="$2"
+        shift
+        ;;
+    -f | --auth-file)
+        AUTHFILE="$2"
+        shift
+        ;;
+    -h | --help) SHOWHELP="yes" ;;
+    -n | --server-num)
+        SERVERNUM="$2"
+        shift
+        ;;
+    -l | --listen-tcp) LISTENTCP="" ;;
+    -p | --xauth-protocol)
+        XAUTHPROTO="$2"
+        shift
+        ;;
+    -s | --server-args)
+        VNCARGS="$2"
+        shift
+        ;;
+    -w | --wait)
+        STARTWAIT="$2"
+        shift
+        ;;
+    --)
+        shift
+        break
+        ;;
+    *)
+        error "internal error; getopt permitted \"$1\" unexpectedly"
+        exit 6
+        ;;
     esac
     shift
 done
@@ -138,14 +160,14 @@ fi
 # Start VNC.
 MCOOKIE=$(mcookie)
 
-XAUTHORITY=$AUTHFILE xauth source - << EOF >>"$ERRORFILE" 2>&1
+XAUTHORITY=$AUTHFILE xauth source - <<EOF >>"$ERRORFILE" 2>&1
 add :$SERVERNUM $XAUTHPROTO $MCOOKIE
 EOF
 XAUTHORITY=$AUTHFILE vncserver ":$SERVERNUM" >>"$ERRORFILE" 2>&1 &
 VNCPID=$!
 sleep "$STARTWAIT"
 if ! wait ${VNCPID}; then
-  exit 5
+    exit 5
 fi
 
 # Start the command and save its exit status.