Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id AD413E00ADF; Fri, 24 Mar 2017 13:06:56 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM autolearn=no version=3.3.1 X-Spam-HAM-Report: * -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no * trust * [209.85.216.194 listed in list.dnswl.org] * 0.5 RCVD_IN_SORBS_SPAM RBL: SORBS: sender is a spam source * [209.85.216.194 listed in dnsbl.sorbs.net] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] Received: from mail-qt0-f194.google.com (mail-qt0-f194.google.com [209.85.216.194]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 916D7E00A4F for ; Fri, 24 Mar 2017 13:06:52 -0700 (PDT) Received: by mail-qt0-f194.google.com with SMTP id x35so99759qtc.1 for ; Fri, 24 Mar 2017 13:06:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:organization; bh=iI2oFZ7ZCxal86kLOItYlExqH8bRScC//8jdCTubomw=; b=NarsIdAp1/9sKY6/efyoU3aEQL+UYB4DRObbu/rHL2L5fITP8CCKiF+WJ22SK6Yhpt j7sIeBf2Fn4Brh8mIQf2RnecjQLtsmrs97C8MrTTVFv8NR1VOGPx8si826aHqIMvi7EJ cBd+h9m0CEHCezpoGI7Z9MnKx2MPBQqa5dVsHQtHwfVlMZjQ7HCdTWxCi9vWrtTbvhiN aH1Zc726Daygj4Sts9mkMg1WVQ52DWasJlgKOyuJygZzrwmxKQSqsA3nPz23l30l8cVW XlAEZt+C/oR5wqgklSFuIA4d6sSvLQlgFSxOnffxdoepvo1M+QD9WiCHv/UpcOmLycA7 1yEA== X-Gm-Message-State: AFeK/H2uICw4tHoetHdl+V2mIvnIH8SsDaBPn4t65OQQfDAc1Isehn/NN6GqxOs37GGjUw== X-Received: by 10.200.38.218 with SMTP id 26mr10520450qtp.53.1490385625576; Fri, 24 Mar 2017 13:00:25 -0700 (PDT) Received: from localhost ([189.114.111.135]) by smtp.gmail.com with ESMTPSA id q15sm2205504qtc.1.2017.03.24.13.00.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Mar 2017 13:00:24 -0700 (PDT) Received: by localhost (sSMTP sendmail emulation); Fri, 24 Mar 2017 17:00:20 -0300 From: Otavio Salvador To: meta-freescale Mailing List Date: Fri, 24 Mar 2017 17:00:09 -0300 Message-Id: <20170324200013.15660-2-otavio@ossystems.com.br> X-Mailer: git-send-email 2.12.1 In-Reply-To: <20170324200013.15660-1-otavio@ossystems.com.br> References: <20170324200013.15660-1-otavio@ossystems.com.br> Organization: O.S. Systems Software LTDA. Cc: Otavio Salvador Subject: [PATCH 1/5] machine-overrides-extender.bbclass: Add filter out support X-BeenThere: meta-freescale@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Usage and development list for the meta-fsl-* layers List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Mar 2017 20:06:56 -0000 The allow easier enablement of mainline BSP support, we need to allow for specific overrides to be filtered out, before and during the extending process. The new MACHINEOVERRIDES_EXTENDER_FILTER_OUT variable does exactly this and will be used in a subsequent commit to enable the 'use-mainline-bsp' override. Signed-off-by: Otavio Salvador --- classes/machine-overrides-extender.bbclass | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/classes/machine-overrides-extender.bbclass b/classes/machine-overrides-extender.bbclass index 89ff99cf..f333a0fc 100644 --- a/classes/machine-overrides-extender.bbclass +++ b/classes/machine-overrides-extender.bbclass @@ -3,21 +3,40 @@ # # This allow to grouping of different settings for similar platforms. # -# To use the class, specify, for example: +# To indicate that a SoC contains following set of overrides, you can use: # # MACHINEOVERRIDES_EXTENDER_soc = "group1:group2" # -# Copyright 2016 (C) O.S. Systems Software LTDA. +# However to indicate that an override replaces a set of other +# overrides, you can use: +# +# MACHINEOVERRIDES_EXTENDER_FILTER_OUT_override = "group1 group2" +# +# Copyright 2016-2017 (C) O.S. Systems Software LTDA. def machine_overrides_extender(d): machine_overrides = (d.getVar('MACHINEOVERRIDES', True) or '').split(':') - for o in machine_overrides: - extender = d.getVar('MACHINEOVERRIDES_EXTENDER_%s' % o, True) + + # Gather the list of overrides to filter out + machine_overrides_filter_out = [] + for override in machine_overrides: + machine_overrides_filter_out += (d.getVar('MACHINEOVERRIDES_EXTENDER_FILTER_OUT_%s' % override, True) or '').split() + + # Drop any overrides of filter_out prior extending + machine_overrides = [o for o in machine_overrides if o not in machine_overrides_filter_out] + + for override in machine_overrides: + extender = d.getVar('MACHINEOVERRIDES_EXTENDER_%s' % override, True) + if extender: extender = extender.split(':') + + # Drop any extension if in filter_out + extender = [e for e in extender if e not in machine_overrides_filter_out] + extender.reverse() if not set(extender).issubset(set(machine_overrides)): - index = machine_overrides.index(o) + index = machine_overrides.index(override) for e in extender: machine_overrides.insert(index, e) d.setVar('MACHINEOVERRIDES', ':'.join(machine_overrides)) -- 2.12.1