[oe-commits] Richard Purdie : bitbake.conf: Use immediate expansion for os.uname()

git at git.openembedded.org git at git.openembedded.org
Tue May 26 12:06:29 UTC 2015


Module: openembedded-core.git
Branch: master-next
Commit: 03482382b797f3501c3fb0df0fe12bd4e5e51a39
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=03482382b797f3501c3fb0df0fe12bd4e5e51a39

Author: Richard Purdie <richard.purdie at linuxfoundation.org>
Date:   Tue May 26 11:42:26 2015 +0100

bitbake.conf: Use immediate expansion for os.uname()

Use immediate expansion for BUILD_ARCH and BUILD_OS since there is no
point in repeatedly calling os.uname() throughout parsing. This is
worth around 2% of parsing time, small but measurable.

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

---

 meta/conf/bitbake.conf | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index 9c72044..2b86442 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -81,8 +81,10 @@ ROOT_HOME ??= "/home/root"
 # Architecture-dependent build variables.
 ##################################################################
 
-BUILD_ARCH = "${@os.uname()[4]}"
-BUILD_OS = "${@os.uname()[0].lower()}"
+# Immediate expansion since there is no point in reapeatedly calling
+# os.uname() throughout parsing
+BUILD_ARCH := "${@os.uname()[4]}"
+BUILD_OS := "${@os.uname()[0].lower()}"
 BUILD_VENDOR = ""
 BUILD_SYS = "${BUILD_ARCH}${BUILD_VENDOR}-${BUILD_OS}"
 BUILD_PREFIX = ""



More information about the Openembedded-commits mailing list