Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 614746 - app-portage/gentoolkit*: ekeyword fails on KEYWORDS inside bash if ... then ... else ... fi statement
Summary: app-portage/gentoolkit*: ekeyword fails on KEYWORDS inside bash if ... then ....
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: Portage Tools Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-05 11:22 UTC by Michael Weber (RETIRED)
Modified: 2017-04-05 11:28 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.