package.bbclass: Pre-expand some variables to save time

(From OE-Core rev: fc5bff0145d8f5db1c09be61f5de209ac4016ed1)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie
2013-02-03 17:59:03 +00:00
parent 78955b837c
commit 5b7c822609

View File

@@ -1802,6 +1802,20 @@ python do_package () {
bb.error("WORKDIR, DEPLOY_DIR, D, PN and PKGD all must be defined, unable to package")
return
###########################################################################
# Optimisations
###########################################################################
# Contunually rexpanding complex expressions is inefficient, particularly when
# we write to the datastore and invalidate the expansion cache. This code
# pre-expands some frequently used variables
def expandVar(x, d):
d.setVar(x, d.getVar(x, True))
for x in 'PN', 'PV', 'BPN', 'TARGET_SYS', 'EXTENDPRAUTO':
expandVar(x, d)
###########################################################################
# Setup PKGD (from D)
###########################################################################