1 |
Aaron Walker wrote: [Fri Nov 12 2004, 06:42:06AM EST] |
2 |
> Firstly, new* shouldn't need to die since they just cp and call their do* |
3 |
> counterpart, iirc. |
4 |
|
5 |
except that we'd want to see the correct die message. |
6 |
|
7 |
> Yes, I agree that things should install something or die, not ignore it. |
8 |
> However, IMO, it is considered better style to keep all that kind of |
9 |
> stuff in one place (the ebuild), just like it's usually considered |
10 |
> better to handle all signals and exit code in main() of a C/C++ app. |
11 |
|
12 |
I've made the same statement in the past. You might reconsider that |
13 |
position in the context of ebuilds. There is quite a difference: |
14 |
|
15 |
- In C/C++ it can be expensive to do up-front checking prior to |
16 |
calling into an API. Additionally the exception model of C++ makes |
17 |
it natural to do error handling in the caller rather than the |
18 |
callee. After all, how should the callee know what you want to do |
19 |
with errors? |
20 |
|
21 |
- When calling the aforementioned commands in ebuilds, there is never |
22 |
a situation when a failure is expected. If ever a command fails, |
23 |
the correct action is to die. Since that is the case, there is no |
24 |
reason to put all the error-handling code in the ebuilds themselves. |
25 |
It's just a burden on ebuild writers, and instead the errors often |
26 |
get ignored. |
27 |
|
28 |
Regards, |
29 |
Aron |
30 |
|
31 |
-- |
32 |
Aron Griffis |
33 |
Gentoo Linux Developer |