summaryrefslogtreecommitdiff
path: root/academic/mathics/mathics-create-database
diff options
context:
space:
mode:
Diffstat (limited to 'academic/mathics/mathics-create-database')
-rw-r--r--academic/mathics/mathics-create-database19
1 files changed, 19 insertions, 0 deletions
diff --git a/academic/mathics/mathics-create-database b/academic/mathics/mathics-create-database
new file mode 100644
index 0000000000..62f39a9b01
--- /dev/null
+++ b/academic/mathics/mathics-create-database
@@ -0,0 +1,19 @@
+# created by Urchlay
+
+#!/bin/sh
+
+if [ -z "$HOME" ]; then
+ echo "$0: \$HOME not set in the environment, aborting" 1>&2
+ exit 1
+fi
+
+DBDIR="$HOME/.local/var/mathics/"
+
+# In case of multiple installs, SCRIPT prefers /usr/lib64 to /usr/lib,
+# and higher-numbered python versions to lower-numbered. But this is
+# just paranoia, there shouldn't be multiple mathics installations.
+SCRIPT=$( /bin/ls -d /usr/lib*/python2.*/site-packages/mathics/manage.py | tac | head -1 )
+
+echo "Initializing mathics SQLite databases in $DBDIR"
+mkdir -p $DBDIR
+exec python $SCRIPT syncdb --noinput