From: Rob Browning Date: Sun, 17 Mar 2013 18:03:03 +0000 (-0500) Subject: configure-sampledata: test -h before -e when appropriate in --clean. X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=118e483b35e36ca011146e1ddea5b47f185888f7;p=packages%2Fb%2Fbup.git configure-sampledata: test -h before -e when appropriate in --clean. Use "test -h" before "test -e" for items that might be dangling symlinks since "test -e" returns false in that case. Signed-off-by: Rob Browning --- diff --git a/t/configure-sampledata b/t/configure-sampledata index 8029f0d..d57d0dd 100755 --- a/t/configure-sampledata +++ b/t/configure-sampledata @@ -25,9 +25,10 @@ case "$1" in '--clean') ( cd t/sampledata - if test -e b; then rm b; fi - if test -e c; then rm c; fi - if test -e etc; then rm etc; fi + # test -e is false for dangling symlinks. + if test -h b -o -e b; then rm b; fi + if test -h c -o -e c; then rm c; fi + if test -h etc -o -e etc; then rm etc; fi ) ;; *)