diff options
| author | Joshua Lock <josh@linux.intel.com> | 2010-08-03 18:18:03 +0100 |
|---|---|---|
| committer | Richard Purdie <rpurdie@linux.intel.com> | 2010-08-04 11:43:12 +0100 |
| commit | 1fbcd2ca178db28747046b5bd943c81176db9f65 (patch) | |
| tree | 18b476a4260e5970da74cc4d60ee51a010ee870c /meta/lib/oe/utils.py | |
| parent | 7b743641209492476329b88dcb213fbbd1780a9f (diff) | |
| download | poky-1fbcd2ca178db28747046b5bd943c81176db9f65.tar.gz | |
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>
Diffstat (limited to 'meta/lib/oe/utils.py')
| -rw-r--r-- | meta/lib/oe/utils.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py index e61d663a50..3469700726 100644 --- a/meta/lib/oe/utils.py +++ b/meta/lib/oe/utils.py | |||
| @@ -67,3 +67,14 @@ def str_filter(f, str, d): | |||
| 67 | def str_filter_out(f, str, d): | 67 | def str_filter_out(f, str, d): |
| 68 | from re import match | 68 | from re import match |
| 69 | return " ".join(filter(lambda x: not match(f, x, 0), str.split())) | 69 | return " ".join(filter(lambda x: not match(f, x, 0), str.split())) |
| 70 | |||
| 71 | def param_bool(cfg, field, dflt = None): | ||
| 72 | """Lookup <field> in <cfg> map and convert it to a boolean; take | ||
| 73 | <dflt> when this <field> does not exist""" | ||
| 74 | value = cfg.get(field, dflt) | ||
| 75 | strvalue = str(value).lower() | ||
| 76 | if strvalue in ('yes', 'y', 'true', 't', '1'): | ||
| 77 | return True | ||
| 78 | elif strvalue in ('no', 'n', 'false', 'f', '0'): | ||
| 79 | return False | ||
| 80 | raise ValueError("invalid value for boolean parameter '%s': '%s'" % (field, value)) | ||
