summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2009-11-03 23:20:15 +0000
committerRichard Purdie <rpurdie@linux.intel.com>2009-11-13 12:15:21 +0000
commit483f85802a97cb9ad4d958c29458db91acc7809f (patch)
treee67948401b16ef7d75cd88857139fd2b00af26df /bitbake/lib/bb
parentc2b5a617285733053f867c3fdda2179a65ccbe4c (diff)
downloadpoky-483f85802a97cb9ad4d958c29458db91acc7809f.tar.gz
bitbake: Sync various functions with those from bitbake-dev and bitbake upstream
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake/lib/bb')
-rw-r--r--bitbake/lib/bb/cache.py2
-rw-r--r--bitbake/lib/bb/cooker.py2
-rw-r--r--bitbake/lib/bb/event.py7
-rw-r--r--bitbake/lib/bb/fetch/__init__.py31
-rw-r--r--bitbake/lib/bb/parse/parse_py/BBHandler.py4
-rw-r--r--bitbake/lib/bb/taskdata.py12
6 files changed, 32 insertions, 26 deletions
diff --git a/bitbake/lib/bb/cache.py b/bitbake/lib/bb/cache.py
index e91967c032..d30d57d33b 100644
--- a/bitbake/lib/bb/cache.py
+++ b/bitbake/lib/bb/cache.py
@@ -273,7 +273,7 @@ class Cache:
273 for f,old_mtime in depends: 273 for f,old_mtime in depends:
274 fmtime = bb.parse.cached_mtime_noerror(f) 274 fmtime = bb.parse.cached_mtime_noerror(f)
275 # Check if file still exists 275 # Check if file still exists
276 if fmtime == 0: 276 if old_mtime != 0 and fmtime == 0:
277 self.remove(fn) 277 self.remove(fn)
278 return False 278 return False
279 279
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index b0692431bb..230afcb4bc 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -71,7 +71,7 @@ class BBCooker:
71 self.configuration.cmd = bb.data.getVar("BB_DEFAULT_TASK", self.configuration.data) or "build" 71 self.configuration.cmd = bb.data.getVar("BB_DEFAULT_TASK", self.configuration.data) or "build"
72 72
73 bbpkgs = bb.data.getVar('BBPKGS', self.configuration.data, True) 73 bbpkgs = bb.data.getVar('BBPKGS', self.configuration.data, True)
74 if bbpkgs: 74 if bbpkgs and len(self.configuration.pkgs_to_build) == 0:
75 self.configuration.pkgs_to_build.extend(bbpkgs.split()) 75 self.configuration.pkgs_to_build.extend(bbpkgs.split())
76 76
77 # 77 #
diff --git a/bitbake/lib/bb/event.py b/bitbake/lib/bb/event.py
index c0a59e6120..9d7341f878 100644
--- a/bitbake/lib/bb/event.py
+++ b/bitbake/lib/bb/event.py
@@ -127,6 +127,13 @@ def getName(e):
127class ConfigParsed(Event): 127class ConfigParsed(Event):
128 """Configuration Parsing Complete""" 128 """Configuration Parsing Complete"""
129 129
130class RecipeParsed(Event):
131 """ Recipe Parsing Complete """
132
133 def __init__(self, fn, d):
134 self.fn = fn
135 Event.__init__(self, d)
136
130class StampUpdate(Event): 137class StampUpdate(Event):
131 """Trigger for any adjustment of the stamp files to happen""" 138 """Trigger for any adjustment of the stamp files to happen"""
132 139
diff --git a/bitbake/lib/bb/fetch/__init__.py b/bitbake/lib/bb/fetch/__init__.py
index 2191c284e3..429822bfa9 100644
--- a/bitbake/lib/bb/fetch/__init__.py
+++ b/bitbake/lib/bb/fetch/__init__.py
@@ -485,21 +485,26 @@ class Fetch(object):
485 if pn: 485 if pn:
486 src_tarball_stash = (data.getVar('SRC_TARBALL_STASH_%s' % pn, d, True) or data.getVar('CVS_TARBALL_STASH_%s' % pn, d, True) or data.getVar('SRC_TARBALL_STASH', d, True) or data.getVar('CVS_TARBALL_STASH', d, True) or "").split() 486 src_tarball_stash = (data.getVar('SRC_TARBALL_STASH_%s' % pn, d, True) or data.getVar('CVS_TARBALL_STASH_%s' % pn, d, True) or data.getVar('SRC_TARBALL_STASH', d, True) or data.getVar('CVS_TARBALL_STASH', d, True) or "").split()
487 487
488 ld = d.createCopy()
488 for stash in src_tarball_stash: 489 for stash in src_tarball_stash:
489 fetchcmd = data.getVar("FETCHCOMMAND_mirror", d, True) or data.getVar("FETCHCOMMAND_wget", d, True) 490 url = stash + tarfn
490 uri = stash + tarfn 491 try:
491 bb.msg.note(1, bb.msg.domain.Fetcher, "fetch " + uri) 492 ud = FetchData(url, ld)
492 fetchcmd = fetchcmd.replace("${URI}", uri) 493 except bb.fetch.NoMethodError:
493 httpproxy = data.getVar("http_proxy", d, True) 494 bb.msg.debug(1, bb.msg.domain.Fetcher, "No method for %s" % url)
494 ftpproxy = data.getVar("ftp_proxy", d, True) 495 continue
495 if httpproxy: 496
496 fetchcmd = "http_proxy=" + httpproxy + " " + fetchcmd 497 ud.setup_localpath(ld)
497 if ftpproxy: 498
498 fetchcmd = "ftp_proxy=" + ftpproxy + " " + fetchcmd 499 try:
499 ret = os.system(fetchcmd) 500 ud.method.go(url, ud, ld)
500 if ret == 0:
501 bb.msg.note(1, bb.msg.domain.Fetcher, "Fetched %s from tarball stash, skipping checkout" % tarfn)
502 return True 501 return True
502 except (bb.fetch.MissingParameterError,
503 bb.fetch.FetchError,
504 bb.fetch.MD5SumError):
505 import sys
506 (type, value, traceback) = sys.exc_info()
507 bb.msg.debug(2, bb.msg.domain.Fetcher, "Tarball stash fetch failure: %s" % value)
503 return False 508 return False
504 try_mirror = staticmethod(try_mirror) 509 try_mirror = staticmethod(try_mirror)
505 510
diff --git a/bitbake/lib/bb/parse/parse_py/BBHandler.py b/bitbake/lib/bb/parse/parse_py/BBHandler.py
index 03976d4d8c..76b917ca5d 100644
--- a/bitbake/lib/bb/parse/parse_py/BBHandler.py
+++ b/bitbake/lib/bb/parse/parse_py/BBHandler.py
@@ -88,7 +88,7 @@ def finalise(fn, d):
88 from bb import build 88 from bb import build
89 try: 89 try:
90 t = data.getVar('T', d) 90 t = data.getVar('T', d)
91 data.setVar('T', '${TMPDIR}/', d) 91 data.setVar('T', '${TMPDIR}/anonfunc/', d)
92 anonfuncs = data.getVar('__BBANONFUNCS', d) or [] 92 anonfuncs = data.getVar('__BBANONFUNCS', d) or []
93 code = "" 93 code = ""
94 for f in anonfuncs: 94 for f in anonfuncs:
@@ -114,6 +114,8 @@ def finalise(fn, d):
114 tasklist = data.getVar('__BBTASKS', d) or [] 114 tasklist = data.getVar('__BBTASKS', d) or []
115 bb.build.add_tasks(tasklist, d) 115 bb.build.add_tasks(tasklist, d)
116 116
117 bb.event.fire(bb.event.RecipeParsed(fn, d))
118
117 119
118def handle(fn, d, include = 0): 120def handle(fn, d, include = 0):
119 global __func_start_regexp__, __inherit_regexp__, __export_func_regexp__, __addtask_regexp__, __addhandler_regexp__, __infunc__, __body__, __residue__ 121 global __func_start_regexp__, __inherit_regexp__, __export_func_regexp__, __addtask_regexp__, __addhandler_regexp__, __infunc__, __body__, __residue__
diff --git a/bitbake/lib/bb/taskdata.py b/bitbake/lib/bb/taskdata.py
index 64ab032c3c..45f6902ddd 100644
--- a/bitbake/lib/bb/taskdata.py
+++ b/bitbake/lib/bb/taskdata.py
@@ -374,11 +374,7 @@ class TaskData:
374 all_p = dataCache.providers[item] 374 all_p = dataCache.providers[item]
375 375
376 eligible, foundUnique = bb.providers.filterProviders(all_p, item, cfgData, dataCache) 376 eligible, foundUnique = bb.providers.filterProviders(all_p, item, cfgData, dataCache)
377 377 eligible = [p for p in eligible if not self.getfn_id(p) in self.failed_fnids]
378 for p in eligible:
379 fnid = self.getfn_id(p)
380 if fnid in self.failed_fnids:
381 eligible.remove(p)
382 378
383 if not eligible: 379 if not eligible:
384 bb.msg.note(2, bb.msg.domain.Provider, "No buildable provider PROVIDES '%s' but '%s' DEPENDS on or otherwise requires it. Enable debugging and see earlier logs to find unbuildable providers." % (item, self.get_dependees_str(item))) 380 bb.msg.note(2, bb.msg.domain.Provider, "No buildable provider PROVIDES '%s' but '%s' DEPENDS on or otherwise requires it. Enable debugging and see earlier logs to find unbuildable providers." % (item, self.get_dependees_str(item)))
@@ -426,11 +422,7 @@ class TaskData:
426 raise bb.providers.NoRProvider(item) 422 raise bb.providers.NoRProvider(item)
427 423
428 eligible, numberPreferred = bb.providers.filterProvidersRunTime(all_p, item, cfgData, dataCache) 424 eligible, numberPreferred = bb.providers.filterProvidersRunTime(all_p, item, cfgData, dataCache)
429 425 eligible = [p for p in eligible if not self.getfn_id(p) in self.failed_fnids]
430 for p in eligible:
431 fnid = self.getfn_id(p)
432 if fnid in self.failed_fnids:
433 eligible.remove(p)
434 426
435 if not eligible: 427 if not eligible:
436 bb.msg.error(bb.msg.domain.Provider, "'%s' RDEPENDS/RRECOMMENDS or otherwise requires the runtime entity '%s' but it wasn't found in any PACKAGE or RPROVIDES variables of any buildable targets.\nEnable debugging and see earlier logs to find unbuildable targets." % (self.get_rdependees_str(item), item)) 428 bb.msg.error(bb.msg.domain.Provider, "'%s' RDEPENDS/RRECOMMENDS or otherwise requires the runtime entity '%s' but it wasn't found in any PACKAGE or RPROVIDES variables of any buildable targets.\nEnable debugging and see earlier logs to find unbuildable targets." % (self.get_rdependees_str(item), item))