fish-shell/build_tools/osx_package_scripts/preinstall
Aaron Gyes 0d5651b0ab .pkg scripts: remove old installs, fix install volume, logging
+ Adds a preinstall script to wipe out whatever the last .pkg
   installed. This should avoid systems that have mad many updates
   getting into strange states autoloading things that no longer
   exist. Fixes #2963

 + Run add-shell with ${DSTVOLUME} prepended to the path - the
   installer lets users intall onto any volume, so it's plausible
   not installed onto /

 + Use `logger` instead of rando /tmp files for logging - stuff
   should show up in Console.

 + make_pkg makes the pkg and also fish.app - the former was being
   built with -j12 already, make the latter do so as well.
2022-01-21 14:01:06 -08:00

7 lines
368 B
Bash
Executable file

#!/bin/sh -x
logger -s -t "${INSTALL_PKG_SESSION_ID}" "Removing any previous installation"
pkgutil --pkg-info ${INSTALL_PKG_SESSION_ID} && pkgutil pkgutil --only-files --files ${INSTALL_PKG_SESSION_ID} | while read installed
do rm -v ${DSTVOLUME}${installed}
done | logger -s -t "${INSTALL_PKG_SESSION_ID}"
logger -s -t "${INSTALL_PKG_SESSION_ID}" "... removed"