From b0811699fc83daeede9fbbda1f39925753196cb7 Mon Sep 17 00:00:00 2001 From: "John H. Palmieri" Date: Fri, 29 Sep 2023 11:08:51 -0700 Subject: [PATCH] Do not run sage-env more than once, for real. --- src/bin/sage-env | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/bin/sage-env b/src/bin/sage-env index 2a63be5b7c0..5c1b4b87ac7 100644 --- a/src/bin/sage-env +++ b/src/bin/sage-env @@ -121,7 +121,8 @@ if [ "$SAGE_ENV_SOURCED" = "$SAGE_ENV_VERSION" ]; then # Already sourced, nothing to do. return 0 fi -export SAGE_ENV_SOURCED="$SAGE_ENV_VERSION" +# Set SAGE_ENV_SOURCED to the appropriate value at the end of this file, once +# $SAGE_LOCAL, $SAGE_VENV, $SAGE_SRC have been set. # The compilers are set in order of priority by # 1) environment variables @@ -643,3 +644,7 @@ fi # our doctests predictable (which was the status quo with earlier # versions of debugpy). export PYDEVD_DISABLE_FILE_VALIDATION=1 + +# Finally, set SAGE_ENV_SOURCED as evidence that this script has been +# run successfully. +export SAGE_ENV_SOURCED="6:$SAGE_LOCAL:$SAGE_VENV:$SAGE_SRC"