On Thursday, March 9, 2017 7:08:12 PM EST Michael Orlitzky wrote: > > Whether "-f" is appropriate or not depends on the context. > > With firebird, you expect all of those directories to exist, and you > want to be notified (so that you can update the ebuild) if one of them > isn't there. If upstream unbundles those three libraries and you're > doing "rm -rf", then you'll never notice, and that (now pointless) line > of code will stay there forever.
I was assuming such. However that also means who ever is maintaining said package is not paying attention. Relying on || die to fail when/if one of those changes. Which I would think a safer way is to use -rf and not care if one is removed. In this specific package is also related to patches. Not just that bit in ebuild. Thus maintainer like would have noticed when patches failed. Seemed like needless nitpicking that just leads to confusion. > In the golang-vcs eclass, you truly don't know that the directory will > exist, so "-f" is needed to avoid a "no such directory" error. In that case would you not want to test for existence before removal. Rather than just forced removal if its not there. In the case of an ebuild, calling || die just to remove a no longer needed segment. Seems like a lazy fall back/requirement. I have seen lots of other cruft remain, so not sure that is a good solution overall for keeping ebuilds current. > > Essentially do not use -f with || die or something to that effect. Maybe > > for different reasoning. Still one of those things I never liked. Do it > > this way, for this reason, that is not documented. Others may digress and > > leads to confusion. > > There's an easy rule: always use "|| die" on commands that don't die > themselves. It's always better to fail as soon as something unexpected > happens. Otherwise it's probably going to fail later anyway, and you'll > waste a whole lot of time trying to figure out why it *really* failed. I get the usage of || die , it was just the force option of rm. Since I recalled being told the -f would negate the || die. Short of reasons stated. > There are exceptions to the rule, but it should be really obvious when > you hit one, like if you have a test suite that always returns 1. Sure, and along those lines I do not believe the rm -f || die stuff is documented. That may help and clarify usage based on context. -- William L. Thomson Jr.
signature.asc
Description: This is a digitally signed message part.
