Skip to content

Commit

Permalink
Trac #32933: Put SAGE_ROOT/src/bin in PATH only when invoked by SAGE_…
Browse files Browse the repository at this point in the history
…ROOT/sage or sage-build-env

Only when invoked as `SAGE_ROOT/sage` or `SAGE_ROOT/src/bin/sage`, then
`$SAGE_ROOT/src/bin` should be put in the front of `PATH`.

When the installed `sage` script, `SAGE_VENV/bin/sage`, is invoked
directly, it should not put `$SAGE_ROOT/src/bin` on the `PATH`.

URL: https://trac.sagemath.org/32933
Reported by: mkoeppe
Ticket author(s): Matthias Koeppe
Reviewer(s): Kwankyu Lee
  • Loading branch information
Release Manager committed Dec 20, 2021
2 parents 8e3732e + 7519048 commit 0b9ec74
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 6 additions & 0 deletions src/bin/sage
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,12 @@ if [ -f "${SELF}-env" ]; then
fi
fi

if [ -f "${SELF}-src-env-config.in" ]; then
# The sage script is being run out of SAGE_ROOT/src/bin.
# In this case, put this directory in the front of the PATH.
export PATH="$SAGE_SRC/bin:$PATH"
fi

if [ -z "$DOT_SAGE" ]; then
export DOT_SAGE="$HOME/.sage"
fi
Expand Down
3 changes: 0 additions & 3 deletions src/bin/sage-env
Original file line number Diff line number Diff line change
Expand Up @@ -295,9 +295,6 @@ fi
if [ -n "$SAGE_VENV" ]; then
export PATH="$SAGE_VENV/bin:$PATH"
fi
if [ -n "$SAGE_SRC" ]; then
export PATH="$SAGE_SRC/bin:$PATH"
fi
if [ -n "$SAGE_ROOT" ]; then
export PATH="$SAGE_ROOT/build/bin:$PATH"
fi
Expand Down

0 comments on commit 0b9ec74

Please sign in to comment.