diff options
author | Mark Hatle <mark.hatle@windriver.com> | 2011-02-11 11:43:54 -0600 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-02-12 00:30:29 +0000 |
commit | 3faa635fd408695dd5b754fda3f6060dd670b81d (patch) | |
tree | d0ba5d2d4acca9f7748029116f3a74877ee899c9 /bitbake/lib/bb/utils.py | |
parent | e56f63a2843e5a7d70fd60e0aaed4d962a277da7 (diff) | |
download | openembedded-core-contrib-3faa635fd408695dd5b754fda3f6060dd670b81d.tar.gz |
fetch2: unpack revision
Revise the unpack function to have a way to disable the unpack. This is
based on the work from "Andreas Oberritter <obi@opendreambox.org>", see
http://cgit.openembedded.net/cgit.cgi/openembedded/commit/?id=2bdfe8519eda8067845019a699acdf19a21ba380
In addition, the to_boolean function comes from the work of
"Chris Larson <chris_larson@mentor.com>", see
http://cgit.openembedded.net/cgit.cgi/openembedded/commit/?id=900cc29b603691eb3a077cb660545ead3715ed54
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Diffstat (limited to 'bitbake/lib/bb/utils.py')
-rw-r--r-- | bitbake/lib/bb/utils.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py index 0b5aa0d5f7..b2f8bb6f89 100644 --- a/bitbake/lib/bb/utils.py +++ b/bitbake/lib/bb/utils.py @@ -831,3 +831,15 @@ def init_logger(logger, verbose, debug, debug_domains): if debug_domains: bb.msg.set_debug_domains(debug_domains) + +def to_boolean(string, default=None): + if not string: + return default + + normalized = string.lower() + if normalized in ("y", "yes", "1", "true"): + return True + elif normalized in ("n", "no", "0", "false"): + return False + else: + raise ValueError("Invalid value for to_boolean: %s" % string) |