Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: pacho@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: Tue, 29 Jan 2013 22:06:02
Message-Id: 20130129230637.66d390db@pomiocik.lan
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 Tue, 29 Jan 2013 22:47:26 +0100
2 Pacho Ramos <pacho@g.o> wrote:
3
4 > El mar, 29-01-2013 a las 14:03 +0800, Ben de Groot escribió:
5 > > On 29 January 2013 03:30, Pacho Ramos <pacho@g.o> wrote:
6 > > > El lun, 28-01-2013 a las 14:37 +0800, Ben de Groot escribió:
7 > > >> I've started using this eclass, but with README files, not the variable,
8 > > >> because this is currently the only way I can make sure it honours my
9 > > >> formatting.
10 > > >>
11 > > >
12 > > > Couldn't it be covered if "echo -e" was used (even with fmt) and you,
13 > > > then, control formatting with some of the sequences it allows (they are
14 > > > shown in its man page)?
15 > >
16 > > No. The eclass should assume that DOC_CONTENTS is already correctly
17 > > formatted. If you must, you can add a convenience function for people
18 > > who do want reformatting, but this should NOT be the default. Please
19 > > don't make this eclass harder to use than it needs to be.
20 > >
21 >
22 > I can add a variable (and probably will), but would prefer to keep it
23 > formatting messages by default, otherwise, how will you set DOC_CONTENTS
24 > variable inside a pkg phase (instead of global scope) without adding
25 > tabs to it? You can of course add it, but it will be read as something
26 > like:
27 > src_prepare() {
28 > DOC_CONTENTS="blablabla
29 > blablabla"
30 > # Rest of src_prepare stuff
31 > }
32
33 How about:
34
35 src_prepare() {
36 DOC_CONTENTS=(
37 "line 1"
38 "line 2"
39 "line 3"
40 )
41 }
42
43 ?
44
45 --
46 Best regards,
47 Michał Górny

Attachments

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