diff --git a/src/bin/sage-env b/src/bin/sage-env index c436ec43434..ef5b7e1cea4 100644 --- a/src/bin/sage-env +++ b/src/bin/sage-env @@ -246,6 +246,7 @@ fi # Setting Sage-related location environment variables. export SAGE_LOCAL="$SAGE_ROOT/local" +export SAGE_ETC="$SAGE_LOCAL/etc" export SAGE_SHARE="$SAGE_LOCAL/share" export SAGE_EXTCODE="$SAGE_SHARE/sage/ext" export SAGE_SPKG_INST="$SAGE_LOCAL/var/lib/sage/installed" diff --git a/src/sage/env.py b/src/sage/env.py index d56d2c5ba6e..e281e043e99 100644 --- a/src/sage/env.py +++ b/src/sage/env.py @@ -87,6 +87,7 @@ def _add_variable_or_fallback(key, fallback, force=False): # bunch of sage directories and files _add_variable_or_fallback('SAGE_ROOT', None) _add_variable_or_fallback('SAGE_LOCAL', opj('$SAGE_ROOT', 'local')) +_add_variable_or_fallback('SAGE_ETC', opj('$SAGE_LOCAL', 'etc')) _add_variable_or_fallback('SAGE_SHARE', opj('$SAGE_LOCAL', 'share')) # SAGE_LIB is the site-packages directory if the sage library diff --git a/src/sage/interfaces/gp.py b/src/sage/interfaces/gp.py index a44a02eb52c..91531ce8212 100644 --- a/src/sage/interfaces/gp.py +++ b/src/sage/interfaces/gp.py @@ -977,11 +977,11 @@ def is_GpElement(x): """ return isinstance(x, GpElement) -from sage.env import DOT_SAGE, SAGE_LOCAL +from sage.env import DOT_SAGE, SAGE_ETC import os -# Set GPRC environment variable to $SAGE_LOCAL/etc/gprc.expect -os.environ["GPRC"] = os.path.join(SAGE_LOCAL, 'etc', 'gprc.expect') +# Set GPRC environment variable to $SAGE_ETC/gprc.expect +os.environ["GPRC"] = os.path.join(SAGE_ETC, 'gprc.expect') # An instance gp = Gp(logfile=os.path.join(DOT_SAGE,'gp-expect.log')) # useful for debugging!