diff options
Diffstat (limited to 'bitbake-dev/lib/bb')
-rw-r--r-- | bitbake-dev/lib/bb/data_smart.py | 11 | ||||
-rw-r--r-- | bitbake-dev/lib/bb/parse/parse_py/BBHandler.py | 3 | ||||
-rw-r--r-- | bitbake-dev/lib/bb/providers.py | 14 | ||||
-rw-r--r-- | bitbake-dev/lib/bb/server/xmlrpc.py | 6 | ||||
-rw-r--r-- | bitbake-dev/lib/bb/taskdata.py | 2 | ||||
-rw-r--r-- | bitbake-dev/lib/bb/utils.py | 2 |
6 files changed, 29 insertions, 9 deletions
diff --git a/bitbake-dev/lib/bb/data_smart.py b/bitbake-dev/lib/bb/data_smart.py index c93aea7fef..988d5c3578 100644 --- a/bitbake-dev/lib/bb/data_smart.py +++ b/bitbake-dev/lib/bb/data_smart.py @@ -171,14 +171,15 @@ class DataSmart: Rename the variable key to newkey """ val = self.getVar(key, 0) - if val is None: - return - - self.setVar(newkey, val) + if val is not None: + self.setVar(newkey, val) for i in ('_append', '_prepend'): + src = self.getVarFlag(key, i) + if src is None: + continue + dest = self.getVarFlag(newkey, i) or [] - src = self.getVarFlag(key, i) or [] dest.extend(src) self.setVarFlag(newkey, i, dest) diff --git a/bitbake-dev/lib/bb/parse/parse_py/BBHandler.py b/bitbake-dev/lib/bb/parse/parse_py/BBHandler.py index f34599136c..9b353634ed 100644 --- a/bitbake-dev/lib/bb/parse/parse_py/BBHandler.py +++ b/bitbake-dev/lib/bb/parse/parse_py/BBHandler.py @@ -329,7 +329,8 @@ def feeder(lineno, s, fn, root, d): after = m.group("after") if func is None: return - var = "do_" + func + if func[:3] != "do_": + var = "do_" + func data.setVarFlag(var, "task", 1, d) diff --git a/bitbake-dev/lib/bb/providers.py b/bitbake-dev/lib/bb/providers.py index 6c1cf78eb3..8617251ca3 100644 --- a/bitbake-dev/lib/bb/providers.py +++ b/bitbake-dev/lib/bb/providers.py @@ -63,6 +63,18 @@ def sortPriorities(pn, dataCache, pkg_pn = None): return tmp_pn +def preferredVersionMatch(pe, pv, pr, preferred_e, preferred_v, preferred_r): + """ + Check if the version pe,pv,pr is the preferred one. + If there is preferred version defined and ends with '%', then pv has to start with that version after removing the '%' + """ + if (pr == preferred_r or preferred_r == None): + if (pe == preferred_e or preferred_e == None): + if preferred_v == pv: + return True + if preferred_v != None and preferred_v.endswith('%') and pv.startswith(preferred_v[:len(preferred_v)-1]): + return True + return False def findPreferredProvider(pn, cfgData, dataCache, pkg_pn = None, item = None): """ @@ -96,7 +108,7 @@ def findPreferredProvider(pn, cfgData, dataCache, pkg_pn = None, item = None): for file_set in pkg_pn: for f in file_set: pe,pv,pr = dataCache.pkg_pepvpr[f] - if preferred_v == pv and (preferred_r == pr or preferred_r == None) and (preferred_e == pe or preferred_e == None): + if preferredVersionMatch(pe, pv, pr, preferred_e, preferred_v, preferred_r): preferred_file = f preferred_ver = (pe, pv, pr) break diff --git a/bitbake-dev/lib/bb/server/xmlrpc.py b/bitbake-dev/lib/bb/server/xmlrpc.py index b4d69f7be3..3364918c77 100644 --- a/bitbake-dev/lib/bb/server/xmlrpc.py +++ b/bitbake-dev/lib/bb/server/xmlrpc.py @@ -32,7 +32,7 @@ """ import bb -import xmlrpclib +import xmlrpclib, sys from bb import daemonize from bb.ui import uievent @@ -41,6 +41,10 @@ DEBUG = False from SimpleXMLRPCServer import SimpleXMLRPCServer, SimpleXMLRPCRequestHandler import inspect, select +if sys.hexversion < 0x020600F0: + print "Sorry, python 2.6 or later is required for bitbake's XMLRPC mode" + sys.exit(1) + class BitBakeServerCommands(): def __init__(self, server, cooker): self.cooker = cooker diff --git a/bitbake-dev/lib/bb/taskdata.py b/bitbake-dev/lib/bb/taskdata.py index e3a60b9884..4a88e75f6d 100644 --- a/bitbake-dev/lib/bb/taskdata.py +++ b/bitbake-dev/lib/bb/taskdata.py @@ -173,6 +173,8 @@ class TaskData: ids = [] for dep in task_deps['depends'][task].split(): if dep: + if ":" not in dep: + bb.msg.fatal(bb.msg.domain.TaskData, "Error, dependency %s does not contain ':' character\n. Task 'depends' should be specified in the form 'packagename:task'" % (depend, fn)) ids.append(((self.getbuild_id(dep.split(":")[0])), dep.split(":")[1])) self.tasks_idepends[taskid].extend(ids) diff --git a/bitbake-dev/lib/bb/utils.py b/bitbake-dev/lib/bb/utils.py index 5b0aaba4a7..5fc1463e67 100644 --- a/bitbake-dev/lib/bb/utils.py +++ b/bitbake-dev/lib/bb/utils.py @@ -389,7 +389,7 @@ def clean_environment(): def empty_environment(): """ - Remove all variable from the environment. + Remove all variables from the environment. """ for s in os.environ.keys(): os.unsetenv(s) |