]> code.ossystems Code Review - openembedded-core.git/commitdiff
sanity.bbclass: check for duplicates in PACKAGE_ARCHS
authorJoshua Lock <josh@linux.intel.com>
Fri, 18 Mar 2011 13:28:42 +0000 (13:28 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 18 Mar 2011 16:45:27 +0000 (16:45 +0000)
Duplicate entries in PACKAGE_ARCHS causes problems with rootfs
generation. For example multiple architecture entries in opkg.conf
will confuse the opkg package manager.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
meta/classes/sanity.bbclass

index 6e13d2ac4d733dd1f4c055f292450b716dc18337..639e1ea61a33f50f8cb1c51ea0d787f84005752f 100644 (file)
@@ -338,6 +338,19 @@ def check_sanity(e):
     elif oeroot.find (' ') != -1:
         messages = messages + "Error, you have a space in your POKYBASE directory path. Please move Poky to a directory which doesn't include a space."
 
+    # Check that we don't have duplicate entries in PACKAGE_ARCHS
+    pkgarchs = data.getVar('PACKAGE_ARCHS', e.data, True)
+    seen = {}
+    dups = []
+
+    for pa in pkgarchs.split():
+       if seen.get(pa, 0) == 1:
+           dups.append(pa)
+       else:
+           seen[pa] = 1
+    if len(dups):
+       messages = messages + "Error, the PACKAGE_ARCHS variable contains duplicates. The following archs are listed more than once: %s" % " ".join(dups)
+
     if messages != "":
         raise_sanity_error(messages)