From a693028536d6e050c3050e22855ee9eaaa289e1a Mon Sep 17 00:00:00 2001
From: Anders Lindh Olsson <anders.lindholsson@ess.eu>
Date: Thu, 3 Nov 2022 13:06:42 +0100
Subject: [PATCH] Rename `setE3Env.bash` to `activate`

---
 .gitlab-ci.yml                                | 2 +-
 CHANGELOG.md                                  | 1 +
 README.md                                     | 2 +-
 configure/module/RULES_REQUIRE                | 2 +-
 require-ess/tools/{setE3Env.bash => activate} | 1 -
 require-ess/tools/iocsh                       | 6 +++---
 require-ess/tools/iocsh_functions.bash        | 2 +-
 require-ess/tools/promptE3Env.bash            | 4 ++--
 8 files changed, 10 insertions(+), 10 deletions(-)
 rename require-ess/tools/{setE3Env.bash => activate} (99%)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 002d2314..9327768b 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -65,7 +65,7 @@ build require:
 test require:
   stage: test
   before_script:
-    - source $(pwd)/epics/base-*/require/*/bin/setE3Env.bash
+    - source $(pwd)/epics/base-*/require/*/bin/activate
   script:
     - make test
   needs:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c5f13490..4e1a87cb 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -28,6 +28,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 * Remove `/tools` directory, including `test_installed_modules.sh` utility
 * Remove `runScript`
 * Drop file extension from `build_number.sh`
+* Rename `setE3Env.bash` to `activate`
 
 ## [4.0.0]
 
diff --git a/README.md b/README.md
index 977a73ce..66c136f1 100644
--- a/README.md
+++ b/README.md
@@ -40,7 +40,7 @@ $ make install
 
 To test your build, run
 ```bash
-$ source ${EPICS_BASE}/require/${E3_REQUIRE_VERSION}/bin/setE3Env.bash
+$ source ${EPICS_BASE}/require/${E3_REQUIRE_VERSION}/bin/activate
 $ iocsh
 ```
 
diff --git a/configure/module/RULES_REQUIRE b/configure/module/RULES_REQUIRE
index f5c33b92..ce1d9799 100644
--- a/configure/module/RULES_REQUIRE
+++ b/configure/module/RULES_REQUIRE
@@ -8,7 +8,7 @@ FILE_FILTER:= %~ %\#
 E3_TEST_SCRIPT    := $(TOP)/tools/test_installed_modules.sh
 #
 E3_SHELL_FILES    := $(wildcard $(E3_MODULE_SRC_PATH)/tools/iocsh*)
-E3_IOC_CFG_FILES  += $(E3_MODULE_SRC_PATH)/tools/setE3Env.bash
+E3_IOC_CFG_FILES  += $(E3_MODULE_SRC_PATH)/tools/activate
 E3_IOC_CFG_FILES  += $(E3_MODULE_SRC_PATH)/tools/promptE3Env.bash
 E3_REQUIRE_CONF_FILES := $(filter-out $(FILE_FILTER), $(wildcard $(TOP)/configure/E3/*))
 
diff --git a/require-ess/tools/setE3Env.bash b/require-ess/tools/activate
similarity index 99%
rename from require-ess/tools/setE3Env.bash
rename to require-ess/tools/activate
index 4b685043..f9ee5607 100644
--- a/require-ess/tools/setE3Env.bash
+++ b/require-ess/tools/activate
@@ -16,7 +16,6 @@
 #  You should have received a copy of the GNU General Public License along with
 #  this program. If not, see https://www.gnu.org/licenses/gpl-2.0.txt
 #
-#   Shell   : setE3Env.bash
 #   Author  : Jeong Han Lee
 #   email   : jeonghan.lee@gmail.com
 #   date    : Friday, November  8 22:48:29 CET 2019
diff --git a/require-ess/tools/iocsh b/require-ess/tools/iocsh
index ac58d761..56abb27a 100644
--- a/require-ess/tools/iocsh
+++ b/require-ess/tools/iocsh
@@ -63,8 +63,8 @@ IOCSH_TOP=${PWD}
 #
 if [[ -z "${EPICS_DRIVER_PATH}" ]]; then
   set -a
-  # shellcheck source=require-ess/tools/setE3Env.bash
-  . "${SC_TOP}"/setE3Env.bash "no_msg"
+  # shellcheck source=require-ess/tools/activate
+  . "${SC_TOP}"/activate "no_msg"
   set +a
 fi
 
@@ -72,7 +72,7 @@ fi
 # are consistent
 if [ "${E3_REQUIRE_BIN}" != "${SC_TOP}" ]; then
   echo "Error: Configured e3 environment does not match path for iocsh executable."
-  echo "Please source the appropriate setE3Env.bash file for the version of iocsh"
+  echo "Please source the appropriate activation file for the version of iocsh"
   echo "you wish to use, or run iocsh from a clean environment so it can set the"
   echo "environment correctly."
   echo "Expected path to iocsh from environment = ${E3_REQUIRE_BIN}"
diff --git a/require-ess/tools/iocsh_functions.bash b/require-ess/tools/iocsh_functions.bash
index 75a6dd6d..52594f9c 100644
--- a/require-ess/tools/iocsh_functions.bash
+++ b/require-ess/tools/iocsh_functions.bash
@@ -239,7 +239,7 @@ function check_mandatory_env_settings() {
   var_list+=(E3_REQUIRE_VERSION)
   for var in "${var_list[@]}"; do
     if [[ -z "${!var}" ]]; then
-      die 1 " $var is not defined!. Please source ${E3_REQUIRE_BIN}/setE3Env.bash "
+      die 1 " $var is not defined!. Please source ${E3_REQUIRE_BIN}/activate"
     fi
   done
 
diff --git a/require-ess/tools/promptE3Env.bash b/require-ess/tools/promptE3Env.bash
index 98dc0f7a..7636ac06 100644
--- a/require-ess/tools/promptE3Env.bash
+++ b/require-ess/tools/promptE3Env.bash
@@ -8,8 +8,8 @@
 #
 
 DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
-# shellcheck source=require-ess/tools/setE3Env.bash
-source "$DIR"/setE3Env.bash
+# shellcheck source=require-ess/tools/activate
+source "$DIR"/activate
 
 IFS='/' read -ra base <<<"$EPICS_BASE"
 PS1="(EPICS-${base[-1]})$PS1"
-- 
GitLab