You are not logged in.
Hi, PKGBUILDs should die on failure, rather than just continue regardless of errors. Here's a little rant:
Why is it acceptable for ./configure to fail? Or make install to fail? Or the installation of just about any file? They could fail for lots of reasons, such as expecting a non-existent directory to exist, just being badly-written, or disk corruption, or running out of disk space. I see this lack of error-handling both in official packages and in the AUR.
Failing on an error is a fundamental part of programming, and BASH makes a mockery of it. And then Linux developers seem to get brainwashed by BASH into believing that mixing important and non-important errors together, then just ignoring all the errors, is an acceptable programming practice. It's not - it's a comedy of errors (excuse the pun).
SourceMage handles this problem by having one huge command constructed with && at the end of each line, so at least will fail on error.
Gentoo is using its custom die command more often these days (|| die), but my proposal is in limbo, presumably because "SpanKY" overrules every other dev (little bit of Gentoo politics there ).
The current practice of make || return 1 is correct, but || return 1 should be used far more often - example (notice the looped use of install, and the annoyance of having to check $? after the loop). "More often" includes make install even if it's on the final line, both for consistency, and so it is not forgotten to be added when further lines are added to the end (e.g. to install the license/documentation files).
I'll place this on flyspray after a bit of feedback.
Edit: I'll distro-hop instead.
Last edited by brebs (2008-04-21 13:55:33)
Offline
this has already been discussed, iirc i made those recomendations already.
in either case, i think you'll get more input if you post it on the mailing lists
Offline
I agree with both of you.
Offline
I'm as guilty as anyone in this. However, I always use it on the initial "configure" and "make install" lines where there is a lot of output. I tend to miss it when installing individual files at the end (e.g. Licences, icons...) because I can see if they failed from the output.
Offline