<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Feb 20, 2018 at 5:08 AM, Richard Purdie <span dir="ltr"><<a href="mailto:richard.purdie@linuxfoundation.org" target="_blank">richard.purdie@linuxfoundation.org</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 Mon, 2018-02-19 at 10:15 -0800, Stephano Cetola wrote:<br>
> From: Amanda Brindle <<a href="mailto:amanda.r.brindle@intel.com">amanda.r.brindle@intel.com</a>><br>
><br>
> Before, explode_dep_versions2 would sort the OrderedDict before<br>
> returning. This function will still sort the OrderedDict by default,<br>
> but<br>
> will now have the option to return the OrderedDict unsorted. This<br>
> option will<br>
> allow us to check if the order of the package list has changed.<br>
><br>
> Signed-off-by: Amanda Brindle <<a href="mailto:amanda.r.brindle@intel.com">amanda.r.brindle@intel.com</a>><br>
> Acked-by: Stephano Cetola <<a href="mailto:stephano.cetola@linux.intel.com">stephano.cetola@linux.intel.<wbr>com</a>><br>
> ---<br>
> lib/bb/utils.py | 5 +++--<br>
> 1 file changed, 3 insertions(+), 2 deletions(-)<br>
><br>
> diff --git a/lib/bb/utils.py b/lib/bb/utils.py<br>
> index c540b49c..7adb4690 100644<br>
> --- a/lib/bb/utils.py<br>
> +++ b/lib/bb/utils.py<br>
> @@ -187,7 +187,7 @@ def explode_deps(s):<br>
> #r[-1] += ' ' + ' '.join(j)<br>
> return r<br>
> <br>
> -def explode_dep_versions2(s):<br>
> +def explode_dep_versions2(s, unsorted=False):<br>
> """<br>
<br>
</span>Would:<br>
<br>
def explode_dep_versions2(s, sorted=True):<br>
<br>
make things easier to read/understand?<br>
<br>
The 'double' logic there currently confuses me a bit.</blockquote><div><br></div><div>sorted=True seems clearer to me as well. I’d also recommend thinking about making this a keyword-only argument, for readability’s sake.</div><div><br></div><div>explode_dep_versions2(s, False) reads pretty unclear, since it loses the info about the meaning of False. Making it keyword only would ensure we’re forced to called it as sorted=False instead.</div></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr">Christopher Larson<br>kergoth at gmail dot com<br>Founder - BitBake, OpenEmbedded, OpenZaurus<br>Senior Software Engineer, Mentor Graphics</div></div></div></div>
</div></div>