From patchwork Mon Jun 12 18:47:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denys Dmytriyenko X-Patchwork-Id: 103666 Delivered-To: patch@linaro.org Received: by 10.140.91.77 with SMTP id y71csp61577qgd; Mon, 12 Jun 2017 11:47:59 -0700 (PDT) X-Received: by 10.98.58.83 with SMTP id h80mr56775017pfa.50.1497293279870; Mon, 12 Jun 2017 11:47:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497293279; cv=none; d=google.com; s=arc-20160816; b=UEIkG2/TgXlUGZw2Kyc0mXFw+kqOc18RZacn5RH5JQaUs47WwDliA5FN2wOduw/0IS EDOgruNYvw3JBZfaoDWlWl1hF9SDSH+cqd28aMKV8HbR7x9FfzQgad0IX2UGs2Y32jSJ azImbBctQ6DT5jKyOW8NKklXGUgOuSAWdimHBMX7k0Fu3tn8CSeMGA/4zVWcJo404jn9 12Q/MMSM2UwdmJ6aR4e9SxGnpRQAlDd9KA5+1V/jW3GoDONedjrmcORSu6YBix4PjpBI 9MRys2BlMRW/M54sdsUh8qD04VKygwytjah0poqA+YkFWaAoz6rUjtlGXPDeXRDb94AU UFmQ== 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=lOqW8ynPNJ6upg8Za8kSH1Fn9wYQMKrVZhdX4E7Zj1Q=; b=wLXSOcfAOP1YhJ1jk6M46Q4oOWVwFsDqr93gD7vJlNUJOTLPBVvfeGQEaP759pXPri UHb1rMkcdc6VLPaOrt+SCXwX7X4XfcvEil8gLFClh6jKfgSkwfHZe+95tQXi95mjcKTd H7Lbh8ljFVggkwil7INO1RHLGFpFMN60/MTBLo52i8jDQBGqjGQ8Puvz51dYgYWc99a8 wNhp92WVrG/6gutgAEUG+M8VvlLoonneeQZNwmILrd6bNCNci1c88UblJj6re1bzrgc9 i7LsF9D+xQwTQaLD4EEIv63X9Aj0iMtgG5dOYpP/sQNAROutenObPbxpYMFL98sDUqfC 3Xsw== 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 u186si6453074pgb.91.2017.06.12.11.47.59; Mon, 12 Jun 2017 11:47:59 -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 41D0A782CD; Mon, 12 Jun 2017 18:47:54 +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 08ED4782A5 for ; Mon, 12 Jun 2017 18:47:51 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mailout4.zoneedit.com (Postfix) with ESMTP id 0479C20B84; Mon, 12 Jun 2017 18:47:52 +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 TFHUA92ahMWC; Mon, 12 Jun 2017 18:47:51 +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 DD9E020156; Mon, 12 Jun 2017 18:47:50 +0000 (UTC) Received: from gimli.denix (gimli [192.168.0.6]) by mail.denix.org (Postfix) with ESMTP id 7333D1624EB; Mon, 12 Jun 2017 14:47:50 -0400 (EDT) From: Denys Dmytriyenko To: openembedded-core@lists.openembedded.org Date: Mon, 12 Jun 2017 14:47:49 -0400 Message-Id: <1497293269-51979-1-git-send-email-denis@denix.org> X-Mailer: git-send-email 2.7.4 Cc: Denys Dmytriyenko Subject: [OE-core] [PATCH v2] 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 --- v2 - check ubootconfig var directly, instead of its len() 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..533e175 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 not ubootconfig: 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 ubootconfig: 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.') }