summaryrefslogtreecommitdiffstats
path: root/scripts/lib/ptxd_make_world_clean.sh
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2010-10-12 07:16:54 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2010-10-21 10:46:28 +0200
commit26349ec10dabeb3453777194024bdcb3cf7b0aff (patch)
tree083e9605c6b1e9bb631e61151231830a7d7f63ca /scripts/lib/ptxd_make_world_clean.sh
parent52ec158c70d58e86144c2cd5ff86a5489b9f0b09 (diff)
downloadptxdist-26349ec10dabeb3453777194024bdcb3cf7b0aff.tar.gz
ptxdist-26349ec10dabeb3453777194024bdcb3cf7b0aff.tar.xz
[clean] use xargs to remove files from sysroot and delete empty dirs
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'scripts/lib/ptxd_make_world_clean.sh')
-rw-r--r--scripts/lib/ptxd_make_world_clean.sh8
1 files changed, 5 insertions, 3 deletions
diff --git a/scripts/lib/ptxd_make_world_clean.sh b/scripts/lib/ptxd_make_world_clean.sh
index b2a77e560..9f42348d3 100644
--- a/scripts/lib/ptxd_make_world_clean.sh
+++ b/scripts/lib/ptxd_make_world_clean.sh
@@ -46,9 +46,11 @@ ptxd_make_world_clean() {
if [ -d "${pkg_pkg_dir}" ]; then
echo "Removing files from sysroot..."
echo
- find "${pkg_pkg_dir}" ! -type d | while read file; do
- rm -f "${pkg_sysroot_dir}/${file##${pkg_pkg_dir}}"
- done
+ cd "${pkg_pkg_dir}" && find . ! -type d -print0 | \
+ { cd "${pkg_sysroot_dir}" && xargs -0 rm -f; }
+ cd "${pkg_pkg_dir}" && find . -mindepth 1 -depth -type d -print0 | \
+ { cd "${pkg_sysroot_dir}" && \
+ xargs -0 rmdir --ignore-fail-on-non-empty; }
echo "Deleting pkg dir:"
echo "${pkg_pkg_dir}"
rm -rf "${pkg_pkg_dir}"