This repository was archived by the owner on Nov 16, 2023. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.