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 | poky-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): | |||
831 | 831 | ||
832 | if debug_domains: | 832 | if debug_domains: |
833 | bb.msg.set_debug_domains(debug_domains) | 833 | bb.msg.set_debug_domains(debug_domains) |
834 | |||
835 | def to_boolean(string, default=None): | ||
836 | if not string: | ||
837 | return default | ||
838 | |||
839 | normalized = string.lower() | ||
840 | if normalized in ("y", "yes", "1", "true"): | ||
841 | return True | ||
842 | elif normalized in ("n", "no", "0", "false"): | ||
843 | return False | ||
844 | else: | ||
845 | raise ValueError("Invalid value for to_boolean: %s" % string) | ||