From patchwork Fri Mar 18 13:41:30 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [1/1] sanity.bbclass: check for duplicates in PACKAGE_ARCHS Date: Fri, 18 Mar 2011 13:41:30 -0000 From: Joshua Lock X-Patchwork-Id: 1599 Message-Id: <7783b3cb5e880f7c6cdebf21599411bfec862972.1300455579.git.josh@linux.intel.com> To: openembedded-core@lists.openembedded.org Cc: From: Joshua Lock 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 --- meta/classes/sanity.bbclass | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass index 6e13d2a..639e1ea 100644 --- a/meta/classes/sanity.bbclass +++ b/meta/classes/sanity.bbclass @@ -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)