summaryrefslogtreecommitdiffstats
path: root/packaging/macos/uninstall_toolset.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 16:29:01 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 16:29:01 +0000
commit35a96bde514a8897f6f0fcc41c5833bf63df2e2a (patch)
tree657d15a03cc46bd099fc2c6546a7a4ad43815d9f /packaging/macos/uninstall_toolset.sh
parentInitial commit. (diff)
downloadinkscape-35a96bde514a8897f6f0fcc41c5833bf63df2e2a.tar.xz
inkscape-35a96bde514a8897f6f0fcc41c5833bf63df2e2a.zip
Adding upstream version 1.0.2.upstream/1.0.2upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'packaging/macos/uninstall_toolset.sh')
-rwxr-xr-xpackaging/macos/uninstall_toolset.sh36
1 files changed, 36 insertions, 0 deletions
diff --git a/packaging/macos/uninstall_toolset.sh b/packaging/macos/uninstall_toolset.sh
new file mode 100755
index 0000000..ba92577
--- /dev/null
+++ b/packaging/macos/uninstall_toolset.sh
@@ -0,0 +1,36 @@
+#!/usr/bin/env bash
+# SPDX-License-Identifier: GPL-2.0-or-later
+#
+# This file is part of the build pipeline for Inkscape on macOS.
+#
+# ### uninstall_toolset.sh ###
+# Uninstall a previously installed toolset. In this case, "uninstall" means
+# "unmount", the downloaded .dmg won't be deleted.
+
+### load settings and functions ################################################
+
+SELF_DIR=$(F=$0; while [ ! -z $(readlink $F) ] && F=$(readlink $F); \
+ cd $(dirname $F); F=$(basename $F); [ -L $F ]; do :; done; echo $(pwd -P))
+for script in $SELF_DIR/0??-*.sh; do source $script; done
+
+set -e
+
+### uninstall toolset ##########################################################
+
+function uninstall
+{
+ while : ; do # unmount everything (in reverse order)
+ local disk=$(mount | grep $WRK_DIR | tail -n1 | awk '{ print $1 }')
+
+ if [ ${#disk} -eq 0 ]; then
+ break # nothing to do here
+ else
+ diskutil eject $disk > /dev/null # unmount
+ echo_ok "ejected $disk"
+ fi
+ done
+}
+
+### main #######################################################################
+
+uninstall