Gentoo Archives: gentoo-dev

From: Ulrich Mueller <ulm@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] readme.gentoo.eclass: expand variables when a file is used instead of setting DOC_CONTENTS in ebuild
Date: Sun, 31 Aug 2014 12:30:07
Message-Id: 21507.5446.75540.454951@a1i15.kph.uni-mainz.de
In Reply to: [gentoo-dev] readme.gentoo.eclass: expand variables when a file is used instead of setting DOC_CONTENTS in ebuild by Pacho Ramos
1 >>>>> On Sun, 31 Aug 2014, Pacho Ramos wrote:
2
3 > This tries to solve:
4 > https://bugs.gentoo.org/show_bug.cgi?id=519682
5
6 - cp "${FILESDIR}/README.gentoo-${SLOT%/*}" "${T}"/README.gentoo || die
7 + eval echo $(cat "${FILESDIR}/README.gentoo-${SLOT%/*}") > "${T}"/README.gentoo || die
8
9 Am I missing something, or will this destroy any formatting (like line
10 breaks) within the file?
11
12 > Looks to do the job but maybe there are shorter or saner ways of
13 > doing it
14
15 If the goal is to expand variables like PF, then I think a solution
16 like the one indicated in comment #2 of above-mentioned bug would be
17 safer, i.e. expand @PF@ etc. to the respective variables. This can be
18 done with sed.
19
20 Ulrich

Replies