From f27f65e18ebcc24f513866b6f7800b397caa9499 Mon Sep 17 00:00:00 2001 From: Alejandro Mery Date: Wed, 28 Aug 2013 09:13:49 +0200 Subject: [PATCH] sde-reschedule: silence ENOTDIR errors from rmdir() and sightly refactor the remove_package() function --- bin/sde-reschedule-package | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/bin/sde-reschedule-package b/bin/sde-reschedule-package index b58dfad..b0b9b7b 100755 --- a/bin/sde-reschedule-package +++ b/bin/sde-reschedule-package @@ -104,12 +104,10 @@ remove_package() { echo_warning "$pkg: missing filename in $flist" else f="$root/$f" - if [ -L "$f" ]; then - rm -f "$f" - elif [ -d "$f" ]; then - rmdir "$f" + if [ ! -L "$f" -a -d "$f" ]; then + rmdir --ignore-fail-on-non-empty -- "$f" else - rm -f "$f" + rm -f -- "$f" fi fi done