From 14b563c3159f7b699a54d4a196f26e70e509d37d Mon Sep 17 00:00:00 2001 From: Joshua Root Date: Sat, 20 Jan 2024 21:30:57 +1100 Subject: [PATCH] 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. --- mpbb-cleanup | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/mpbb-cleanup b/mpbb-cleanup index c3fc4b2..aa584b8 100644 --- a/mpbb-cleanup +++ b/mpbb-cleanup @@ -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"