Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.

Make Sage relocatable #27

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Make Sage relocatable #27

wants to merge 2 commits into from

Conversation

culler
Copy link

@culler culler commented Jan 9, 2021

This pull request implements a scheme for making Sage relocatable. It is approximately what was suggested in ticket #31076 with some improvements. Here is a summary:

The relocate-once.py script is modified so that the search path is replaced by a symlink. That symlink can live in one of two places: either /var/tmp/sage-XXXX or $HOME/.sage/locations/XXXX where XXXX is a uuid generated by the script. The first location is used when sage is meant to be usable by all users. In that case the symlink is owned by root and is created by a call to sudo. The second location is used for a private installation of sage, usable by one user, and in that case the symlink is owned by that user. It is expected that the first location would be used both by administrators of multi-user systems and by owners of personal computers. In either of these cases the person installing sage is able to authenticate to sudo. Since people are used to entering admin passwords for installation tasks, this should not be confusing to users. The private installation is for users on multi-user systems who do not have administrative privileges and want to install sage in their own home directory for their private use.

When Sage is started by the sage script, the script checks that its $0 matches the target of the symlink. If not, it changes the symlink to match. In the case where the symlink is owned by root this is done by calling sudo with a helpful prompt.

This pull request includes the changes to relocate-once.py but there are also changes required to the sage and sage-env scripts that are needed to make this work. Those changes are included in this pull request as a git diff file which is meant to be applied to the Sage source tree. The diff file is named relocate-sage.patch.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant