mirror of
https://git.yoctoproject.org/poky
synced 2026-06-03 01:40:07 +00:00
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>
This commit is contained in:
committed by
Richard Purdie
parent
e56f63a284
commit
3faa635fd4
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user