Path: blob/main/Sage_framework/files/patches/sage-env.patch
244 views
--- ../repo/sage/src/bin/sage-env 2023-03-30 15:47:171+++ sage-env 2023-03-31 12:08:572@@ -110,9 +110,29 @@3# Make sure that SAGE_ROOT is either an absolute physical directory name4# or empty.5if [ -n "$SAGE_ROOT" ]; then6- export SAGE_ROOT=$(cd "$SAGE_ROOT" 2>/dev/null && pwd -P)7+ NEW_SAGE_ROOT="$SAGE_ROOT"8+elif [ -f sage -a -d build ]; then9+ NEW_SAGE_ROOT="."10+elif [ -f ../../sage -a -d ../../build ]; then11+ NEW_SAGE_ROOT="../.."12fi1314+if [ -n "$NEW_SAGE_ROOT" ]; then15+ # Make NEW_SAGE_ROOT absolute16+ NEW_SAGE_ROOT=`cd "$NEW_SAGE_ROOT" && pwd -P`17+18+ # Warn if NEW_SAGE_ROOT does not equal the old SAGE_ROOT19+ if [ "$SAGE_ROOT" != "$NEW_SAGE_ROOT" -a -n "$SAGE_ROOT" ]; then20+ # But don't warn if we are just dereferencing the symlink21+ if ! [[ -L "$SAGE_ROOT" ]]; then22+ echo >&2 "Warning: overwriting SAGE_ROOT environment variable:"23+ echo >&2 "Old SAGE_ROOT=$SAGE_ROOT"24+ echo >&2 "New SAGE_ROOT=$NEW_SAGE_ROOT"25+ fi26+ fi27+28+fi29+30# Don't execute the commands more than once for the same version of31# sage-env... for the same combination of SAGE_LOCAL and SAGE_VENV.32# "6" indicates the version of the format of the value of SAGE_ENV_VERSION.33@@ -123,6 +143,10 @@34fi35export SAGE_ENV_SOURCED="$SAGE_ENV_VERSION"3637+if [ -n "$NEW_SAGE_ROOT" ]; then38+ export SAGE_ROOT="$NEW_SAGE_ROOT"39+fi40+41# The compilers are set in order of priority by42# 1) environment variables43# 2) compiler installed by sage44@@ -591,6 +615,8 @@45MAKE=`echo "$MAKE" | sed 's/ .*//'`46fi47export MAKE48+49+export PIP_FORMAT="columns"5051# Set the cysignals crash logs directory52if [ -z "$CYSIGNALS_CRASH_LOGS" ]; then535455