diff --git a/CHANGELOG.md b/CHANGELOG.md index 7bc4de6c63a4e4cb64021891f71f2a576e5c2b77..faeb42a436708f18d69a0bb8778fceecf802af49 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,10 +11,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * Rudimentary testing has been added: * * Tests that the correct version is loaded * * Tests that elementary patching/building works as expected +* Added consistency check between e3 environment variables and path to `iocsh.bash`. `iocsh.bash` will abort if these are not consistent. ### Bugfixes * `iocsh.bash --help` (and variants) no longer loads tries to load `env.sh`. +### Other changes + ## [3.4.1] ### Bugfixes diff --git a/require-ess/tools/iocsh.bash b/require-ess/tools/iocsh.bash index 617886833e23ed68390ab0bb1ce1e5d0e2125206..8974764e65b667a52ef1140c710e90f676be53de 100644 --- a/require-ess/tools/iocsh.bash +++ b/require-ess/tools/iocsh.bash @@ -61,7 +61,7 @@ IOCSH_TOP=${PWD} # Load any environment variables, default is $IOCSH_TOP/env.sh loadEnv "$@" -# The most unique environment variable for e3 is EPICS_DRIVER_PATH +# Check whether an expected e3 environment variable is defined. # if [[ -z "${EPICS_DRIVER_PATH}" ]]; then set -a @@ -70,6 +70,18 @@ if [[ -z "${EPICS_DRIVER_PATH}" ]]; then set +a fi +# Check that the e3 environment definition and the path for this script +# are consistent +if [ "${E3_REQUIRE_BIN}" != "${SC_TOP}" ]; then + echo "Error: Configured e3 environment does not match path for iocsh.bash executable." + echo "Please source the appropriate setE3Env.bash file for the version" + echo "of iocsh.bash you wish to use, or run iocsh.bash from a clean" + echo "environment so it can set the environment correctly." + echo "Expected path to iocsh.bash from environment = ${E3_REQUIRE_BIN}" + echo "Actual path to iocsh.bash = ${SC_TOP}" + die 2 +fi + BASECODE="$(basecode_generator)" check_mandatory_env_settings