From 2ca4c5d756b7f7f507b7949bc31682839cb3e2b8 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Mon, 7 Aug 2017 12:13:56 -0700 Subject: [PATCH] Fix lz4 and libssh uninstall. We have to remove the lz4 build tree as root. We can't do "make uninstall" for libssh, so manually remove the stuff it installs. Also, remove the -done file, and remove the downloaded tarball and build tree if we're supposed to do so. Change-Id: If594ab241a9955229dfbc12e4f5e0c517add6daa Reviewed-on: https://code.wireshark.org/review/22996 Reviewed-by: Guy Harris --- tools/macos-setup.sh | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/tools/macos-setup.sh b/tools/macos-setup.sh index 01334b1b00..c7815ebb48 100755 --- a/tools/macos-setup.sh +++ b/tools/macos-setup.sh @@ -1616,7 +1616,13 @@ uninstall_lz4() { # # Get rid of the previously downloaded and unpacked version. # - rm -rf lz4-$installed_lz4_version + # "make install" apparently causes some stuff to be + # modified in the build tree, so, as it's done as + # root, that leaves stuff owned by root in the build + # tree. Therefore, we have to remove the build tree + # as root. + # + sudo rm -rf lz4-$installed_lz4_version rm -rf lz4-$installed_lz4_version.tar.gz fi @@ -1779,7 +1785,32 @@ install_libssh() { uninstall_libssh() { if [ ! -z "$installed_libssh_version" ] ; then - echo "Sadly, libssh uses cmake, and doesn't support uninstall." + echo "Uninstalling libssh:" + cd libssh-$installed_libssh_version + # + # libssh uses cmake and doesn't support "make uninstall" + # + # $DO_MAKE_UNINSTALL || exit 1 + sudo rm -rf /usr/local/lib/libssh* + sudo rm -rf /usr/local/include/libssh + sudo rm -rf /usr/local/lib/pkgconfig/libssh* + sudo rm -rf /usr/local/lib/cmake/libssh + # + # libssh uses cmake and doesn't support "make distclean" + # + # make distclean || exit 1 + cd .. + rm libssh-$installed_libssh_version-done + + if [ "$#" -eq 1 -a "$1" = "-r" ] ; then + # + # Get rid of the previously downloaded and unpacked version. + # + rm -rf libssh-$installed_libssh_version + rm -rf libssh-$installed_libssh_version.tar.gz + fi + + installed_libssh_version="" fi }