summaryrefslogtreecommitdiffstats
path: root/bitbake/bin
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2013-06-04 11:54:23 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-06-04 11:54:23 +0100
commit697f74988a50a992c25853272aaf0963b2b3cf28 (patch)
treeab82238a55d50895b7c67d10de54574d19f89fc1 /bitbake/bin
parent158d9d82e0880aca33bfd3312376835ff75735c1 (diff)
downloadpoky-697f74988a50a992c25853272aaf0963b2b3cf28.tar.gz
bitbake: Drop bitbake-runtask (removed upstream a while ago)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/bin')
-rwxr-xr-xbitbake/bin/bitbake-runtask119
1 files changed, 0 insertions, 119 deletions
diff --git a/bitbake/bin/bitbake-runtask b/bitbake/bin/bitbake-runtask
deleted file mode 100755
index 6a0ecdc555..0000000000
--- a/bitbake/bin/bitbake-runtask
+++ /dev/null
@@ -1,119 +0,0 @@
1#!/usr/bin/env python
2
3import os
4import sys
5import warnings
6sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(sys.argv[0])), 'lib'))
7from bb import fetch2
8import logging
9
10logger = logging.getLogger("BitBake")
11
12try:
13 import cPickle as pickle
14except ImportError:
15 import pickle
16 bb.msg.note(1, bb.msg.domain.Cache, "Importing cPickle failed. Falling back to a very slow implementation.")
17
18class BBConfiguration(object):
19 """
20 Manages build options and configurations for one run
21 """
22
23 def __init__(self, **options):
24 self.data = {}
25 self.file = []
26 self.cmd = None
27 self.dump_signatures = True
28 self.prefile = []
29 self.postfile = []
30 self.parse_only = True
31
32 def __getattr__(self, attribute):
33 try:
34 return super(BBConfiguration, self).__getattribute__(attribute)
35 except AttributeError:
36 return None
37
38_warnings_showwarning = warnings.showwarning
39def _showwarning(message, category, filename, lineno, file=None, line=None):
40 """Display python warning messages using bb.msg"""
41 if file is not None:
42 if _warnings_showwarning is not None:
43 _warnings_showwarning(message, category, filename, lineno, file, line)
44 else:
45 s = warnings.formatwarning(message, category, filename, lineno)
46 s = s.split("\n")[0]
47 bb.msg.warn(None, s)
48
49warnings.showwarning = _showwarning
50warnings.simplefilter("ignore", DeprecationWarning)
51
52import bb.event
53import bb.cooker
54
55buildfile = sys.argv[1]
56taskname = sys.argv[2]
57if len(sys.argv) >= 4:
58 dryrun = sys.argv[3]
59else:
60 dryrun = False
61if len(sys.argv) >= 5:
62 hashfile = sys.argv[4]
63 p = pickle.Unpickler(file(hashfile, "rb"))
64 hashdata = p.load()
65else:
66 hashdata = None
67
68handler = bb.event.LogHandler()
69logger.addHandler(handler)
70
71#An example to make debug log messages show up
72#bb.msg.init_msgconfig(True, 3, [])
73
74console = logging.StreamHandler(sys.stdout)
75format = bb.msg.BBLogFormatter("%(levelname)s: %(message)s")
76bb.msg.addDefaultlogFilter(console)
77console.setFormatter(format)
78
79def worker_fire(event, d):
80 if isinstance(event, logging.LogRecord):
81 console.handle(event)
82bb.event.worker_fire = worker_fire
83bb.event.worker_pid = os.getpid()
84
85initialenv = os.environ.copy()
86config = BBConfiguration()
87
88def register_idle_function(self, function, data):
89 pass
90
91cooker = bb.cooker.BBCooker(config, register_idle_function, initialenv)
92config_data = cooker.configuration.data
93cooker.status = config_data
94cooker.handleCollections(config_data.getVar("BBFILE_COLLECTIONS", 1))
95
96fn, cls = bb.cache.Cache.virtualfn2realfn(buildfile)
97buildfile = cooker.matchFile(fn)
98fn = bb.cache.Cache.realfn2virtual(buildfile, cls)
99
100cooker.buildSetVars()
101
102# Load data into the cache for fn and parse the loaded cache data
103the_data = bb.cache.Cache.loadDataFull(fn, cooker.get_file_appends(fn), cooker.configuration.data)
104
105if taskname.endswith("_setscene"):
106 the_data.setVarFlag(taskname, "quieterrors", "1")
107
108if hashdata:
109 bb.parse.siggen.set_taskdata(hashdata["hashes"], hashdata["deps"])
110 for h in hashdata["hashes"]:
111 the_data.setVar("BBHASH_%s" % h, hashdata["hashes"][h])
112 for h in hashdata["deps"]:
113 the_data.setVar("BBHASHDEPS_%s" % h, hashdata["deps"][h])
114
115ret = 0
116if dryrun != "True":
117 ret = bb.build.exec_task(fn, taskname, the_data)
118sys.exit(ret)
119