Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: Joerg Bornkessel <hd_brummy@g.o>
Cc: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] eclass/vdr-plugin-2.eclass EAPI=6 changes, plz review
Date: Thu, 26 May 2016 09:17:11
Message-Id: 20160526111647.29f280d5.mgorny@gentoo.org
In Reply to: Re: [gentoo-dev] eclass/vdr-plugin-2.eclass EAPI=6 changes, plz review by Joerg Bornkessel
1 Since you already committed it with all the todos inside, just
2 the important thing.
3
4 On Sun, 22 May 2016 23:21:59 +0200
5 Joerg Bornkessel <hd_brummy@g.o> wrote:
6
7 > - - local docfile
8 > - - for docfile in README* HISTORY CHANGELOG; do
9 > - - [[ -f ${docfile} ]] && dodoc ${docfile}
10 > + local commondoc=( README* HISTORY CHANGELOG )
11 > + for docfile in "${commondoc[@]}"; do
12 > + if [[ ${EAPI} == "6" ]]; then
13 > + local DOCS="${DOCS} ${docfile}"
14 > + [[ -f ${docfile} ]] && einstalldocs "${DOCS[@]}"
15 > + else
16 > + [[ -f ${docfile} ]] && dodoc ${docfile}
17 > + fi
18
19 I have no clue what you're trying to achieve here but following
20 the EAPI 6 branch, this is what would happen:
21
22 | local commondoc=( README* HISTORY CHANGELOG )
23
24 1. Let's assume commondoc evaluates to ( README HISTORY CHANGELOG ).
25
26 | local DOCS="${DOCS} ${docfile}"
27
28 2. If DOCS was an array, you discard all but the first element. But
29 let's assume it was empty, so it becomes: DOCS=" README".
30
31 | [[ -f ${docfile} ]] && einstalldocs "${DOCS[@]}"
32
33 3. If README exists, einstalldocs is called. Depending on
34 the implementation, it will either install all files from DOCS, or fail
35 because you pass unexpected parameters.
36
37 | local DOCS="${DOCS} ${docfile}"
38
39 4. Now we have DOCS=" README HISTORY".
40
41 | [[ -f ${docfile} ]] && einstalldocs "${DOCS[@]}"
42
43 5. HISTORY doesn't exist, so nothing happens.
44
45 | local DOCS="${DOCS} ${docfile}"
46
47 6. Now we have DOCS=" README HISTORY CHANGELOG".
48
49 | [[ -f ${docfile} ]] && einstalldocs "${DOCS[@]}"
50
51 7. CHANGELOG exists, so einstalldocs is called to install all *three*
52 files. It fails because HISTORY that got appended before doesn't exist.
53
54
55 That's one possible scenario. I'm pretty sure you didn't want
56 einstalldocs here, or needed a special EAPI 6 branch. dodoc still works
57 as usual.
58
59 --
60 Best regards,
61 Michał Górny
62 <http://dev.gentoo.org/~mgorny/>

Replies

Subject Author
Re: [gentoo-dev] eclass/vdr-plugin-2.eclass EAPI=6 changes, plz review Joerg Bornkessel <hd_brummy@g.o>