From 01e1d08bb65516df227768170fda902546f42339 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Thu, 30 Oct 2008 05:21:46 +0000 Subject: Bug #244946 - Use different syntax to pipe find output into while loops inside python_mod_cleanup(), as a workaround for a bug in /dev/null 2>&1 } @@ -296,16 +296,16 @@ python_mod_cleanup() { for path in "${SEARCH_PATH[@]}"; do einfo "Cleaning orphaned Python bytecode from ${path} .." - while read -rd ''; do + find "${path}" -name '*.py[co]' -print0 | while read -rd ''; do src_py="${REPLY%[co]}" [[ -f "${src_py}" ]] && continue einfo "Purging ${src_py}[co]" rm -f "${src_py}"[co] - done < <(find "${path}" -name '*.py[co]' -print0) + done # attempt to remove directories that maybe empty - while read -r dir; do + find "${path}" -type d | sort -r | while read -r dir; do rmdir "${dir}" 2>/dev/null - done < <(find "${path}" -type d | sort -r) + done done } -- cgit v1.2.3-65-gdbad