On Thu, May 03, 2012 at 07:40:03PM -0400, Jeremy Huntwork wrote:
On 5/3/12 7:34 PM, Allan McRae wrote:
On 04/05/12 09:12, Jeremy Huntwork wrote:
find . -mindepth 1 -depth -type d -exec rmdir "{}" + 2>/dev/null || true
Anything else is a lot more code and more cumbersome. If the || true in this instance is unacceptable, then I will probably just submit the changes for the compression section and maintain this modification as a private patch or sed command for myself.
Why do you need "|| true"?
Because of #!/bin/bash -e
find may also discover non-empty directories for which rmdir will fail (we actually want it to fail, obviously). But that exit status would also stop execution of the code.
JH
As I mentioned earlier: "This ||true crap isn't wanted since dca10b062". I'll just leave the commit here... http://projects.archlinux.org/pacman.git/commit/?id=dca10b062 d