From patchwork Sun Feb 3 23:55:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [21/22] package.bbclass: Pre-expand some variables to save time Date: Sun, 03 Feb 2013 23:55:51 -0000 From: Richard Purdie X-Patchwork-Id: 43909 Message-Id: To: openembedded-core@lists.openembedded.org Signed-off-by: Richard Purdie --- meta/classes/package.bbclass | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass index 2c3f173..2bae65b 100644 --- a/meta/classes/package.bbclass +++ b/meta/classes/package.bbclass @@ -1798,6 +1798,20 @@ python do_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) ###########################################################################