Gentoo Archives: gentoo-dev

From: Ben de Groot <yngwin@g.o>
To: gentoo-dev@l.g.o
Subject: Re: readme.gentoo.eclass: use echo -e instead of plain echo (Was: Re: [gentoo-dev] readme.gentoo.eclass: Add a DISABLE_AUTOFORMATTING variable=
Date: Wed, 30 Jan 2013 13:24:24
Message-Id: CAB9SyzRkW1w06pn0k_ZkLeYjP-7A=AnCnBTGDdnu+L7ZG3o6wA@mail.gmail.com
In Reply to: Re: readme.gentoo.eclass: use echo -e instead of plain echo (Was: Re: [gentoo-dev] readme.gentoo.eclass: Add a DISABLE_AUTOFORMATTING variable= by Pacho Ramos
1 On 30 January 2013 05:47, Pacho Ramos <pacho@g.o> wrote:
2 > El mar, 29-01-2013 a las 14:03 +0800, Ben de Groot escribió:
3 >> On 29 January 2013 03:30, Pacho Ramos <pacho@g.o> wrote:
4 >> > El lun, 28-01-2013 a las 14:37 +0800, Ben de Groot escribió:
5 >> >> I've started using this eclass, but with README files, not the variable,
6 >> >> because this is currently the only way I can make sure it honours my
7 >> >> formatting.
8 >> >>
9 >> >
10 >> > Couldn't it be covered if "echo -e" was used (even with fmt) and you,
11 >> > then, control formatting with some of the sequences it allows (they are
12 >> > shown in its man page)?
13 >>
14 >> No. The eclass should assume that DOC_CONTENTS is already correctly
15 >> formatted. If you must, you can add a convenience function for people
16 >> who do want reformatting, but this should NOT be the default. Please
17 >> don't make this eclass harder to use than it needs to be.
18 >>
19 >
20 > I can add a variable (and probably will), but would prefer to keep it
21 > formatting messages by default, otherwise, how will you set DOC_CONTENTS
22 > variable inside a pkg phase (instead of global scope) without adding
23 > tabs to it? You can of course add it, but it will be read as something
24 > like:
25 > src_prepare() {
26 > DOC_CONTENTS="blablabla
27 > blablabla"
28 > # Rest of src_prepare stuff
29 > }
30
31 I still prefer the eclass not to mess with formatting by default. You
32 can do what you want by
33
34 src_prepare() {
35 DOC_CONTENTS="blabla
36 indented content"
37 # other stuff
38 }
39
40 src_install() {
41 default
42 readme.gentoo_reformat
43 }
44
45 > Also, autoformatting will help to prevent every package setting messages
46 > with different lines length (in some cases really long lines that I
47 > finally reported some bugs in the past to get them fitting in "standard"
48 > 80 characters per line).
49
50 Sometimes long lines are what is required. If not, then filing a bug
51 is the friendly solution.
52
53 --
54 Cheers,
55
56 Ben | yngwin
57 Gentoo developer
58 Gentoo Qt project lead, Gentoo Wiki admin

Replies