base.bbclass: Optimise get_subpkgedata_fn() to minimise expand calls
authorRichard Purdie <rpurdie@rpsys.net>
Sat, 23 Feb 2008 23:40:47 +0000 (23:40 +0000)
committerRichard Purdie <rpurdie@rpsys.net>
Sat, 23 Feb 2008 23:40:47 +0000 (23:40 +0000)
classes/base.bbclass

index f38a5b7..2f74104 100644 (file)
@@ -777,8 +777,10 @@ def get_subpkgedata_fn(pkg, d):
        import bb, os
        archs = bb.data.expand("${PACKAGE_ARCHS}", d).split(" ")
        archs.reverse()
+       pkgdata = bb.data.expand('${STAGING_DIR}/pkgdata/', d)
+       targetdir = bb.data.expand('${TARGET_VENDOR}-${TARGET_OS}/runtime/', d)
        for arch in archs:
-               fn = bb.data.expand('${STAGING_DIR}/pkgdata/' + arch + '${TARGET_VENDOR}-${TARGET_OS}/runtime/%s' % pkg, d)
+               fn = pkgdata + arch + targetdir + pkg
                if os.path.exists(fn):
                        return fn
        return bb.data.expand('${PKGDATA_DIR}/runtime/%s' % pkg, d)