From 1e0dbd34e99d2183ade25843404f465338ace5ad Mon Sep 17 00:00:00 2001 From: Marius Tolzmann Date: Wed, 29 Aug 2012 16:30:19 +0200 Subject: [PATCH] bee-remove: Fix removal of files with special chars in filename fixes issue #152 --- src/bee-remove.sh.in | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/bee-remove.sh.in b/src/bee-remove.sh.in index 9418c46..912edc4 100644 --- a/src/bee-remove.sh.in +++ b/src/bee-remove.sh.in @@ -119,16 +119,14 @@ function do_remove() { run_hooks pre-remove ${pkg} ${BEE_METADIR}/${pkg}/CONTENT.bee-remove - FILES=( $(bee-cache --tmpinstall "${pkg}" print-uniq-files "${pkg}") ) - - # removing files - for f in "${FILES[@]}" ; do - if [ -d "${f}" -a ! -h "$f" ] ; then - rmdir ${OPT_VERBOSE:+-v} ${f} + # remove files that are uniq to the package.. + while read f ; do + if [ -d "${f}" -a ! -h "${f}" ] ; then + rmdir ${OPT_VERBOSE:+-v} "${f}" else - rm -f ${OPT_VERBOSE:+-v} ${f} + rm -f ${OPT_VERBOSE:+-v} "${f}" fi - done + done < <(bee-cache --tmpinstall "${pkg}" print-uniq-files "${pkg}") run_hooks post-remove ${pkg} ${BEE_METADIR}/${pkg}/CONTENT.bee-remove