Gentoo Archives: gentoo-dev

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

Attachments

File name MIME type
signature.asc application/pgp-signature