Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
3-manifolds
GitHub Repository: 3-manifolds/Sage_macOS
Path: blob/main/Sage_framework/files/patches/sage-env.patch
244 views
1
--- ../repo/sage/src/bin/sage-env 2023-03-30 15:47:17
2
+++ sage-env 2023-03-31 12:08:57
3
@@ -110,9 +110,29 @@
4
# Make sure that SAGE_ROOT is either an absolute physical directory name
5
# or empty.
6
if [ -n "$SAGE_ROOT" ]; then
7
- export SAGE_ROOT=$(cd "$SAGE_ROOT" 2>/dev/null && pwd -P)
8
+ NEW_SAGE_ROOT="$SAGE_ROOT"
9
+elif [ -f sage -a -d build ]; then
10
+ NEW_SAGE_ROOT="."
11
+elif [ -f ../../sage -a -d ../../build ]; then
12
+ NEW_SAGE_ROOT="../.."
13
fi
14
15
+if [ -n "$NEW_SAGE_ROOT" ]; then
16
+ # Make NEW_SAGE_ROOT absolute
17
+ NEW_SAGE_ROOT=`cd "$NEW_SAGE_ROOT" && pwd -P`
18
+
19
+ # Warn if NEW_SAGE_ROOT does not equal the old SAGE_ROOT
20
+ if [ "$SAGE_ROOT" != "$NEW_SAGE_ROOT" -a -n "$SAGE_ROOT" ]; then
21
+ # But don't warn if we are just dereferencing the symlink
22
+ if ! [[ -L "$SAGE_ROOT" ]]; then
23
+ echo >&2 "Warning: overwriting SAGE_ROOT environment variable:"
24
+ echo >&2 "Old SAGE_ROOT=$SAGE_ROOT"
25
+ echo >&2 "New SAGE_ROOT=$NEW_SAGE_ROOT"
26
+ fi
27
+ fi
28
+
29
+fi
30
+
31
# Don't execute the commands more than once for the same version of
32
# sage-env... for the same combination of SAGE_LOCAL and SAGE_VENV.
33
# "6" indicates the version of the format of the value of SAGE_ENV_VERSION.
34
@@ -123,6 +143,10 @@
35
fi
36
export SAGE_ENV_SOURCED="$SAGE_ENV_VERSION"
37
38
+if [ -n "$NEW_SAGE_ROOT" ]; then
39
+ export SAGE_ROOT="$NEW_SAGE_ROOT"
40
+fi
41
+
42
# The compilers are set in order of priority by
43
# 1) environment variables
44
# 2) compiler installed by sage
45
@@ -591,6 +615,8 @@
46
MAKE=`echo "$MAKE" | sed 's/ .*//'`
47
fi
48
export MAKE
49
+
50
+export PIP_FORMAT="columns"
51
52
# Set the cysignals crash logs directory
53
if [ -z "$CYSIGNALS_CRASH_LOGS" ]; then
54
55