From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7268290060374507520 X-Received: by 2002:a05:6402:34c2:b0:521:ef0f:8ef9 with SMTP id w2-20020a05640234c200b00521ef0f8ef9mr3207817edc.19.1692283510801; Thu, 17 Aug 2023 07:45:10 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:aa7:ce13:0:b0:522:3a21:f230 with SMTP id d19-20020aa7ce13000000b005223a21f230ls436361edv.1.-pod-prod-09-eu; Thu, 17 Aug 2023 07:45:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFQ/SzRIR7umJzrMju/5rVSdZ3UeKvYoizqLOJrjHhkqZxwXieOEfUg5mnynFHUvD+dWiON X-Received: by 2002:aa7:d495:0:b0:527:2347:8838 with SMTP id b21-20020aa7d495000000b0052723478838mr1634191edr.31.1692283509046; Thu, 17 Aug 2023 07:45:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692283509; cv=none; d=google.com; s=arc-20160816; b=Gbf7s2jWIYd6crF83NTzd5/HvW4jIraE+VoNQAip4bjKhzeuhPk98ywBpedklCfbp/ NEZAF4+5F61Atg760i5TW0Hh4pgmEmoESATDiUs87p0lRSMu85bHfWm5rdiXO19zelX8 BFbtwzBmzHz2sriMGa9LuUD7YEBksUn12QqAP2EiFjfXUWrjPzWB3d9owOVOHvhHGXiI d8HnjipCep3rEB4kwwsrhcdmTWJ8DmDyB2INBuH1tNAeNxkLwNRpkQgT+JSLZijl8J8m bxBvowapfgAenWYfKBWEUEjdyTNVWMlDlh4zfxqkNXR4BibImPhETYbfdwarZb6DdEip s6Xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:organization:from :content-language:references:to:subject:user-agent:mime-version:date :message-id:dkim-signature; bh=D4O7qoDwxkbAhE7zTmr4UwDLuEs9RxuEjQtNRPnDmto=; fh=3IiiN/d09RZ14kHTHb4Va0QFchvvxfa/9cBrgJDeKuc=; b=h4/GgFVfpCH9LAjlrr5VDk5BQiEs2r4zpSnH0L8KN6wdmWUGWHqsX7Cmd5MpIQM6xk 4Mpj5F0/aXJSGrMfDRw/2wSNJRC05WPXHlO+pwO6B0XsYIw7jWUZbq8qFiNFvUEk8ATn 3AuvEHyI+NCMNCfhIinw7hAKJDu6YZ02sOGPiv55b9l24KXCg4N/aX2SrJNQeD1kqdFK rWeI7xAZQCf+gmRqaM94Cf4ZywiRsPqabskrelfYwPNjJoY4EoIciNapyov4q4/5Zjp5 o0EQgSFXbrZVOx5DLy79z1u2vPHVkLa6OsSrj8bm3pYslxDPpVN/j1KQNVVxLvpfFkD6 iumw== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@denx.de header.s=phobos-20191101 header.b=LZQOjXdl; spf=pass (google.com: domain of ch@denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=ch@denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=denx.de Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by gmr-mx.google.com with ESMTPS id i25-20020a0564020f1900b0052174fd486fsi1526675eda.1.2023.08.17.07.45.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Aug 2023 07:45:08 -0700 (PDT) Received-SPF: pass (google.com: domain of ch@denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@denx.de header.s=phobos-20191101 header.b=LZQOjXdl; spf=pass (google.com: domain of ch@denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=ch@denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=denx.de Received: from [10.88.0.65] (dslb-002-207-026-146.002.207.pools.vodafone-ip.de [2.207.26.146]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: ch@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 459A686B5D; Thu, 17 Aug 2023 16:45:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1692283508; bh=D4O7qoDwxkbAhE7zTmr4UwDLuEs9RxuEjQtNRPnDmto=; h=Date:Subject:To:References:From:In-Reply-To:From; b=LZQOjXdlu3rlG7oDigqzy3igy2b3obNcEJlMtCsEbqlRHdYl5OIEAPL7ST9Y7vPba OrECE0UnAxc0nNEe7EbJWYrqjU7jTpbAskOLSpo+oY7OvBGhgKOh8yJ6xJ13k1/BMV 4LCNjGkcsr9AaD2X7DuVN3RtxMSSCwsULtqHMy8SM4txpLc1mHCVqmCr3LCerIieus MQCTlEtMExvXckmgdaMbAqJnnlYEXMXtK/cI7dgLBa5/txKi5ECZwG70qTWzyVoi0I EyKfNdxCtwtbmr5Cx+o4ePC6gEztE/4E5SAHe7Nut5Hku1S7IAzvpmmwAApHLMFnBw hib3k9KksZzvQ== Message-ID: <4b7029ee-8bed-46c3-b318-1f8f8473259d@denx.de> Date: Thu, 17 Aug 2023 16:45:05 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/2] meta/base.bbclass: integrate COMPATIBLE_MACHINE feature To: Anton Mikanovich , isar-users@googlegroups.com References: <20230817135725.2524796-1-ch@denx.de> <20230817135725.2524796-3-ch@denx.de> <2c2aabe3-0a93-8389-8822-1a6c58f17ecf@ilbers.de> Content-Language: en-US From: Claudius Heine Organization: Denx Software Engineering In-Reply-To: <2c2aabe3-0a93-8389-8822-1a6c58f17ecf@ilbers.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean X-TUID: TtXK+YwXAwBb Hi Anton, On 2023-08-17 16:06, Anton Mikanovich wrote: > 17/08/2023 16:57, Claudius Heine wrote: >> Integrate the COMPATIBLE_MACHINE of OE, where recipes can specify a >> regex in COMPATIBLE_MACHINE that needs to match to an entry of the >> MACHINEOVERRIDES variable, otherwise the recipe will be skipped. >> >> Similar to OE, with `PARSE_ALL_RECIPES`, parsing of the recipe can be >> enforced. >> >> This code was copied from the OE-core codebase. >> >> Signed-off-by: Claudius Heine >> --- >>   meta/classes/base.bbclass | 10 ++++++++++ >>   1 file changed, 10 insertions(+) >> >> diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass >> index 17bebe94..68e88390 100644 >> --- a/meta/classes/base.bbclass >> +++ b/meta/classes/base.bbclass >> @@ -165,6 +165,16 @@ python() { >>                   d.prependVar( >>                       e, cleandir_code.format(ws=ws, dirlist=" >> ".join(dirs)) >>                   ) >> + >> +    need_machine = d.getVar('COMPATIBLE_MACHINE') >> +    if need_machine and not d.getVar('PARSE_ALL_RECIPES', False): >> +        import re >> +        compat_machines = (d.getVar('MACHINEOVERRIDES') or >> "").split(":") >> +        for m in compat_machines: >> +            if re.match(need_machine, m): >> +                break >> +        else: >> +            raise bb.parse.SkipRecipe("incompatible with machine %s >> (not in COMPATIBLE_MACHINE)" % d.getVar('MACHINE')) >>   } >>   def isar_export_proxies(d): > > Hello Claudius, > Import re is not needed here because already done at top of the function. Sure. Do you want a v2 or are you deleting that line on merge? regards, Claudius > -- DENX Software Engineering GmbH, Managing Director: Erika Unter HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-54 Fax: (+49)-8142-66989-80 Email: ch@denx.de