[OE-core] [PATCH 2/2] sstatetests: limit the number of signature comparisons when differ

Burton, Ross ross.burton at intel.com
Mon Aug 7 16:32:03 UTC 2017


On 4 August 2017 at 19:57, <leonardo.sandoval.gonzalez at linux.intel.com>
wrote:

> +        i_sigfile, max_sigfiles_to_compare = 0, 20
>          for k in files1.keys() | files2.keys():
>              if k in files1 and k in files2:
> +                i_sigfile += 1
>                  print("%s differs:" % k)
> +                # this is an expensive computation, thus just compare the
> first
> +                # 'max_sigfiles_to_compare' k files
> +                if i_sigfile > max_sigfiles_to_compare:
> +                    continue
>                  sigdatafile1 = self.topdir +
> "/tmp-sstatesamehash/stamps/" + k + "." + files1[k]
>                  sigdatafile2 = self.topdir +
> "/tmp-sstatesamehash2/stamps/" + k + "." + files2[k]
>                  output = bb.siggen.compare_sigfiles(sigdatafile1,
> sigdatafile2)
>

A neater way to do this:

-for k in files1.keys() | files2.keys():
+for k in list(files1.keys() | files2.key())[:20];

(take the union of the files1 and files2 keys, turn it into a list, and
slice off up to the first 20)

Ross
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20170807/4adbd137/attachment-0002.html>


More information about the Openembedded-core mailing list