imx-test has a special version (00.00.00) that should be specially
handled when it is the most frequent version alongside another version
(the other version would be more relevant in that case).

It works around errors like:

ERROR: The most frequent versions (['3.14.28-1.0.0', '00.00.00']) for
  imx-test are equally distributed among boards of SoC mx6sl.
  Cannot determine which one to use.

In this case, we pick the version which is not 00.00.00.

Signed-off-by: Mario Domenech Goulart <[email protected]>
---
 scripts/bitbake-metadata2doc.py |   12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/scripts/bitbake-metadata2doc.py b/scripts/bitbake-metadata2doc.py
index 5e6fd96..a5424c9 100644
--- a/scripts/bitbake-metadata2doc.py
+++ b/scripts/bitbake-metadata2doc.py
@@ -254,8 +254,18 @@ def write_soc_pkg(data, out_dir):
                         versions_histogram[version] = 1
                 versions_freq = versions_histogram.values()
                 most_freq = max(versions_freq)
+                num_most_freq = versions_freq.count(most_freq)
+
+                ## imx-test is a special case: it has a "fake" version
+                ## number (00.00.00) that must be specially handled.
+                if (pkg == 'imx-test' and
+                    num_most_freq == 2 and
+                    '00.00.00' in versions_histogram.keys()):
+                    del versions_histogram['00.00.00']
+                    num_most_freq -= 1
+
                 ## More than one "most frequent" version?
-                if versions_freq.count(most_freq) > 1:
+                if num_most_freq > 1:
                     error('The most frequent versions (%s) for %s are equally 
distributed among boards of SoC %s.  Cannot determine which one to use.' % \
                               ([ ver for ver, count in 
versions_histogram.items() if count == most_freq ],
                                pkg,
-- 
1.7.10.4

-- 
_______________________________________________
meta-freescale mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-freescale

Reply via email to