Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 614746

Summary: app-portage/gentoolkit*: ekeyword fails on KEYWORDS inside bash if ... then ... else ... fi statement
Product: Gentoo Linux Reporter: Michael Weber (RETIRED) <xmw>
Component: Current packagesAssignee: Portage Tools Team <tools-portage>
Status: CONFIRMED ---    
Severity: normal CC: ago, vapier
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=399061
Whiteboard:
Package list:
Runtime testing required: ---

Description Michael Weber (RETIRED) gentoo-dev 2017-04-05 11:22:38 UTC
ekeyword does not understand if nor evaluate ${PV}, so
problematic syntax (i.e. x11-wm/openbox/openbox-3.6.ebuild)

if [[ ${PV} == *9999* ]]; then
        KEYWORDS=""
else
        KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~mips ~ppc ~ppc64 ~sparc ~x86 fi

edited with 

#ekeyword arm64 x11-wm/openbox/openbox-3.6.ebuild
openbox-3.6: <green>arm64</green>
openbox-3.6: ~alpha ~amd64 ~arm <red>~</red>arm64 ~hppa ~mips ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~arm-linux ~x86-linux

results in

diff --git a/x11-wm/openbox/openbox-3.6.ebuild b/x11-wm/openbox/openbox-3.6.ebuild
index 1311371aa8..a0ac268dab 100644
--- a/x11-wm/openbox/openbox-3.6.ebuild
+++ b/x11-wm/openbox/openbox-3.6.ebuild
@@ -13,12 +13,12 @@ if [[ ${PV} == *9999* ]]; then
        EGIT_REPO_URI="git://git.openbox.org/dana/openbox"
        SRC_URI="branding? (
        https://dev.gentoo.org/~hwoarang/distfiles/surreal-gentoo.tar.gz )"
-       KEYWORDS=""
+       KEYWORDS="arm64"    <---- __WRONG__
 
 else
        SRC_URI="http://openbox.org/dist/openbox/${P}.tar.gz
        branding? ( https://dev.gentoo.org/~hwoarang/distfiles/surreal-gentoo.tar.gz )"
-       KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~mips ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~arm-linux ~x86-linux"
+       KEYWORDS="~alpha ~amd64 ~arm arm64 ~hppa ~mips ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~arm-linux ~x86-linux"
 fi
 
 LICENSE="GPL-2"

Real world example: https://cgit.gentoo.org/repo/gentoo.git/commit/net-wireless/spectools/spectools-2016.01.1.ebuild?id=616b02e88cae191fa6d40550fa0632bfd1c7a3d6

My workaround is to drop KEYWORDS="" line (https://cgit.gentoo.org/repo/gentoo.git/commit/net-wireless/spectools/spectools-2016.01.1.ebuild?id=fe2925fac25a4d1df24f0fcb5cd1fbb527b2033c).

I have no idea how to enhance ekeyword to understand this stuff, so I'd suggest removing [useless, unneeded, waste of cpu] empty KEYWORDS="" inside if [[ ${PV} == *9999* ]] structures.