diff options
Diffstat (limited to 'src/librefetch/librefetchdir/libmakepkg/tidy/purge.sh')
-rwxr-xr-x | src/librefetch/librefetchdir/libmakepkg/tidy/purge.sh | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/librefetch/librefetchdir/libmakepkg/tidy/purge.sh b/src/librefetch/librefetchdir/libmakepkg/tidy/purge.sh index a37ff2f..acd3c91 100755 --- a/src/librefetch/librefetchdir/libmakepkg/tidy/purge.sh +++ b/src/librefetch/librefetchdir/libmakepkg/tidy/purge.sh @@ -23,7 +23,7 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. # -[[ -n "$LIBMAKEPKG_TIDY_PURGE_SH" ]] && return +[[ -n $LIBMAKEPKG_TIDY_PURGE_SH ]] && return LIBMAKEPKG_TIDY_PURGE_SH=1 LIBRARY=${LIBRARY:-'/usr/share/makepkg'} @@ -31,7 +31,6 @@ LIBRARY=${LIBRARY:-'/usr/share/makepkg'} source "$LIBRARY/util/message.sh" source "$LIBRARY/util/option.sh" - packaging_options+=('purge') tidy_remove+=('tidy_purge') @@ -40,14 +39,14 @@ tidy_purge() { msg2 "$(gettext "Purging unwanted files...")" local pt for pt in "${PURGE_TARGETS[@]}"; do - if [[ ${pt} = "${pt%/}" ]]; then - if [[ ${pt} = "${pt//\/}" ]]; then + 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 + if [[ ${pt%/} == "${pt//\//}" ]]; then find . -type d -name "${pt%/}" -exec rm -rf -- '{}' + else rm -rf -- "${pt}" |