Gentoo Archives: gentoo-dev

From: "Johannes Ballé" <joba123@×××××.de>
To: gentoo-dev@g.o
Subject: Re: [gentoo-dev] Ebuild Readability Issues
Date: Tue, 03 Dec 2002 16:54:33
Message-Id: 200212031754.54382.joba123@arcor.de
In Reply to: Re: [gentoo-dev] Ebuild Readability Issues by foser
1 Am Monday 02 December 2002 14:03 schrieb foser:
2 > Let's face it, using those longer names would make ebuilds bigger,
3 > uglier and probably faultier :the longer the varname, the higher the
4 > risk of mistakes. Given the amount of times these vars are used it would
5
6 That's not correct. The longer the varname, the greater the amount of
7 redundancy. But redundancy in general does not CAUSE mistakes, redundancy
8 allows for easier detection of mistakes. For instance, take a one-letter var
9 name. A single typo can make it a totally different variable. When you take 5
10 or 8 letters, a single typo would cause the variable to be undefined, and you
11 could check for that. (I admit checking for unset variables may be difficult
12 in shell scripts, but you get my point.)
13
14 > probably also increase the portage tree a few megs in size, i don't
15 > think that's acceptable.
16
17 That is an argument, although it shouldn't impact the traffic so much as rsync
18 uses compression, anyway (unless it's turned off for some reason, correct me
19 if I'm wrong). And regarding disk space, I wouldn't mind to have a few megs
20 more reserved for the portage tree on my boxes.
21
22 > The best way to learn about ebuilds and variables inside them is still
23 > looking at other ebuilds.
24
25 Definitely not. You need a good reference, too. It's a major pain to have to
26 search for one particular feature in the portage tree that you'd like to add
27 to your ebuild. I tried this. In addition, if you use var names such as $P or
28 $PN, looking at other ebuilds to find out what they mean can take you a long
29 time.
30
31 Of course, if you write 2 or 3 ebuilds a day, long var names can become a
32 pain, too. Therefore, I vote for short var names that are documented :-)
33
34 For that matter, "man 5 ebuild" looks fine. Maybe the dev howto should
35 explicitly point to that manpage, since I, too, missed it.
36
37 Greetings.
38
39 --
40 Johannes Ballé <joba123@×××××.de>
41
42
43 --
44 gentoo-dev@g.o mailing list