From 0ad40e7f20a9832e7b24a2e6263e9ce3c9f346a7 Mon Sep 17 00:00:00 2001 From: Anders Lindh Olsson <anders.lindholsson@ess.eu> Date: Tue, 13 Jul 2021 14:30:05 +0200 Subject: [PATCH] removed usage of env.sh and replaced with checks for IOCNAME being set --- .gitignore | 11 ++++----- CHANGELOG.md | 1 + require-ess/tools/iocsh.bash | 3 --- require-ess/tools/iocsh_functions.bash | 31 ++++---------------------- tools/ess-env.conf | 2 +- 5 files changed, 12 insertions(+), 36 deletions(-) diff --git a/.gitignore b/.gitignore index 36e1a40a..f7d2fae6 100644 --- a/.gitignore +++ b/.gitignore @@ -13,12 +13,13 @@ core.* .#* \#* *.local -e3.cfg -tools/ess-env.conf .vscode +cellMods +*.log +__pycache__ + require-ess/require.Makefile require-ess/Db/*.db require-ess/Db/*.d -cellMods -*.log -__pycache__ \ No newline at end of file +e3.cfg +tools/ess-env.conf diff --git a/CHANGELOG.md b/CHANGELOG.md index 6acbb2f8..1f6d0692 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Other changes * removed legacy code from setE3Env.bash +* Removed usage of `env.sh` - now there is a check only for seeing if the environment variable `$IOCNAME` is set ## [3.4.1] diff --git a/require-ess/tools/iocsh.bash b/require-ess/tools/iocsh.bash index 8974764e..d8f38e8d 100644 --- a/require-ess/tools/iocsh.bash +++ b/require-ess/tools/iocsh.bash @@ -58,9 +58,6 @@ declare BASECODE="" # To get the absolute path where iocsh.bash is executed IOCSH_TOP=${PWD} -# Load any environment variables, default is $IOCSH_TOP/env.sh -loadEnv "$@" - # Check whether an expected e3 environment variable is defined. # if [[ -z "${EPICS_DRIVER_PATH}" ]]; then diff --git a/require-ess/tools/iocsh_functions.bash b/require-ess/tools/iocsh_functions.bash index 87a5fff8..8b888eaf 100644 --- a/require-ess/tools/iocsh_functions.bash +++ b/require-ess/tools/iocsh_functions.bash @@ -267,30 +267,11 @@ function check_mandatory_env_settings() { die 1 " $var is not defined!. Please source ${E3_REQUIRE_BIN}/setE3Env.bash " fi done -} - -function loadEnv() { - local envfile=$IOCSH_TOP/env.sh - local warn=false - while [ $# -gt 0 ]; do - arg=$1 - case $arg in - -e) - shift - envfile=$1 - warn=true - ;; - esac - shift - done - - if [ -f "$envfile" ]; then - echo "Loading environment variables from $envfile" - # shellcheck disable=SC1090 - source "$envfile" - elif [ "$warn" = true ]; then - echo "Warning: environment file $envfile does not exist." >&2 + if [[ -z "$IOCNAME" ]]; then + echo "Warning: environment variable IOCNAME is not set." >&2 + else + echo "IOCNAME is set to $IOCNAME" fi } @@ -351,9 +332,6 @@ function loadFiles() { shift __LOADER__="valgrind --leak-check=full " ;; - -e) - shift - ;; -n) __LOADER__="nice --10 " shift @@ -435,7 +413,6 @@ function help() { printf "Options:\n\n" printf " -?, -h, --help Show this page and exit.\n" printf " -v, --version Show version and exit.\n" - printf " -e 'env_file' Load a given environment file 'env_file'.\n" printf " -c 'cmd args' Ioc shell command.\n" printf " -l 'cell path' Run Ioc with a cell path.\n" printf " -s 'prog m=v' Sequencer program (and arguments), run with 'seq'.\n" diff --git a/tools/ess-env.conf b/tools/ess-env.conf index 326f2152..6386b57b 100644 --- a/tools/ess-env.conf +++ b/tools/ess-env.conf @@ -1 +1 @@ -IOCSH_HASH_VERSION=d3c308e +IOCSH_HASH_VERSION=d7ee603 -- GitLab