Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] bitbake.conf: Remove horrible variable expansion hacks
@ 2016-01-22 12:03 Richard Purdie
  0 siblings, 0 replies; only message in thread
From: Richard Purdie @ 2016-01-22 12:03 UTC (permalink / raw)
  To: openembedded-core

We used to need these hacks to make things work. Rework the variables to 
remove the horrible hacks and make things slightly less ugly. This does
mean PE and PRAUTO are given default empty values but this is preferred
to the other ugliness.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index fba4d17..7451eb8 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -189,17 +189,19 @@ ASSUME_PROVIDED = "\
 PN = "${@bb.parse.BBHandler.vars_from_file(d.getVar('FILE', False),d)[0] or 'defaultpkgname'}"
 PV = "${@bb.parse.BBHandler.vars_from_file(d.getVar('FILE', False),d)[1] or '1.0'}"
 PR = "${@bb.parse.BBHandler.vars_from_file(d.getVar('FILE', False),d)[2] or 'r0'}"
+PE = ""
 PF = "${PN}-${EXTENDPE}${PV}-${PR}"
-EXTENDPE = "${@['','${PE\x7d_'][int(d.getVar('PE', True) or 0) > 0]}"
+EXTENDPE = "${@['','${PE}_'][int(d.getVar('PE', True) or 0) > 0]}"
 P = "${PN}-${PV}"
 
-EXTENDPRAUTO = "${@['.${PRAUTO\x7d',''][d.getVar('PRAUTO', True) is None]}"
+PRAUTO = ""
+EXTENDPRAUTO = "${@['.${PRAUTO}', ''][not d.getVar('PRAUTO', True)]}"
 PRAUTOINX = "${PF}"
 
 PKGV ?= "${PV}"
 PKGR ?= "${PR}${EXTENDPRAUTO}"
-PKGE ?= "${@['','${PE\x7d'][int(d.getVar('PE', True) or 0) > 0]}"
-EXTENDPKGEVER = "${@['','${PKGE\x7d:'][d.getVar('PKGE', True).strip() != '']}"
+PKGE ?= "${@['','${PE}'][int(d.getVar('PE', True) or 0) > 0]}"
+EXTENDPKGEVER = "${@['','${PKGE}:'][d.getVar('PKGE', True).strip() != '']}"
 EXTENDPKGV ?= "${EXTENDPKGEVER}${PKGV}-${PKGR}"
 
 # Base package name




^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2016-01-22 12:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-22 12:03 [PATCH] bitbake.conf: Remove horrible variable expansion hacks Richard Purdie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox