From 0d5651b0ab83c05e88d38245ace51581df6cda27 Mon Sep 17 00:00:00 2001 From: Aaron Gyes Date: Fri, 21 Jan 2022 13:03:35 -0800 Subject: [PATCH] .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. --- build_tools/make_pkg.sh | 2 +- build_tools/osx_package_scripts/postinstall | 2 +- build_tools/osx_package_scripts/preinstall | 7 +++++++ 3 files changed, 9 insertions(+), 2 deletions(-) create mode 100755 build_tools/osx_package_scripts/preinstall diff --git a/build_tools/make_pkg.sh b/build_tools/make_pkg.sh index 25a3de109..d4fcd9934 100755 --- a/build_tools/make_pkg.sh +++ b/build_tools/make_pkg.sh @@ -35,6 +35,6 @@ MAC_PRODUCTSIGN_ID=${MAC_PRODUCTSIGN_ID:--} productsign --sign "${MAC_PRODUCTSIGN_ID}" "$OUTPUT_PATH/fish-$VERSION.pkg" "$OUTPUT_PATH/fish-$VERSION-signed.pkg" && mv "$OUTPUT_PATH/fish-$VERSION-signed.pkg" "$OUTPUT_PATH/fish-$VERSION.pkg" # Make the app -{ cd "$PKGDIR/build" && make signed_fish_macapp && zip -r "$OUTPUT_PATH/fish-$VERSION.app.zip" fish.app; } +{ cd "$PKGDIR/build" && make -j 12 signed_fish_macapp && zip -r "$OUTPUT_PATH/fish-$VERSION.app.zip" fish.app; } rm -r "$PKGDIR" diff --git a/build_tools/osx_package_scripts/postinstall b/build_tools/osx_package_scripts/postinstall index 544fd1de1..e9a6a0517 100755 --- a/build_tools/osx_package_scripts/postinstall +++ b/build_tools/osx_package_scripts/postinstall @@ -1,3 +1,3 @@ #!/bin/sh -x -./add-shell /usr/local/bin/fish > /tmp/fish_postinstall_output.log +./add-shell ${DSTVOLUME}usr/local/bin/fish | logger -s -t "${INSTALL_PKG_SESSION_ID}" diff --git a/build_tools/osx_package_scripts/preinstall b/build_tools/osx_package_scripts/preinstall new file mode 100755 index 000000000..2f2cffb3b --- /dev/null +++ b/build_tools/osx_package_scripts/preinstall @@ -0,0 +1,7 @@ +#!/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"