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

git at git.openembedded.org git at git.openembedded.org
Tue Feb 5 21:38:18 UTC 2013


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

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 58b2dda..b055a14 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -1803,6 +1803,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