From patchwork Wed May 8 10:40:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 163626 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:81:0:0:0:0 with SMTP id l1csp2492547ilm; Wed, 8 May 2019 03:40:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqw+1z8kHSdt7gTX0aeXWxIRoRrFfRBUfrkJxxJpLVyBqU8D7m0j4SpI7LRJI2hb9yUp3S9X X-Received: by 2002:a62:125c:: with SMTP id a89mr47606686pfj.93.1557312032154; Wed, 08 May 2019 03:40:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557312032; cv=none; d=google.com; s=arc-20160816; b=LjxbIuM/M4eBmmVA8n/F063AFnYLezjvDBwQ1mwE2iPElZRy4JhVI5ywSSIj7QXaZS 1Wa/PfUv3ddzO0uVMuWPp6gEWYIuWzE6AvfIuKgjwQ34AJFOu8+DG85YZVB2dE4gho8i L/5wKQadZm/LTgnE0raMwur+ReGKL7tYXGeGrQK9rwtuRUeuYtI3wvAKO5o1RdWABPqq eupgDwuXuvuSQVDqiTONK02QPjh0eD+gXHSjYulABQQ9BryZj+yWmaZztczSqBpUUKNx AGft/0uDJ/Kngdkh43xMXfai5j41rzix3HyTFueyHvLJubzfNeHKfiofIudRCIko/ieO 83Gg== 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:message-id:date:to:from:dkim-signature :delivered-to; bh=BAfsB+rXE75qFauojx9H2hxvVwTKtgxMj6yDdxgXHIc=; b=hoFAUrInkvbyPWv/RXAB5fXbUr2nFESErRXAPo95FaBoNEfMaGPuTOskQb5a9MESaM TMb4bP+z6lKRNadFOXcbG0dgMLmlN9bXH+aKjbuRekP0FAMz67dsaK7EAAzRruIoN0eJ igCkHJbNFKSE9ZAle4Cxy53dDQnYMP7HQa/ZxYEkjAzGut8d2EUuhRpBlWn7j4HkyG+i ktmurQUXuPCKLvO2MALjj/ltLxpBT6QuAq8nUj1ZQyCn6Wq2kzFDh5RTC/pt9uZCEhFa UNdzRo2vl7m3gKXI0OISj3YvyCx7bPa6rQqvUI4EYpIL5AXZFkZogzTgX3R3ym1F4lGu QrJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=FzQE26cQ; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id a23si21434042pgw.142.2019.05.08.03.40.31; Wed, 08 May 2019 03:40:32 -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; dkim=neutral (body hash did not verify) header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=FzQE26cQ; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from ec2-34-214-78-129.us-west-2.compute.amazonaws.com (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id B04087DDBA; Wed, 8 May 2019 10:40:27 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by mail.openembedded.org (Postfix) with ESMTP id F04A67DDBA for ; Wed, 8 May 2019 10:40:26 +0000 (UTC) Received: by mail-wr1-f67.google.com with SMTP id r4so11225622wro.10 for ; Wed, 08 May 2019 03:40:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id; bh=DNpcP986id228eE9VVIFwcEm0wIeByahaDK6nfaMEo0=; b=FzQE26cQI9Tbbi0wZQPPg41oXOS+cSglVdMHhCDxE721EdpanZn7iAKYNJjOhhHaPQ IyQjnxiLNsdag6Z6J5wvFtZ9IDJ79euMgJYW7kycnQe1wDlbInJyB3/oB+uoszM8jA9a hJjBlharcclpD784XEgs6nCEYNmpwMDkE5TiauP7P2ch5tEOooN+wASaJZBBy0pgFnjE llmPpOWmFQN4ahSeo0yRUTXXnCVfdlvJ5LCROgM3F51lMQCha+zIrgavXHNolY15clry 5cBu7mXoYu2IbZ8udytcUDOLjxd1qh0YGVoa172sC4R1OfLDGf4L1rNIpm2XXTEDzEV9 dpLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=DNpcP986id228eE9VVIFwcEm0wIeByahaDK6nfaMEo0=; b=easIBX0g0enEWliDSgmySlZnkXsSMcwZBccSmLlzG2w6pwGJFSjsmXNhyZ+pK2WFDY WNr4T18rmYrHau+iQg+cToCaezF8IFpTkcJMxdaJtzSR9E9Ja877HCYSkQdqI2J6NuX8 Xd2qOleLx5shujw0aLPUof1wcNInenz2x994Da92RO3OeucRV2tgqKZjwCLrPZgRzU23 cr0stjb0qHM5pgnav5D0O6ypehOQH7kKhwrh6DHfAraGTE7U6SVmnZpGOo6+Q5m89t7a cDh6KSHbuRHdQdm2dJndIHZog5473H6Vyl9DdHpbzG5KwvEc54nlhdP5z8Dst3kJAd1q KXaQ== X-Gm-Message-State: APjAAAULzbD/35DJyX+SLGwmsogblloGvqxcfckOJFYd/I+3yh00m8ly tDXyn/GV7Zm6aDJaIiA9zb1X8tWsVlE= X-Received: by 2002:adf:ce88:: with SMTP id r8mr12260691wrn.191.1557312027442; Wed, 08 May 2019 03:40:27 -0700 (PDT) Received: from flashheart.burtonini.com (35.106.2.81.in-addr.arpa. [81.2.106.35]) by smtp.gmail.com with ESMTPSA id q2sm21242517wrd.48.2019.05.08.03.40.25 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 May 2019 03:40:25 -0700 (PDT) From: Ross Burton To: openembedded-core@lists.openembedded.org Date: Wed, 8 May 2019 11:40:24 +0100 Message-Id: <20190508104024.26159-1-ross.burton@intel.com> X-Mailer: git-send-email 2.11.0 Subject: [OE-core] [PATCH] patch: add minver and maxver parameters 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 Add minver/maxver parameters to limit patch application by comparing PV. Signed-off-by: Ross Burton --- meta/lib/oe/patch.py | 11 +++++++++++ 1 file changed, 11 insertions(+) -- 2.11.0 -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core diff --git a/meta/lib/oe/patch.py b/meta/lib/oe/patch.py index f43cf047c06..91624e26ddb 100644 --- a/meta/lib/oe/patch.py +++ b/meta/lib/oe/patch.py @@ -847,6 +847,7 @@ def src_patches(d, all=False, expand=True): def should_apply(parm, d): + import bb.utils if "mindate" in parm or "maxdate" in parm: pn = d.getVar('PN') srcdate = d.getVar('SRCDATE_%s' % pn) @@ -883,5 +884,15 @@ def should_apply(parm, d): if srcrev and parm["notrev"] in srcrev: return False, "doesn't apply to revision" + if "maxver" in parm: + pv = d.getVar('PV') + if bb.utils.vercmp_string_op(pv, parm["maxver"], ">"): + return False, "applies to earlier version" + + if "minver" in parm: + pv = d.getVar('PV') + if bb.utils.vercmp_string_op(pv, parm["minver"], "<"): + return False, "applies to later version" + return True, None