Opened 6 years ago

Last modified 4 years ago

#22510 closed enhancement

Enhanced package uninstallation for Sage spkgs — at Initial Version

Reported by: Erik Bray Owned by:
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: build Keywords: uninstall
Cc: Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges


Currently spkg uninstallation is handled in an ad-hoc manner. Many packages contain some rough uninstallation steps in their spkg-install scripts (to be run, for example, when upgrading/reinstalling a package). But these are often imprecise and not thorough (though maybe still worth keeping where they already exist, as I will explain below). Here are a few proposals for improving package uninstallation (which is useful even for required packages, such as in the case of upgrading them):

  • For all installed packages, maintain lists of the files installed by those packages. For this, something like #22509 is a prerequisite. This list could even go into the $SAGE_LOCAL/var/lib/sage/installed/ files we already have. Uninstalling a package would consist primarily of removing all files in this list. It would also remove directories that are left empty after all files are removed.
  • Add support an optional spkg-uninstall script for any spkgs. This can be used to perform any additional uninstallation steps. For example, it is a place to remove files / data added specifically for Sage by spkg-install (e.g. symlinks) that are not installed by the package's make install. This would be run before the full uninstall described in the previous bullet point (in case any files from the package are necessary to determine additional uninstall steps). So this would be sort of like a pre-uninstall.
  • Add support for an optional spkg-legacy-uninstall script. This would contain whatever commands the spkg-install scripts currently perform for uninstall. This would only be run when the installed file list described in the first bullet point is unavailable (e.g. for backwards compatibility when upgrading to this new system for the first time). This feature could maybe be removed entirely later, but would be good to add at first and keep around for a while.

The new process for upgrading / reinstalling a package could b (especially if more progress is made toward supporting #21726 in all spkgs):

  1. Build
  2. Install to temporary directory (#22509)
  3. Upon successful completion of 1. and 2., uninstall old package
  4. Install new package by copying from temp dir into $SAGE_LOCAL

This means a cleaner rollback from failed upgrades.

Change History (0)

Note: See TracTickets for help on using tickets.