]> code.ossystems Code Review - openembedded-core.git/commitdiff
package.bbclass: Pre-expand some variables to save time
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 3 Feb 2013 17:59:03 +0000 (17:59 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 6 Feb 2013 13:12:19 +0000 (13:12 +0000)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/package.bbclass

index 7c79c69287fd9afec68116cb23f5b406c686414f..e5d444b161d664c07d2b8a07234ecd1388187145 100644 (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)
     ###########################################################################