[151157] contrib/mp-buildbot/mpbb-cleanup

ryandesign at macports.org ryandesign at macports.org
Mon Aug 8 21:29:28 PDT 2016


Revision: 151157
          https://trac.macports.org/changeset/151157
Author:   ryandesign at macports.org
Date:     2016-08-08 21:29:28 -0700 (Mon, 08 Aug 2016)
Log Message:
-----------
mp-buildbot: simplify cleanup output

Print only the port name when cleaning logs or build directories, not the
path of each file deleted.

Modified Paths:
--------------
    contrib/mp-buildbot/mpbb-cleanup

Modified: contrib/mp-buildbot/mpbb-cleanup
===================================================================
--- contrib/mp-buildbot/mpbb-cleanup	2016-08-09 03:17:47 UTC (rev 151156)
+++ contrib/mp-buildbot/mpbb-cleanup	2016-08-09 04:29:28 UTC (rev 151157)
@@ -13,14 +13,22 @@
     if [ -n "$("${option_prefix}/bin/port" -q installed active)" ]; then
         "${option_prefix}/bin/port" -fp deactivate active
     fi
-
+    echo
     echo "----> Uninstalling obsolete ports"
     "${option_prefix}/bin/port-tclsh" "${thisdir}/tools/uninstall-old-ports.tcl"
-
+    echo
     echo "----> Deleting distfiles"
-    find "${option_prefix}/var/macports/distfiles/" -type f -mtime +1 -print -delete
-    find "${option_prefix}/var/macports/distfiles/" -type d -mindepth 1 -empty -print -delete
-
-    echo "----> Deleting build files and logs"
-    find "${option_prefix}/var/macports/build/" "${option_prefix}/var/macports/logs/" -mindepth 1 -print -delete
-}
+    find "${option_prefix}/var/macports/distfiles/" -type f -mtime +1 -print | sed -E 's/^/Deleting distfile /'
+    find "${option_prefix}/var/macports/distfiles/" -type d -mindepth 1 -empty -print | sed -E 's/^/Deleting directory /'
+    echo
+    for dir in build logs; do
+        echo "----> Deleting ${dir}"
+        ports="$(find ${option_prefix}/var/macports/${dir} -name '.*' -prune -o -depth 2 -type d -print | sed 's,^.*/,,' | sort -fu)"
+        for port in ${ports}; do
+            echo "Deleting ${dir} for ${port}"
+            echo rm -rf ${option_prefix}/var/macports/${dir}/*/${port}
+        done
+        echo rm -rf "${option_prefix}/var/macports/${dir}/*"
+        echo
+    done
+  }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20160808/91a044ca/attachment-0001.html>


More information about the macports-changes mailing list