1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-30 00:20:08 +00:00

Update classes to use lib/oe

Adapt modifications from upstream to make Poky classes use lib/oe for the
common Python functionality.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
This commit is contained in:
Joshua Lock
2010-05-05 16:17:07 +01:00
parent ac023d775b
commit e7fa3529f3
4 changed files with 74 additions and 605 deletions
+26
View File
@@ -8,6 +8,32 @@ inherit utils
inherit utility-tasks
inherit metadata_scm
python sys_path_eh () {
if isinstance(e, bb.event.ConfigParsed):
import sys
import os
import time
bbpath = e.data.getVar("BBPATH", True).split(":")
sys.path[0:0] = [os.path.join(dir, "lib") for dir in bbpath]
def inject(name, value):
"""Make a python object accessible from everywhere for the metadata"""
if hasattr(bb.utils, "_context"):
bb.utils._context[name] = value
else:
__builtins__[name] = value
import oe.path
import oe.utils
inject("bb", bb)
inject("sys", sys)
inject("time", time)
inject("oe", oe)
}
addhandler sys_path_eh
die() {
oefatal "$*"
}