mirror of
https://git.yoctoproject.org/poky
synced 2026-05-30 00:20:08 +00:00
lib/oe: sync with OE.dev
Most notable change is the move to creating symlinks to patches in the metadata tree rather than copying them. Signed-off-by: Joshua Lock <josh@linux.intel.com>
This commit is contained in:
committed by
Richard Purdie
parent
7b74364120
commit
1fbcd2ca17
@@ -67,3 +67,14 @@ def str_filter(f, str, d):
|
||||
def str_filter_out(f, str, d):
|
||||
from re import match
|
||||
return " ".join(filter(lambda x: not match(f, x, 0), str.split()))
|
||||
|
||||
def param_bool(cfg, field, dflt = None):
|
||||
"""Lookup <field> in <cfg> map and convert it to a boolean; take
|
||||
<dflt> when this <field> does not exist"""
|
||||
value = cfg.get(field, dflt)
|
||||
strvalue = str(value).lower()
|
||||
if strvalue in ('yes', 'y', 'true', 't', '1'):
|
||||
return True
|
||||
elif strvalue in ('no', 'n', 'false', 'f', '0'):
|
||||
return False
|
||||
raise ValueError("invalid value for boolean parameter '%s': '%s'" % (field, value))
|
||||
|
||||
Reference in New Issue
Block a user