Openembedded Devel Discussions
 help / color / mirror / Atom feed
From: Chris Larson <clarson@kergoth.com>
To: openembedded-devel@lists.openembedded.org
Cc: Chris Larson <chris_larson@mentor.com>
Subject: [PATCH 4/4] bitbake.conf: Drop some unnecessary getVar usage in python snippets
Date: Thu, 27 May 2010 14:16:28 -0700	[thread overview]
Message-ID: <1274994988-5750-4-git-send-email-clarson@kergoth.com> (raw)
In-Reply-To: <1274994988-5750-1-git-send-email-clarson@kergoth.com>

From: Chris Larson <chris_larson@mentor.com>

Signed-off-by: Chris Larson <chris_larson@mentor.com>

diff --git a/conf/bitbake.conf b/conf/bitbake.conf
index 1980f43..397dbc2 100644
--- a/conf/bitbake.conf
+++ b/conf/bitbake.conf
@@ -128,7 +128,8 @@ EXEEXT = "${HOST_EXEEXT}"
 BASE_PACKAGE_ARCH = "${HOST_ARCH}"
 PACKAGE_ARCH = "${BASE_PACKAGE_ARCH}"
 PACKAGE_EXTRA_ARCHS ?= ""
-MACHINE_ARCH = "${@[bb.data.getVar('BASE_PACKAGE_ARCH', d, 1), bb.data.getVar('MACHINE', d, 1)][bool(bb.data.getVar('MACHINE', d, 1))]}"
+MACHINE_ARCH = "${@oe.utils.ifelse(bool(d.getVar('MACHINE', True)), '${MACHINE}', \
+                                   'BASE_PACKAGE_ARCH')}"
 PACKAGE_ARCHS = "all any noarch ${TARGET_ARCH} ${PACKAGE_EXTRA_ARCHS} ${MACHINE}"
 
 MULTIMACH_ARCH = "${PACKAGE_ARCH}"
@@ -174,9 +175,9 @@ ASSUME_PROVIDED = "\
 ##################################################################
 # Package default variables.
 ##################################################################
-PN = "${@bb.parse.BBHandler.vars_from_file(bb.data.getVar('FILE',d),d)[0] or 'defaultpkgname'}"
-PV = "${@bb.parse.BBHandler.vars_from_file(bb.data.getVar('FILE',d),d)[1] or '1.0'}"
-PR = "${@bb.parse.BBHandler.vars_from_file(bb.data.getVar('FILE',d),d)[2] or 'r0'}"
+PN = "${@bb.parse.BBHandler.vars_from_file('${FILE}', d)[0] or 'defaultpkgname'}"
+PV = "${@bb.parse.BBHandler.vars_from_file('${FILE}', d)[1] or '1.0'}"
+PR = "${@bb.parse.BBHandler.vars_from_file('${FILE}', d)[2] or 'r0'}"
 PF = "${PN}-${EXTENDPE}${PV}-${PR}"
 PE ?= "0"
 EXTENDPE = "${@int('${PE}') and '${PE}_' or ''}"
@@ -192,7 +193,7 @@ MACHINE_KERNEL_PR = ""
 # Automatically derives "foo" from "foo-native", "foo-cross" or "foo-initial"
 # otherwise it is the same as PN and P
 SPECIAL_PKGSUFFIX = "-native -cross -initial -intermediate -nativesdk -crosssdk -cross-canadian -sdk"
-BPN = "${@base_prune_suffix(bb.data.getVar('PN', d, True), bb.data.getVar('SPECIAL_PKGSUFFIX', d, True).split(), d)}"
+BPN = "${@base_prune_suffix('${PN}', '${SPECIAL_PKGSUFFIX}'.split(), d)}"
 BP = "${BPN}-${PV}"
 
 # Package info.
-- 
1.7.0.4




      parent reply	other threads:[~2010-05-27 21:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-27 21:16 [PATCH 1/4] bitbake.conf: use := for BUILD_OS and BUILD_ARCH Chris Larson
2010-05-27 21:16 ` [PATCH 2/4] bitbake.conf: don't filter out nonexisting paths from FILESPATH Chris Larson
2010-05-27 21:16 ` [PATCH 3/4] bitbake.conf: make the EXTENDPE bits slightly less disturbing Chris Larson
2010-05-27 21:16 ` Chris Larson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1274994988-5750-4-git-send-email-clarson@kergoth.com \
    --to=clarson@kergoth.com \
    --cc=chris_larson@mentor.com \
    --cc=openembedded-devel@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox