As seen in: https://bugs.gentoo.org/show_bug.cgi?id=444740#c2 Looks like: # TODO: wrong "declare -a" command... elif declare -p DOCS | grep -q `^declare -a` ; then should use " instead of `: http://devmanual.gentoo.org/ebuild-writing/eapi/index.html Reproducible: Always
Hmm I am not sure what you're suggesting here. Could you elaborate a bit more please?
Well, for installing docs I copied exact snipped from: http://devmanual.gentoo.org/ebuild-writing/eapi/index.html in gnome2.eclass: http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/eclass/gnome2.eclass?r1=1.111&r2=1.112&view=patch But, later, the following bug was reported: https://bugs.gentoo.org/show_bug.cgi?id=444740 That was solved by: http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/eclass/gnome2.eclass?r1=1.112&r2=1.113&view=patch And, after that, Arfrever reported another problem: https://bugs.gentoo.org/show_bug.cgi?id=444740#c4 that was solved with: http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/eclass/gnome2.eclass?r1=1.113&r2=1.114&view=patch In summary, looks like "`" should be replaced by "'"
in other words: single quotes instead of backticks
Also there needs to be a blank after the -a, i.e.: grep -q ’^declare -a ’ That how PMS defines it, (see <http://dev.gentoo.org/~ulm/pms/5/pms.html#x1-1030009.1.9>) and how it's implemented in Portage. (In reply to comment #2) > And, after that, Arfrever reported another problem: > https://bugs.gentoo.org/show_bug.cgi?id=444740#c4 > > that was solved with: > http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/eclass/gnome2.eclass?r1=1.113&r2=1.114&view=patch Hm, that makes the behaviour different from the EAPI 4 default. Is this intentional?
(In reply to comment #4) > that makes the behaviour different from the EAPI 4 default. Is this > intentional? PMS clearly has a bug. It should be retroactively fixed.
(In reply to comment #5) > (In reply to comment #4) > > that makes the behaviour different from the EAPI 4 default. Is this > > intentional? > > PMS clearly has a bug. That's not so clear. Exporting arrays doesn't work, so why should an ebuild do this, in the first place? I'd say that any such code is buggy and should be fixed. > It should be retroactively fixed. If it's a bug in PMS (which I doubt) then we can fix it in EAPI 6.
(In reply to comment #6) Other attributes can be set. Example 1: $ readonly DOCS=(a b c) $ declare -p DOCS declare -ar DOCS='([0]="a" [1]="b" [2]="c")' Example 2: $ declare -al DOCS $ DOCS=(A B C) $ declare -p DOCS declare -al DOCS='([0]="a" [1]="b" [2]="c")'
(In reply to comment #7) > Other attributes can be set. > > Example 1: > > $ readonly DOCS=(a b c) > $ declare -p DOCS > declare -ar DOCS='([0]="a" [1]="b" [2]="c")' > > Example 2: > > $ declare -al DOCS > $ DOCS=(A B C) > $ declare -p DOCS > declare -al DOCS='([0]="a" [1]="b" [2]="c")' That's not allowed in ebuilds, because bash 3.2 didn't support it.
Per previous comments looks like gnome team needs to be aware of this
(In reply to comment #9) > Per previous comments looks like gnome team needs to be aware of this What's left to be done here?
(In reply to comment #10) > What's left to be done here? PMS was updated to use double quotes for better readability: <http://git.overlays.gentoo.org/gitweb/?p=proj/pms.git;a=commit;h=6cc58a14e8f8d9d7b98bc58c115cd58c2d898544> I'd say that the devmanual should follow, i.e. in both ebuild-writing/eapi/text.xml and ebuild-writing/functions/src_install/text.xml: - # TODO: wrong "declare -a" command... - elif declare -p DOCS | grep -q `^declare -a` ; then + elif declare -p DOCS | grep -q "^declare -a " ; then
(In reply to comment #11) > (In reply to comment #10) > > What's left to be done here? > > PMS was updated to use double quotes for better readability: > <http://git.overlays.gentoo.org/gitweb/?p=proj/pms.git;a=commit; > h=6cc58a14e8f8d9d7b98bc58c115cd58c2d898544> > > I'd say that the devmanual should follow, i.e. in both > ebuild-writing/eapi/text.xml and > ebuild-writing/functions/src_install/text.xml: > > - # TODO: wrong "declare -a" command... > - elif declare -p DOCS | grep -q `^declare -a` ; then > + elif declare -p DOCS | grep -q "^declare -a " ; then Thanks done http://git.overlays.gentoo.org/gitweb/?p=proj/devmanual.git;a=commit;h=078b93a501f114fc62d243460dd3235dfaa1f741
(In reply to comment #12) > (In reply to comment #11) > > (In reply to comment #10) > > > What's left to be done here? > > > > PMS was updated to use double quotes for better readability: > > <http://git.overlays.gentoo.org/gitweb/?p=proj/pms.git;a=commit; > > h=6cc58a14e8f8d9d7b98bc58c115cd58c2d898544> > > > > I'd say that the devmanual should follow, i.e. in both > > ebuild-writing/eapi/text.xml and > > ebuild-writing/functions/src_install/text.xml: > > > > - # TODO: wrong "declare -a" command... > > - elif declare -p DOCS | grep -q `^declare -a` ; then > > + elif declare -p DOCS | grep -q "^declare -a " ; then > > Thanks > > done > > http://git.overlays.gentoo.org/gitweb/?p=proj/devmanual.git;a=commit; > h=078b93a501f114fc62d243460dd3235dfaa1f741 And this http://git.overlays.gentoo.org/gitweb/?p=proj/devmanual.git;a=commit;h=5ea62b9c5ea777279301f799f08670634fd6c3cf fixes the comment that I forgot to remove
(In reply to comment #12) > > - # TODO: wrong "declare -a" command... > > - elif declare -p DOCS | grep -q `^declare -a` ; then > > + elif declare -p DOCS | grep -q "^declare -a " ; then > > Thanks > > done > > http://git.overlays.gentoo.org/gitweb/?p=proj/devmanual.git;a=commit; > h=078b93a501f114fc62d243460dd3235dfaa1f741 Still doesn't match PMS. Note the blank after the -a.
(In reply to comment #14) > (In reply to comment #12) > > > - # TODO: wrong "declare -a" command... > > > - elif declare -p DOCS | grep -q `^declare -a` ; then > > > + elif declare -p DOCS | grep -q "^declare -a " ; then > > > > Thanks > > > > done > > > > http://git.overlays.gentoo.org/gitweb/?p=proj/devmanual.git;a=commit; > > h=078b93a501f114fc62d243460dd3235dfaa1f741 > > Still doesn't match PMS. Note the blank after the -a. Hopefully fixed now