From 5bfc61bc690b5813533987b4ffee31889c9227e0 Mon Sep 17 00:00:00 2001 From: Jelle Raaijmakers Date: Tue, 13 Sep 2022 12:40:04 +0200 Subject: [PATCH] Ports: Actually clean port build directory The functionality for `./package.sh clean` was a bit weird: based on whether you were working in dev mode, it would try to delete either `$workdir` or `$nongit_workdir` and `*.out` from your `pwd`. The new functionality is pretty clear: `./package.sh clean` deletes the entire build directory for the port regardless of what mode you're in, `./package.sh clean_dist` removes all `$files`, and `./package.sh clean_all` does both. --- Ports/.port_include.sh | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/Ports/.port_include.sh b/Ports/.port_include.sh index 61ffbdd379..65800a9c2a 100755 --- a/Ports/.port_include.sh +++ b/Ports/.port_include.sh @@ -441,11 +441,7 @@ func_defined post_install || post_install() { echo } func_defined clean || clean() { - if [ -z "${IN_SERENITY_PORT_DEV:-}" ]; then - rm -rf "$workdir" *.out - else - rm -rf "$nongit_workdir" *.out - fi + rm -rf "${PORT_BUILD_DIR}" } func_defined clean_dist || clean_dist() { OLDIFS=$IFS @@ -457,18 +453,8 @@ func_defined clean_dist || clean_dist() { done } func_defined clean_all || clean_all() { - if [ -z "${IN_SERENITY_PORT_DEV:-}" ]; then - rm -rf "$workdir" *.out - else - rm -rf "$nongit_workdir" *.out - fi - OLDIFS=$IFS - IFS=$'\n' - for f in $files; do - IFS=$OLDIFS - read url filename hash <<< $(echo "$f") - rm -f "${PORT_META_DIR}/${filename}" - done + clean + clean_dist } addtodb() { if [ -n "$(package_install_state $port $version)" ]; then @@ -574,15 +560,15 @@ do_install() { addtodb "${1:-}" } do_clean() { - echo "Cleaning workdir and .out files in $port..." + echo "Cleaning build directory for $port..." clean } do_clean_dist() { - echo "Cleaning dist in $port..." + echo "Cleaning dist files for $port..." clean_dist } do_clean_all() { - echo "Cleaning all in $port..." + echo "Cleaning all for $port..." clean_all } do_uninstall() {