[oe-commits] Richard Purdie : package.bbclass: Pre-expand some variables to save time

git at git.openembedded.org git at git.openembedded.org
Mon Feb 4 12:43:26 UTC 2013


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

Author: Richard Purdie <richard.purdie at linuxfoundation.org>
Date:   Sun Feb  3 17:59:03 2013 +0000

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

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

---

 meta/classes/package.bbclass |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 7e9eecc..9916c2c 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -1801,6 +1801,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)
     ###########################################################################
 





More information about the Openembedded-commits mailing list