From 867545ebd8fb51535dd2a715aac033830d29f112 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sun, 20 Mar 2016 17:55:08 -0400 Subject: [PATCH] copy_buildsync.sh: simplify find clean up Use find options to process everything rather than running through grep/sort/tr/xargs. --- scripts/copy_buildsync.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/scripts/copy_buildsync.sh b/scripts/copy_buildsync.sh index 927a1fdf..b4351cbc 100755 --- a/scripts/copy_buildsync.sh +++ b/scripts/copy_buildsync.sh @@ -74,11 +74,9 @@ copy_arch_to_outgoing() { fail=1 fi done - find ${outdir} -mindepth 1 -type d \ - | egrep -v current \ - | sort -r \ - | tr '\n' '\0' \ - | xargs -0 --no-run-if-empty rmdir --ignore-fail-on-non-empty + find "${outdir}" \ + -depth -mindepth 1 -type d \ + -exec rmdir --ignore-fail-on-non-empty {} + } process_arch() {