From patchwork Fri Jun 9 18:41:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denys Dmytriyenko X-Patchwork-Id: 103540 Delivered-To: patch@linaro.org Received: by 10.140.91.77 with SMTP id y71csp339883qgd; Fri, 9 Jun 2017 11:41:55 -0700 (PDT) X-Received: by 10.98.40.198 with SMTP id o189mr44653414pfo.238.1497033715620; Fri, 09 Jun 2017 11:41:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497033715; cv=none; d=google.com; s=arc-20160816; b=OQOgP9boPZXeEdeZQ/S0efni3vI+aj72/WJLDsQBteMFfCL7v7e+Wtl7SQE3f+i8qd RIkh8H8op6EqBblsw174uQPAIyfDJefzQlOiY/xGjyW1UDzeHhpQ4SdOjvbsOZ1ePvoZ 9XaVs8aGaP7j6APkJLDVexU/AjfUTVAwXMnyopqA1m4GqvvlzDA6t2BI28jixbBMkDVl RGm8ohR4s56sVY0Hd3Byhen4T9zU5UEyZiPEVqcKPLsfgFZGmCc3Ewd/HIV2J0cCnt2J VSdeNNxfPqGeQTLD754/KHvVJckw0Hb/Ye59wRekXMsdcW+JjXqPKZvNS6wmiv2lEU8G 1R5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:message-id:date:to:from:delivered-to :arc-authentication-results; bh=tCbuM9420yMPw65yKGLtusLBRmmt/LgnZ+G86COeeZs=; b=xex5UxIzfQ5CIHRQtgHiUr+7pKMDvifEeWjt6Yh2Oor6VTjy7zzWiBTM1e4A/9Y4B6 2qR6xIQJwR4e9kwvNNeWj/NFbeX9zVhG1W0ZyMcSzPHSvNKx+wLX+Vu9JyUcb2uwiwgI c/7bPqtjsXhEhmiECMJurh+SSTHEEbyoprdvMgdQCxZADOzj9h3a8XkhA4/jqbDAm+9i jmAtIhuuRkIW6PHsao3so+HSKNARG+NVFl99wNr84p6V060S6eGSf0TVxN6E5R2T/32J p6G6TGdDmV93FK+LYfPcx3DiC2L+psCT96dn8ntJipC+Nd8wG9mmQJhb6qST+RD52C+J +RPQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org Return-Path: Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id b72si1508707pfe.162.2017.06.09.11.41.55; Fri, 09 Jun 2017 11:41:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) client-ip=140.211.169.62; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org Received: from review.yoctoproject.org (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id CE67A782FD; Fri, 9 Jun 2017 18:41:44 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mailout4.zoneedit.com (mailout4.zoneedit.com [64.68.198.17]) by mail.openembedded.org (Postfix) with ESMTP id ED7DA782FD for ; Fri, 9 Jun 2017 18:41:42 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mailout4.zoneedit.com (Postfix) with ESMTP id 493C720BAF; Fri, 9 Jun 2017 18:41:43 +0000 (UTC) Received: from mailout4.zoneedit.com ([127.0.0.1]) by localhost (zmo03-pco.easydns.vpn [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id crVenbo5kFei; Fri, 9 Jun 2017 18:41:43 +0000 (UTC) Received: from mail.denix.org (pool-100-15-85-143.washdc.fios.verizon.net [100.15.85.143]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mailout4.zoneedit.com (Postfix) with ESMTPSA id 286A6207BD; Fri, 9 Jun 2017 18:41:42 +0000 (UTC) Received: from gimli.denix (gimli [192.168.0.6]) by mail.denix.org (Postfix) with ESMTP id 8E67C1624D4; Fri, 9 Jun 2017 14:41:41 -0400 (EDT) From: Denys Dmytriyenko To: openembedded-core@lists.openembedded.org Date: Fri, 9 Jun 2017 14:41:35 -0400 Message-Id: <1497033695-138298-1-git-send-email-denis@denix.org> X-Mailer: git-send-email 2.7.4 Cc: Denys Dmytriyenko Subject: [OE-core] [PATCH] uboot-config: check UBOOT_CONFIG variable, not flags, for error conditions X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: openembedded-core-bounces@lists.openembedded.org Errors-To: openembedded-core-bounces@lists.openembedded.org From: Denys Dmytriyenko Sometimes there's a need to change existing UBOOT_CONFIG setting from a recipe, distro or local config, such as an override or even switch back to UBOOT_MACHINE. Unfortunately, there's no easy way to override or unset flags, so using them as an error condition is rather heavy-handed. Change those conditions to check the UBOOT_CONFIG variable itself, not its flags. Signed-off-by: Denys Dmytriyenko --- meta/classes/uboot-config.bbclass | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) -- 2.7.4 -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core diff --git a/meta/classes/uboot-config.bbclass b/meta/classes/uboot-config.bbclass index 10013b7..8f1ded4 100644 --- a/meta/classes/uboot-config.bbclass +++ b/meta/classes/uboot-config.bbclass @@ -20,24 +20,21 @@ python () { ubootbinaries = d.getVar('UBOOT_BINARIES') # The "doc" varflag is special, we don't want to see it here ubootconfigflags.pop('doc', None) + ubootconfig = (d.getVar('UBOOT_CONFIG') or "").split() - if not ubootmachine and not ubootconfigflags: + if not ubootmachine and len(ubootconfig) == 0: PN = d.getVar("PN") FILE = os.path.basename(d.getVar("FILE")) bb.debug(1, "To build %s, see %s for instructions on \ setting up your machine config" % (PN, FILE)) raise bb.parse.SkipPackage("Either UBOOT_MACHINE or UBOOT_CONFIG must be set in the %s machine configuration." % d.getVar("MACHINE")) - if ubootmachine and ubootconfigflags: + if ubootmachine and len(ubootconfig) > 0: raise bb.parse.SkipPackage("You cannot use UBOOT_MACHINE and UBOOT_CONFIG at the same time.") if ubootconfigflags and ubootbinaries: raise bb.parse.SkipPackage("You cannot use UBOOT_BINARIES as it is internal to uboot_config.bbclass.") - if not ubootconfigflags: - return - - ubootconfig = (d.getVar('UBOOT_CONFIG') or "").split() if len(ubootconfig) > 0: for config in ubootconfig: for f, v in ubootconfigflags.items(): @@ -57,6 +54,4 @@ python () { bb.debug(1, "Appending '%s' to UBOOT_BINARIES." % ubootbinary) d.appendVar('UBOOT_BINARIES', ' ' + ubootbinary) break - elif len(ubootconfig) == 0: - raise bb.parse.SkipPackage('You must set a default in UBOOT_CONFIG.') }