Package: cantor / 4:20.12.1-5

work-around-Sage-no-root.diff Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
Description: work around unset SAGE_ROOT in Debian Sage package
 In this shell script, '$1' refers to the Sage binary that is to
 be used. The script is needlessly complex to accommodate for old
 versions of Sage, and perhaps the author is unaware of Sage's
 new command-line arguments.
 .
 Debian's `sage --root` is an empty string, so Cantor fails to
 start it. This patch is more succinct by starting the Sage shell
 which sets all variables appropriately, then starting
 'sage-ipython' as desired. This way, as opposed to having
 '#!/usr/bin/sage --sh' as the shebang, still permits usage of
 local Sage copies.
Author: John Scott <jscott@posteo.net>
Bug-Debian: https://bugs.debian.org/972346
Forwarded: https://bugs.kde.org/show_bug.cgi?id=408176#c19
Last-Update: 2021-01-17

--- cantor-20.12.1.orig/src/backends/sage/cantor-execsage
+++ cantor-20.12.1/src/backends/sage/cantor-execsage
@@ -1,23 +1,2 @@
 #!/usr/bin/env bash
-
-export SAGE_ROOT="$($1 --root)"
-
-# Sage 9.2 stop source sage-env-config automatically, so do it manually
-if [[ -f $SAGE_ROOT"/bin/sage-env" ]]; then
-    if [[ -f $SAGE_ROOT"/bin/sage-env-config" ]]; then
-        source "$SAGE_ROOT/bin/sage-env-config" >&2
-    fi
-    . "$SAGE_ROOT/bin/sage-env" >&2
-elif [[ -f $SAGE_ROOT"/local/bin/sage-env" ]]; then
-    if [[ -f $SAGE_ROOT"/local/bin/sage-env-config" ]]; then
-        source "$SAGE_ROOT/local/bin/sage-env-config" >&2
-    fi
-    . "$SAGE_ROOT/local/bin/sage-env" >&2
-elif [[ -f $SAGE_ROOT"/src/bin/sage-env" ]]; then
-    if [[ -f $SAGE_ROOT"/src/bin/sage-env-config" ]]; then
-        source "$SAGE_ROOT/src/bin/sage-env-config" >&2
-    fi
-    . "$SAGE_ROOT/src/bin/sage-env" >&2
-fi
-
-exec sage-ipython -i --simple-prompt
+{ echo "sage-ipython -i --simple-prompt"; cat; } | $1 --sh