Skip to content

Commit 3350f7f

Browse files
author
Matthias Koeppe
committed
sage.env, sage.misc.package: Use SAGE_LOCAL_SPKG_INST to avoid clash with SAGE_SPKG_INST set by sage-spkg
1 parent e2e0f8d commit 3350f7f

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

src/bin/sage-env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ fi
228228
# depending on SAGE_ROOT and SAGE_LOCAL which are already defined.
229229
if [ -n "$SAGE_LOCAL" ]; then
230230
export SAGE_SHARE="$SAGE_LOCAL/share"
231-
export SAGE_SPKG_INST="$SAGE_LOCAL/var/lib/sage/installed"
231+
export SAGE_SPKG_INST="$SAGE_LOCAL/var/lib/sage/installed" # deprecated
232232
fi
233233
if [ -n "$SAGE_SHARE" ]; then
234234
export SAGE_DOC="$SAGE_SHARE/doc/sage"

src/sage/env.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,8 @@ def var(key: str, *fallbacks: Optional[str], force: bool = False) -> Optional[st
177177
SAGE_LOCAL = var("SAGE_LOCAL", SAGE_VENV)
178178
SAGE_SHARE = var("SAGE_SHARE", join(SAGE_LOCAL, "share"))
179179
SAGE_DOC = var("SAGE_DOC", join(SAGE_SHARE, "doc", "sage"))
180-
SAGE_SPKG_INST = var("SAGE_SPKG_INST", join(SAGE_LOCAL, "var", "lib", "sage", "installed"))
180+
SAGE_LOCAL_SPKG_INST = var("SAGE_LOCAL_SPKG_INST", join(SAGE_LOCAL, "var", "lib", "sage", "installed"))
181+
SAGE_SPKG_INST = var("SAGE_SPKG_INST", join(SAGE_LOCAL, "var", "lib", "sage", "installed")) # deprecated
181182

182183
# source tree of the Sage distribution
183184
SAGE_ROOT = var("SAGE_ROOT") # no fallback for SAGE_ROOT

src/sage/misc/package.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ def _spkg_inst_dirs():
390390
"""
391391
Generator for the installation manifest directories as resolved paths.
392392
393-
It yields first ``SAGE_SPKG_INST``, then ``SAGE_VENV_SPKG_INST``,
393+
It yields first ``SAGE_LOCAL_SPKG_INST``, then ``SAGE_VENV_SPKG_INST``,
394394
if defined; but it both resolve to the same directory, it only yields
395395
one element.
396396
@@ -402,7 +402,7 @@ def _spkg_inst_dirs():
402402
403403
"""
404404
last_inst_dir = None
405-
for inst_dir in (sage.env.SAGE_SPKG_INST, sage.env.SAGE_VENV_SPKG_INST):
405+
for inst_dir in (sage.env.SAGE_LOCAL_SPKG_INST, sage.env.SAGE_VENV_SPKG_INST):
406406
if inst_dir:
407407
inst_dir = Path(inst_dir).resolve()
408408
if inst_dir.is_dir() and inst_dir != last_inst_dir:

0 commit comments

Comments
 (0)