Johannes Schauer Marin Rodrigues:
Control: tag -1 + moreinfo

Hi,

[...]


yes, in the code there is this comment right after the "rm -rf" runs:

# we ignore the exit status, because the command will fail to remove the
# unpack directory itself because of insufficient permissions

It would be nice if there were an easy way to instruct rm to remove a directory
recursively *except* for the root directory. What do you suggest should sbuild
do instead? I see several options:

  * implement our own recursive removal which ignores the parent
  * redirect the rm -rf output to /dev/null to not confuse the user
  * if rm -rf fails, print a message saying that the failure is not fatal
    because there will be a rmdir on the outside which will clean the root

Thanks!

cheers, josch

Of the options presented, I would recommend the first one.

That option has my preference because:

 A) It does not present an error to be ignored. I do not like such
    behavior since I feel it promotes error blindness. The third
    alternative fails this one in my view.

 B) It does not hide unrelated errors (that is, if another error occurs
    that message will not be hidden from the user). The second
    alternative fails this one in my view.

Best regards,
Niels


Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

Reply via email to