cleanup: only run uninstall-unneeded-ports on watcher

Doing this in response to low disk space had a higher chance of freeing
space by uninstalling something that was just built as a dependency of
the next build, meaning it would be immediately reinstalled.
This commit is contained in:
Joshua Root
2024-01-20 21:30:57 +11:00
parent 54413fe125
commit 14b563c315
+7 -5
View File
@@ -81,11 +81,13 @@ cleanup() {
DISK_FREE_THRESHOLD=15000000
if [[ ${BUILDBOT_BUILDERNAME:-unknown} == *-watcher || "$disk_free_before" -lt "$DISK_FREE_THRESHOLD" ]]; then
echo
echo "----> Uninstalling unneeded ports"
# $thisdir is set by mpbb and points to the directory in which this script resides
# shellcheck disable=SC2154
"$(readlink "${option_prefix}/bin/port-tclsh")" "${thisdir}/tools/uninstall-unneeded-ports.tcl"
if [[ ${BUILDBOT_BUILDERNAME:-unknown} == *-watcher ]]; then
echo
echo "----> Uninstalling unneeded ports"
# $thisdir is set by mpbb and points to the directory in which this script resides
# shellcheck disable=SC2154
"$(readlink "${option_prefix}/bin/port-tclsh")" "${thisdir}/tools/uninstall-unneeded-ports.tcl"
fi
if [ ! -L "${option_prefix}/var/macports/distfiles" ]; then
echo
echo "----> Deleting distfiles"