]> code.ossystems Code Review - openembedded-core.git/commitdiff
bitbake.conf: Use immediate expansion for os.uname()
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 26 May 2015 10:42:26 +0000 (11:42 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 26 May 2015 12:06:05 +0000 (13:06 +0100)
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@linuxfoundation.org>
meta/conf/bitbake.conf

index 9c72044d8d6a546f3bcc5b58fb5f955d447184d5..2b86442b1d9e4c2729920249e3b5c3cecad2df16 100644 (file)
@@ -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 = ""