From 52de24c2410069b169858e6c4343576777ed19a8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 4 Mar 2026 00:43:35 +0000 Subject: [PATCH 1/5] Initial plan From 0b2b3326345ac419f49b0b2fe66c7eeea6e28780 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 4 Mar 2026 02:23:54 +0000 Subject: [PATCH 2/5] Add warning for singularity/apptainer users with outdated eic-shell script Co-authored-by: wdconinc <4656391+wdconinc@users.noreply.github.com> --- .../eic/profile.d/z15_singularity_update.sh | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 containers/eic/profile.d/z15_singularity_update.sh diff --git a/containers/eic/profile.d/z15_singularity_update.sh b/containers/eic/profile.d/z15_singularity_update.sh new file mode 100644 index 000000000..d69dbe320 --- /dev/null +++ b/containers/eic/profile.d/z15_singularity_update.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +## Warn users running singularity/apptainer when their outer eic-shell script is outdated. +## Users can upgrade by running `eic-shell --upgrade` outside the container. + +# Only run for interactive shells +[[ $- == *i* ]] || return 0 + +# Only run when inside singularity/apptainer +if [ -z "${SINGULARITY_CONTAINER:-}" ] && [ -z "${APPTAINER_CONTAINER:-}" ]; then + return 0 +fi + +# Check if the outer eic-shell script is accessible +_outer_eic_shell="${EIC_SHELL_PREFIX:-}/../eic-shell" +if [ ! -f "$_outer_eic_shell" ]; then + unset _outer_eic_shell + return 0 +fi + +# Only warn if we have write access (meaning user can upgrade) +if [ ! -w "$_outer_eic_shell" ]; then + unset _outer_eic_shell + return 0 +fi + +# Warn if the outer eic-shell script is older than 6 months (~180 days) +if find "$_outer_eic_shell" -mtime +180 -print -quit 2>/dev/null | grep -q .; then + echo "" + echo "WARNING: Your eic-shell script appears to be more than 6 months old." + echo " Consider upgrading by running outside the container:" + echo " eic-shell --upgrade" + echo "" +fi +unset _outer_eic_shell From 2ab6df8c185aeb15add0de99c14e9a083486423a Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Wed, 4 Mar 2026 08:30:21 -0600 Subject: [PATCH 3/5] fix: require EIC_SHELL_PREFIX (only singularity/apptainer) Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- containers/eic/profile.d/z15_singularity_update.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/containers/eic/profile.d/z15_singularity_update.sh b/containers/eic/profile.d/z15_singularity_update.sh index d69dbe320..ecb42f23b 100644 --- a/containers/eic/profile.d/z15_singularity_update.sh +++ b/containers/eic/profile.d/z15_singularity_update.sh @@ -11,8 +11,13 @@ if [ -z "${SINGULARITY_CONTAINER:-}" ] && [ -z "${APPTAINER_CONTAINER:-}" ]; the return 0 fi +# Require EIC_SHELL_PREFIX to be set; otherwise we cannot locate the outer eic-shell +if [ -z "${EIC_SHELL_PREFIX:-}" ]; then + return 0 +fi + # Check if the outer eic-shell script is accessible -_outer_eic_shell="${EIC_SHELL_PREFIX:-}/../eic-shell" +_outer_eic_shell="${EIC_SHELL_PREFIX}/../eic-shell" if [ ! -f "$_outer_eic_shell" ]; then unset _outer_eic_shell return 0 From c54d876f8ab08f2dc1eee7a48257d1be4b436a95 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Wed, 4 Mar 2026 08:30:51 -0600 Subject: [PATCH 4/5] fix: allow sh/dash, avoid bashism Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- containers/eic/profile.d/z15_singularity_update.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/containers/eic/profile.d/z15_singularity_update.sh b/containers/eic/profile.d/z15_singularity_update.sh index ecb42f23b..19152c422 100644 --- a/containers/eic/profile.d/z15_singularity_update.sh +++ b/containers/eic/profile.d/z15_singularity_update.sh @@ -4,7 +4,10 @@ ## Users can upgrade by running `eic-shell --upgrade` outside the container. # Only run for interactive shells -[[ $- == *i* ]] || return 0 +case "$-" in + *i*) ;; + *) return 0 ;; +esac # Only run when inside singularity/apptainer if [ -z "${SINGULARITY_CONTAINER:-}" ] && [ -z "${APPTAINER_CONTAINER:-}" ]; then From 828f23fbdd1232d3225a1e63c7bc242dcdf40b4f Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Wed, 4 Mar 2026 08:53:12 -0600 Subject: [PATCH 5/5] fix: use posix find and don't grep quiet Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- containers/eic/profile.d/z15_singularity_update.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/containers/eic/profile.d/z15_singularity_update.sh b/containers/eic/profile.d/z15_singularity_update.sh index 19152c422..9d96258c2 100644 --- a/containers/eic/profile.d/z15_singularity_update.sh +++ b/containers/eic/profile.d/z15_singularity_update.sh @@ -33,7 +33,7 @@ if [ ! -w "$_outer_eic_shell" ]; then fi # Warn if the outer eic-shell script is older than 6 months (~180 days) -if find "$_outer_eic_shell" -mtime +180 -print -quit 2>/dev/null | grep -q .; then +if [ -n "$(find "$_outer_eic_shell" -mtime +180 -print 2>/dev/null)" ]; then echo "" echo "WARNING: Your eic-shell script appears to be more than 6 months old." echo " Consider upgrading by running outside the container:"