From: Sebastian Pipping Date: Tue, 11 Jan 2011 11:18:05 +0000 (+0100) Subject: Fix warning "rm: cannot remove `/var/cache/genkernel/src': Is a directory" (bug ... X-Git-Tag: v3.4.11~40 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=5a7012ced6547dea49fe2bf9b42aceea9e6abbda;p=genkernel.git Fix warning "rm: cannot remove `/var/cache/genkernel/src': Is a directory" (bug #347213) --- diff --git a/gen_funcs.sh b/gen_funcs.sh index 2a87b14..12722ca 100755 --- a/gen_funcs.sh +++ b/gen_funcs.sh @@ -250,13 +250,11 @@ setup_cache_dir() if [ "${CLEAR_CACHE_DIR}" == 'yes' ] then print_info 1 "Clearing cache dir contents from ${CACHE_DIR}" - CACHE_DIR_CONTENTS=`ls ${CACHE_DIR}|grep -v CVS|grep -v cpio|grep -v README` - - for i in ${CACHE_DIR_CONTENTS} + while read i do print_info 1 " >> removing ${i}" - rm ${CACHE_DIR}/${i} - done + rm "${i}" + done < <(find "${CACHE_DIR}" -maxdepth 1 -type f -name '*.tar.*') fi }