[oe-commits] org.oe.dev base.bbclass: Fix SRC_URI_OVERRIDES_PACKAGE_ARCH whilst trying not to cause too much of a performance hit

rpurdie commit openembedded-commits at lists.openembedded.org
Sat Aug 11 17:48:25 UTC 2007


base.bbclass: Fix SRC_URI_OVERRIDES_PACKAGE_ARCH whilst trying not to cause too much of a performance hit

Author: rpurdie at openembedded.org
Branch: org.openembedded.dev
Revision: 8a9ab618f4fb563bfa088670c3dfd8b3c465c622
ViewMTN: http://monotone.openembedded.org/revision.psp?id=8a9ab618f4fb563bfa088670c3dfd8b3c465c622
Files:
1
classes/base.bbclass
Diffs:

#
# mt diff -r61f4aef737f2bae835433e55c5dd7f01c7f57f04 -r8a9ab618f4fb563bfa088670c3dfd8b3c465c622
#
# 
# 
# patch "classes/base.bbclass"
#  from [1fa503b3ccef56a6f8b086ebe3645e7d155c31d3]
#    to [5fb012c81131f41fbf0fed66976513d338e42b56]
# 
============================================================
--- classes/base.bbclass	1fa503b3ccef56a6f8b086ebe3645e7d155c31d3
+++ classes/base.bbclass	5fb012c81131f41fbf0fed66976513d338e42b56
@@ -846,20 +846,26 @@ def base_after_parse(d):
     if (old_arch == mach_arch):
         # Nothing to do
         return
+
+    #
+    # We always try to scan SRC_URI for urls with machine overrides
+    # unless the package sets SRC_URI_OVERRIDES_PACKAGE_ARCH=0
+    #
     override = bb.data.getVar('SRC_URI_OVERRIDES_PACKAGE_ARCH', d, 1)
-	
-    if not override or override == '0':
+    if override == '0':
         return
 
     paths = []
-    for p in [ "${FILE_DIRNAME}/${PF}", "${FILE_DIRNAME}/${P}", "${FILE_DIRNAME}/${PN}", "${FILE_DIRNAME}/files", "${FILE_DIRNAME}" ]:
-        paths.append(bb.data.expand(os.path.join(p, mach_arch), d))
+    for p in [ "${PF}", "${P}", "${PN}", "files", "" ]:
+        paths.append(bb.data.expand(os.path.join("${FILE_DIRNAME}", p, "${MACHINE}"), d))
     for s in bb.data.getVar('SRC_URI', d, 1).split():
+        if not s.startswith("file://"):
+            continue
         local = bb.data.expand(bb.fetch.localpath(s, d), d)
         for mp in paths:
             if local.startswith(mp):
                 #bb.note("overriding PACKAGE_ARCH from %s to %s" % (old_arch, mach_arch))
-                bb.data.setVar('PACKAGE_ARCH', mach_arch, d)
+                bb.data.setVar('PACKAGE_ARCH', "${MACHINE_ARCH}", d)
                 return
 
 #






More information about the Openembedded-commits mailing list