aboutsummaryrefslogtreecommitdiffstats
path: root/classes/utils.bbclass
diff options
context:
space:
mode:
authorChris Larson <chris_larson@mentor.com>2010-08-19 09:53:31 -0700
committerChris Larson <chris_larson@mentor.com>2010-08-20 17:56:07 -0700
commit2b7ea6f52dfa7c6cdbbb426e13efba1b4914e7b9 (patch)
tree6d0a2664ce14ff6b40f106a2888257e91791c85b /classes/utils.bbclass
parente325cc7b38be32e6352f19b4712f96144be3ffe5 (diff)
downloadopenembedded-2b7ea6f52dfa7c6cdbbb426e13efba1b4914e7b9.tar.gz
Fix the package_arch=machine_arch logic to use FILESPATH*
- Use FILESPATHPKG and FILESPATHBASE to locate the machine specific dirs - Use the fetch urldata rather than poking at urls ourselves - Move the logic into utils.bbclass as def'd python functions - Simplify Signed-off-by: Chris Larson <chris_larson@mentor.com>
Diffstat (limited to 'classes/utils.bbclass')
-rw-r--r--classes/utils.bbclass18
1 files changed, 18 insertions, 0 deletions
diff --git a/classes/utils.bbclass b/classes/utils.bbclass
index 7740ea3ac3..4840c4f233 100644
--- a/classes/utils.bbclass
+++ b/classes/utils.bbclass
@@ -38,6 +38,24 @@ def oe_filter(f, str, d):
def oe_filter_out(f, str, d):
return oe.utils.str_filter_out(f, str, d)
+def machine_paths(d):
+ """List any existing machine specific filespath directories"""
+ machine = d.getVar("MACHINE", True)
+ filespathpkg = d.getVar("FILESPATHPKG", True).split(":")
+ for basepath in d.getVar("FILESPATHBASE", True).split(":"):
+ for pkgpath in filespathpkg:
+ machinepath = os.path.join(basepath, pkgpath, machine)
+ if os.path.isdir(machinepath):
+ yield machinepath
+
+def is_machine_specific(d):
+ """Determine whether the current recipe is machine specific"""
+ machinepaths = set(machine_paths(d))
+ urldatadict = bb.fetch.init(d.getVar("SRC_URI", True).split(), d, True)
+ for urldata in (urldata for urldata in urldatadict.itervalues()
+ if urldata.type == "file"):
+ if any(urldata.path.startswith(mp + "/") for mp in machinepaths):
+ return True
def subprocess_setup():
import signal