<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Nov 14, 2016 at 8:37 AM, Robert Yang <span dir="ltr"><<a href="mailto:liezhi.yang@windriver.com" target="_blank">liezhi.yang@windriver.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 11/14/2016 11:03 PM, Christopher Larson wrote:<br>
</span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
<br>
On Mon, Nov 14, 2016 at 7:34 AM, Robert Yang <<a href="mailto:liezhi.yang@windriver.com" target="_blank">liezhi.yang@windriver.com</a><br></span><span class="">
<mailto:<a href="mailto:liezhi.yang@windriver.com" target="_blank">liezhi.yang@windriver.<wbr>com</a>>> wrote:<br>
<br>
The old code:<br>
network_enabled = not d.getVar('BB_NO_NETWORK', True)<br>
<br>
It is True only when BB_NO_NETWORK is not set (None),<br>
but BB_NO_NETWORK = "0" should also be True while "1" means no network,<br>
"0" means need network in a normal case.<br>
<br>
Signed-off-by: Robert Yang <<a href="mailto:liezhi.yang@windriver.com" target="_blank">liezhi.yang@windriver.com</a><br></span>
<mailto:<a href="mailto:liezhi.yang@windriver.com" target="_blank">liezhi.yang@windriver.<wbr>com</a>>><span class=""><br>
---<br>
meta/classes/sanity.bbclass | 14 +++++++++-----<br>
1 file changed, 9 insertions(+), 5 deletions(-)<br>
<br>
diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass<br>
index 7e383f9..c5e3809 100644<br>
--- a/meta/classes/sanity.bbclass<br>
+++ b/meta/classes/sanity.bbclass<br>
@@ -363,15 +363,19 @@ def check_connectivity(d):<br>
test_uris = (d.getVar('CONNECTIVITY_CHECK_<wbr>URIS', True) or "").split()<br>
retval = ""<br>
<br>
+ bbn = d.getVar('BB_NO_NETWORK', True)<br>
+ if bbn not in (None, '0', '1'):<br>
+ return 'BB_NO_NETWORK should be "0" or "1", but it is "%s"' % bbn<br>
<br>
<br>
Does this mirror the same logic used in bitbake? What’s the behavior if it’s<br>
set, but to the empty string?<br>
</span></blockquote>
<br>
bitbake only checks whether it equals "1" or not. Without this patch, an empty<br>
string is the same as not set since it doesn't equal to "1". But if it is<br>
set to "0", bitbake uses it as enable network, sanity.bbclass uses it<br>
as disable netowrk, which are conflicted. We can add checking for empty string,<br>
but do we have to ? Limit it to "0" or "1" makes things clear.</blockquote></div><br>IMO if we’re going to change the semantics, we should do it in bitbake and then mirror that in the metadata. Sanity checking should mirror the actual variable behavior where it’s used.<br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Christopher Larson<br>clarson at kergoth dot com<br>Founder - BitBake, OpenEmbedded, OpenZaurus<br>Maintainer - Tslib<br>Senior Software Engineer, Mentor Graphics</div>
</div></div>