diff options
Diffstat (limited to 'src')
-rwxr-xr-x | src/librefetch/librefetchdir/libmakepkg/tidy/purge.sh | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/librefetch/librefetchdir/libmakepkg/tidy/purge.sh b/src/librefetch/librefetchdir/libmakepkg/tidy/purge.sh index 95cc751..407d9d7 100755 --- a/src/librefetch/librefetchdir/libmakepkg/tidy/purge.sh +++ b/src/librefetch/librefetchdir/libmakepkg/tidy/purge.sh @@ -3,7 +3,7 @@ # purge.sh - Remove unwanted files from the package # # Copyright (c) 2008-2016 Pacman Development Team <pacman-dev@archlinux.org> -# Copyright (c) 2013-2016 Luke Shumaker <lukeshu@parabola.nu> +# Copyright (c) 2013-2016, 2018 Luke Shumaker <lukeshu@parabola.nu> # # License: GNU GPLv2+ # @@ -38,21 +38,21 @@ tidy_remove+=('tidy_purge') tidy_purge() { if check_option "purge" "y" && [[ -n ${PURGE_TARGETS[*]} ]]; then msg2 "$(gettext "Purging unwanted files...")" - local pt - for pt in "${PURGE_TARGETS[@]}"; do - if [[ ${pt} = "${pt%/}" ]]; then - if [[ ${pt} = "${pt//\/}" ]]; then - find . ! -type d -name "${pt}" -exec rm -f -- '{}' + - else - rm -f "${pt}" - fi - else - if [[ ${pt%/} = "${pt//\/}" ]]; then - find . -type d -name "${pt%/}" -exec rm -rf -- '{}' + - else - rm -rf "${pt}" - fi - fi - done + local pt + for pt in "${PURGE_TARGETS[@]}"; do + if [[ ${pt} = "${pt%/}" ]]; then + if [[ ${pt} = "${pt//\/}" ]]; then + find . ! -type d -name "${pt}" -exec rm -f -- '{}' + + else + rm -f -- "${pt}" + fi + else + if [[ ${pt%/} = "${pt//\/}" ]]; then + find . -type d -name "${pt%/}" -exec rm -rf -- '{}' + + else + rm -rf -- "${pt}" + fi + fi + done fi } |