Gentoo Archives: gentoo-dev

From: Karl Trygve Kalleberg <karltk@×××××××.no>
To: gentoo-dev@g.o
Subject: Re: [gentoo-dev] Secure Gentoo - OO-ebuilds
Date: Sat, 12 Jan 2002 18:37:55
Message-Id: 20020113022520.238ed948.karltk@prosalg.no
In Reply to: [gentoo-dev] Secure Gentoo - OO-ebuilds by John Stalker
1 On Thu, 10 Jan 2002 08:58:14 -0500
2 John Stalker <stalker@××××××××××××××.EDU> wrote:
3
4 > Damon M. Conway:
5 > Since eclasses are associated with a learning curve, would it not be
6 > preferrable to recast the whole inheritance thing in a proper
7 > object-oriented language and rather build a support framework for it
8 > there?
9 >
10 > Karl Trygve Kalleberg:
11 > hmm using scheme sounds very appealing, but the problem is that
12 > many of us have an unnatural fear of parenthesises... By using
13 > OO portage would be indeed more powerful and it would make it possible
14 > for a user to override doman if he wishes so easily, or to add a hook
15 > procedure that is run whenever src_compile is ready...
16
17 You got the names reversed :p
18
19 > Me:
20 > I think we'd better keep portage in bash (or rather what appears
21 > to be bash). We also need to keep it fairly simple. Otherwise we
22 > lose two important resources: (1) users contributing ebuilds rather
23 > than just installing tarballs on their own systems and (2) users
24 > making a legitimate attempt to diagnose bugs in an ebuild rather
25 > than just filing bug reports like "emerge failed." I don't see
26 > a problem in adding hooks. One can have emerge source config
27 > files, if present, at various points AFTER sourcing the ebuild
28 > but BEFORE calling functions and then call before_compile,
29 > after_compile, etc. The advantage of something like that is that
30 > it is pretty much invisible. If you want you use the hooks,
31 > override some defaults, etc. and you don't need to bother the
32 > ebuild writer or users who are happy to accept the defaults.
33
34 What you correctly imply is that the targeted user-base for Gentoo can be
35 assumed to have a fair knowledge of bash scripting. I really don't think
36 we should assume knowledge of other languages (especially since the second
37 language for most power users/system administrators seem to be Perl, which
38 some of us really don't fancy ;).
39
40 I am actually fairly sceptical to bringing too much OO thinking and
41 terminology into our ebuilds. I think that we will for the most part see
42 that we will have trivially short inheritance chains, and I cannot
43 off-hand see any use for the other fancy features of OO (polymorphism,
44 data hiding).
45
46 I'd like to have Dan Armak and Bart Verwilst (and any other people with
47 experience with our eclasses system) to write some sort of summary/report
48 and post to the list on where eclasses have been found to be beneficial
49 and whether or not their drawbacks (obscurity, mainly) are too bad.
50
51
52 Extending portage with (possibly context-aware) defaults to src_compile
53 and src_install will most likely happen at a later stage. If there seems
54 to be a need for before_compile and after_compile, that might also be
55 done, but this is currently handled by putting the necessary commands into
56 the src_compile-function itself.
57
58 There has been mentions of a separate src_configure step, though. I think
59 Mikael knows more about this.
60
61
62 Kind regards,
63
64 Karl T