From patchwork Wed Sep 2 09:57:34 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Turull X-Patchwork-Id: 97033 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 24D04C624D5 for ; Wed, 2 Sep 2026 09:58:03 +0000 (UTC) Received: from DU2PR03CU002.outbound.protection.outlook.com (DU2PR03CU002.outbound.protection.outlook.com [52.101.65.66]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.8926.1788343079279353783 for ; Wed, 02 Sep 2026 02:57:59 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@ericsson.com header.s=selector2 header.b=Pqt71T8T; spf=pass (domain: ericsson.com, ip: 52.101.65.66, mailfrom: edaturu@ericsson.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=a5/jvgvtTNbG2dXFSaCOpRukkaE7Et9U6ITKjNgymfBbtCWRixbVNLS/581f9tsitl4qHuHGRikKJCSQu1OdPuivW6+TmZxX62/JaRjqeHnLRM0skoTGtHUYLbwkFcMAQl6Td9flReVlW1sL4NHtL8Bq6SeLZo/PtOSJ2hXq0WkDPSWl56JUGyG3GLA9CIUTiuwGsyYR5b0VIoDqU779SYTPvK6BxdFYCnuwCdhH/JNW6h3VdYUC1BqlV/Ew5rlVatSzfZNBKfBBwhc6m2pVmfxmR22pP+ZdckGjnNbd21Srm0aU5lyPCuggnH8SE/bW8KHZ011IiBGUSviTwyYdLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=kfdEczagMAQUTklWK0q3rq0ETwTWpdm8gDAtMivJt6k=; b=oa3NGBuG6YK+C8VvE1ORRiJWRym1v2fxxbv7W9QGsOxpi7HMm42dW4ugB/2VV7eB8ZGbhXQdKISxapPPTV7zigACEgJ6ei/U21XcFc/p06NA+kM9XuB8ywewhnlbIOm4ORPeLHfRsKW5opcJtGFTmt6NjIWIwZvVSsRpAuZHUO+09bplPB/RXthWSQ5Pw4gtFmDdNJadoerp5BCqDIo5/iXk5OvRBEA0tydZpwyzicr1WlRHVMm1QI710vxFsTVYBHicjLo3S5nADu7u4vFrx01DYe7ayw6p0mqXg78BAIt37H15DvoUvkptCFw0oF63yG0UXr3JpxbTpH2COWuMNw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 192.176.1.74) smtp.rcpttodomain=bootlin.com smtp.mailfrom=ericsson.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=ericsson.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericsson.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kfdEczagMAQUTklWK0q3rq0ETwTWpdm8gDAtMivJt6k=; b=Pqt71T8TgTKeILtWB/mANMB1RCvZ6a5FFEfl735jAde6QHKA3l6guDloMvDHioiCA3kPe8g1cMbk2V7qtIKe14ceyXMMEEPIqSDgzGZRV6BafWU/+G6zyyxx6QOr+zZg+VDWmmR1o/LQv9JmyV3gp1bVGrz3bPj1I9vDbgYJdx3IxTPYa5k5gNTaaOje21yX/+YpfEUXjaFi7abXBW0qJfG/6sF2nd5OquG0PpDW6Nb/wOt0Z0xgCxIxxVAfXfkYKoyndmA+FwtGmThBkWACPQotcNKCSlVv/6Jldy1axpXk59hmbNlAodPsejgM1mBJbbP2v6GIlEPVB6uIlzfJpA== Received: from AS9PR0301CA0025.eurprd03.prod.outlook.com (2603:10a6:20b:468::22) by DU0PR07MB9291.eurprd07.prod.outlook.com (2603:10a6:10:44d::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.360.8; Wed, 2 Sep 2026 09:57:54 +0000 Received: from DU6PEPF0000952A.eurprd02.prod.outlook.com (2603:10a6:20b:468:cafe::78) by AS9PR0301CA0025.outlook.office365.com (2603:10a6:20b:468::22) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.382.10 via Frontend Transport; Wed, 2 Sep 2026 09:57:54 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 192.176.1.74) smtp.mailfrom=ericsson.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=ericsson.com; Received-SPF: Pass (protection.outlook.com: domain of ericsson.com designates 192.176.1.74 as permitted sender) receiver=protection.outlook.com; client-ip=192.176.1.74; helo=oa.msg.ericsson.com; pr=C Received: from oa.msg.ericsson.com (192.176.1.74) by DU6PEPF0000952A.mail.protection.outlook.com (10.167.8.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.382.8 via Frontend Transport; Wed, 2 Sep 2026 09:57:53 +0000 Received: from seroius18815.sero.gic.ericsson.se (153.88.142.248) by smtp-central.internal.ericsson.com (100.87.178.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.37; Wed, 2 Sep 2026 11:57:53 +0200 Received: from seroius08462.sero.gic.ericsson.se (seroius08462.sero.gic.ericsson.se [10.63.237.245]) by seroius18815.sero.gic.ericsson.se (Postfix) with ESMTP id 372684020B42; Wed, 2 Sep 2026 11:57:52 +0200 (CEST) Received: by seroius08462.sero.gic.ericsson.se (Postfix, from userid 160155) id 0A332700CF25; Wed, 2 Sep 2026 11:57:52 +0200 (CEST) From: To: CC: Chen Qi , Mathieu Dubois-Briand , Richard Purdie , Daniel Turull Subject: [2.18][PATCH 1/5] fetch2/git.py: add filter_regex parameter to latest_versionstring Date: Wed, 2 Sep 2026 11:57:34 +0200 Message-ID: <20260902095738.2840120-2-daniel.turull@ericsson.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260902095738.2840120-1-daniel.turull@ericsson.com> References: <20260902095738.2840120-1-daniel.turull@ericsson.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU6PEPF0000952A:EE_|DU0PR07MB9291:EE_ X-MS-Office365-Filtering-Correlation-Id: 4f60d658-cd43-4156-8297-08df08d8a80f X-SMTP-Server: smtp-central.internal.ericsson.com X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|23010399003|82310400026|36860700016|1800799024|376014|18002099003|22082099003|3023799007|56012099006|10067099003|11063799006; X-Microsoft-Antispam-Message-Info: oJLOAB4q0odevjgdxG0UHbGe1MS6VDu5F+Fugu0DrKjRc6khrfc7++nv7Vyn1yQnfJPKkcM3Flx4NeOUJGGNlALayzUVYXQiM8FZGjbpk5xAalVwQUIKHcrpz4904C2P47REfesFIiTFtuLep4SwB+qMjMJdAlCL9Uyoqs5ybmeez8bcJ0ujT7WMyej5Gx2QMRCNXz71H+YkKKCD9m/Mkv1V495hoWyKoOXtA2Ymc97gRaNlrZ4Zi0Fyfn+YxLLJIhK8MPAOIBzZFokoFdHJ5lyK3ceyUhVo8AGrZ3ZETaUYrK9pn4JtV/mulA2AJhr8fMDaLtGAq6n0c9VFVEIDo3gv/2p8lCrzjYcMBGboW439tEVZ6AYoPYwVctzL+1PNUAsHZi0FUdXXWjsMofln2xdDUpL7upn+HYXOJpJko4VD2nHjOdCJJh71nu6bz+KHecSr1vNb1PcNbJcQT8Py6c9yvkbPlK4v2EAo8A1qxHO7E9T7F9nS58nTgyWRJCsL0ODAduky8rNvjObjZD+4YJ1iMALAgDcU6GtoA0KniMmIquUci4m5cJb9F5ZUZppu9TGWWUYuEgpqCaiu+eVP0xXUV7Zh9C/ItD/aHobrfknGU+OjIWiPNNumPlGXipHE44LZslBnKtTJhn5blit9FguiCMuEGWh1kfMsWgDc8lO7dsUs3umuQBKnY1BKn1lkm6eRPUfoCTDQ+63dSb4r9g== X-Forefront-Antispam-Report: CIP:192.176.1.74;CTRY:SE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:oa.msg.ericsson.com;PTR:office365.se.ericsson.net;CAT:NONE;SFS:(13230040)(23010399003)(82310400026)(36860700016)(1800799024)(376014)(18002099003)(22082099003)(3023799007)(56012099006)(10067099003)(11063799006);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: INfRjrZVJLLrK22CN22Gt8Lm+EtUk/eMVbhmdfaIDadmE0SXIloeqh+MrcjGuDW6d+D6vEDckq/47cGKFPtHJ76xOYzEQ6PaBv6Yb53ro22D4KCMrFrve+KZEHGKeyCvMcBUpNzT2yyUIVOL5VngQBV/C6yef9Ov9enoLb47K+B04XFLW4RZ/nMUdJAyvQfWhR0z4rfr+fMUbboUZn9KbTEi1a4ft6IVlg//acVup4WJPachgRmmP07VW+qnHi5aK99koE/xEtIeG49sgOVLdu5tw0EVNfz7r3QpveTjQzUEw9JUJy0dQNBe325Yw5p2ogvYlWsJU6CAhhlbWvH7owM7h8f1dML1AIYWh1DYnZ1cwcOjP20GlJ9L1w6qOf22+PFAOpeodRR7rytPYwvCHwhsCBtGw7UwxFkAGa6kNrmTQbwaW4nZRLI77C+24xQW X-OriginatorOrg: ericsson.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Sep 2026 09:57:53.4665 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4f60d658-cd43-4156-8297-08df08d8a80f X-MS-Exchange-CrossTenant-Id: 92e84ceb-fbfd-47ab-be52-080c6b87953f X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=92e84ceb-fbfd-47ab-be52-080c6b87953f;Ip=[192.176.1.74];Helo=[oa.msg.ericsson.com] X-MS-Exchange-CrossTenant-AuthSource: DU6PEPF0000952A.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR07MB9291 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 02 Sep 2026 09:58:03 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/20149 From: Chen Qi We want to be able to do stable version upgrade for recipes. For example, 1.0.0 -> 1.0.1 instead of 1.0.0 -> 1.1.0. To to this, we need an extra paramter to latest_versionstring so that we are able to filter out the versions we need. Using regex has the advantage of adapting to different version schemes. Signed-off-by: Chen Qi Signed-off-by: Mathieu Dubois-Briand Signed-off-by: Richard Purdie (cherry picked from commit 51842f8bc83203ff19e202361d2bb66e0c9f6381) Signed-off-by: Daniel Turull --- lib/bb/fetch2/git.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/bb/fetch2/git.py b/lib/bb/fetch2/git.py index 5134ec04c..0649429e5 100644 --- a/lib/bb/fetch2/git.py +++ b/lib/bb/fetch2/git.py @@ -975,7 +975,7 @@ class Git(FetchMethod): raise bb.fetch2.FetchError("Unable to resolve '%s' in upstream git repository in git ls-remote output for %s" % \ (ud.unresolvedrev, ud.host+ud.path)) - def latest_versionstring(self, ud, d): + def latest_versionstring(self, ud, d, filter_regex=None): """ Compute the latest release name like "x.y.x" in "x.y.x+gitHASH" by searching through the tags output of ls-remote, comparing @@ -1015,6 +1015,10 @@ class Git(FetchMethod): pver = m.group('pver').replace("_", ".") + if filter_regex: + if not re.match(filter_regex, pver): + continue + if verstring and bb.utils.vercmp(("0", pver, ""), ("0", verstring, "")) < 0: continue From patchwork Wed Sep 2 09:57:35 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Turull X-Patchwork-Id: 97035 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0C1A6C61DD6 for ; Wed, 2 Sep 2026 09:58:13 +0000 (UTC) Received: from DUZPR83CU001.outbound.protection.outlook.com (DUZPR83CU001.outbound.protection.outlook.com [52.101.66.59]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.9220.1788343084568114915 for ; Wed, 02 Sep 2026 02:58:04 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@ericsson.com header.s=selector2 header.b=STBf6K46; spf=pass (domain: ericsson.com, ip: 52.101.66.59, mailfrom: edaturu@ericsson.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=VJWcA6VJ9CSouHgQygoXXSZ9cm1iZxOheObjFiCBokbGsshG2GSMiRnmRF4TLb2soqS8tGsKXNzCSnIWQgBg5/BoHbFqfbs+mn1kgArWsimGhwusCy0IqnfziPXrHGsuNISkXGM+paGFW+mWdAGLQe4Oombysw6A/v4Adfmf1QNvWRQUwAbNeA6T0x52a54bRnd6+zMkkvqd56O8jxOgwx08dph2Jl/6F4sQNPnEeNR0R4X+30Reeas+ubKR0R46irKC9j1A/QsBHjIE4cJJnVftCYyWvR5fnAoGnhoUhQjCmM9z8rmquhY6BoTcfaIyGXRWevPs9zETFOrDJpr49A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=S+jPJC12zteicU84Gsr1cTmvXhnnVXpCrrs/WjZxnA4=; b=xQAURqGVNHna+NxWIFBvymFtrZYYxPdkXQcjEGUBIywMyifZ8JC2uu9KDFDDyVW00gBC08Fls5zGTOvFRlmhI8/Ye8RuS2CQMQdnV2zZ+/GzzSfGHCI/XkV//DIs5c0PItLRtvqxrePOIb33kMpxMQlxpUS77H+axSoH1oFBPOu/POTh7AvZILKestnIAd89o1YttWGMkq6cdr+VqoC+eNa19ZcPnHEnMt6krtk2n1SQihTctDq4+F6mok5WTRXF5WUiEU0+7KWGlBjG7dSMjk9T4SLyZaHl0214Dzq1y900cFOeTnr3WgSaNCNIl9YfJt8PLs5yIvmvEKcVuDoxcA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 192.176.1.74) smtp.rcpttodomain=bootlin.com smtp.mailfrom=ericsson.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=ericsson.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericsson.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=S+jPJC12zteicU84Gsr1cTmvXhnnVXpCrrs/WjZxnA4=; b=STBf6K46R/BlgsAY0vDYHEFq6oJSy3Z2Et3RQ+yBz2zqL/Q2B5ZbDzuSa4yDRSIMmo57q5r5QQLKb0APYIAAgsWewzUvXPPSZniehH8/fh0uKEkI9q39BQzpDWsL2ciFggCB/XWSezMT2CxkGEyuxgHeYiofUI0nFauQIxtwCsFpIh7bceTt7pa+dae2ss9YIIi1cXL+OA63fT7/Be/PugyRrlt1ioR5BEGW+rIBNMma15C1NX/wMDNMyOcks3QrcNYqzFDDY0uBJdbMlp1U7IKzqihoxZh8T1U1MnchloX7nQAiOgHUB6Eu+HVRzNX1QBretzqMDWXThgOAQR72Iw== Received: from AS4P251CA0021.EURP251.PROD.OUTLOOK.COM (2603:10a6:20b:5d3::11) by DBAPR07MB6839.eurprd07.prod.outlook.com (2603:10a6:10:19e::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.360.13; Wed, 2 Sep 2026 09:57:57 +0000 Received: from AMS0EPF000001AA.eurprd05.prod.outlook.com (2603:10a6:20b:5d3:cafe::97) by AS4P251CA0021.outlook.office365.com (2603:10a6:20b:5d3::11) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.382.11 via Frontend Transport; Wed, 2 Sep 2026 09:57:57 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 192.176.1.74) smtp.mailfrom=ericsson.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=ericsson.com; Received-SPF: Pass (protection.outlook.com: domain of ericsson.com designates 192.176.1.74 as permitted sender) receiver=protection.outlook.com; client-ip=192.176.1.74; helo=oa.msg.ericsson.com; pr=C Received: from oa.msg.ericsson.com (192.176.1.74) by AMS0EPF000001AA.mail.protection.outlook.com (10.167.16.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.382.8 via Frontend Transport; Wed, 2 Sep 2026 09:57:57 +0000 Received: from seroius18815.sero.gic.ericsson.se (153.88.142.248) by smtp-central.internal.ericsson.com (100.87.178.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.37; Wed, 2 Sep 2026 11:57:54 +0200 Received: from seroius08462.sero.gic.ericsson.se (seroius08462.sero.gic.ericsson.se [10.63.237.245]) by seroius18815.sero.gic.ericsson.se (Postfix) with ESMTP id 09D154020B43; Wed, 2 Sep 2026 11:57:52 +0200 (CEST) Received: by seroius08462.sero.gic.ericsson.se (Postfix, from userid 160155) id CEAF5700CF25; Wed, 2 Sep 2026 11:57:52 +0200 (CEST) From: To: CC: Chen Qi , Mathieu Dubois-Briand , Richard Purdie , Daniel Turull Subject: [2.18][PATCH 2/5] fetch2/wget.py: add filter_regex parameter to latest_versionstring Date: Wed, 2 Sep 2026 11:57:35 +0200 Message-ID: <20260902095738.2840120-3-daniel.turull@ericsson.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260902095738.2840120-1-daniel.turull@ericsson.com> References: <20260902095738.2840120-1-daniel.turull@ericsson.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AMS0EPF000001AA:EE_|DBAPR07MB6839:EE_ X-MS-Office365-Filtering-Correlation-Id: cad4817e-7a92-4e91-53ee-08df08d8aa7e X-SMTP-Server: smtp-central.internal.ericsson.com X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|82310400026|23010399003|36860700016|10067099003|11063799006|56012099006|18002099003|22082099003; X-Microsoft-Antispam-Message-Info: hSa7NDB1IlUVLPNT01KCovFBPj7Jx1WijBGdTokYKaCzH5LMBY0nDy8r46mCSL0tQ6N/xDMFAjeZMxw7oq1nFlvknjUJ7MPwhNj5NFzU7OJLbBjwG1FIB/rp1cxiPnSlGiHnDzcDkzCg79vgWQIczmd8E1iUFem7uzfcrEdyOHrFbY4nNEia7RUmt8l1OhLIvBDMyANTe61oc7ArdEUc7TdfjVcf1L3CO0BsaIO7WTppoXRcfvfEhYU/mIfPr6c1lu5ss1cabG1BTG7pyYl8iDZVrCDD3/LBvm1XazeZaTTsEH0oqjx+zc015zSES1w/6uDScO3uVuHX2f4QxUsUmmtTebnwNhqslPS6uWnynrwo0C8m4RCRisgp38OR7kJ0s9BIC7aAYtFKd/tsWH+ka9Mz4kOk9FpBotST/YkAdQQjZJxQhR1aElCN0+NrK88R5iDmMU7uKog24f2O4qBEPJz7vhecxZTudLLMWCq+H/5EGxq6bjKTTtcP+czCDMUr5HEbSrag6Se4cuzal0l7IFdtdNJrwpM08fuIiWXG50UVo+vGP6xA/PBNSNRP/nGMAwuiss0B8uW+mp+uRRWsJP7TsW6ZfzznddXmDiFTSAfLD1gxRvwvXJvAVZXGQGWAfyR5MXS9ymwGpUTdPt/CY/kRV3UCSbsqJYklUQ4y40AJvK7sezVCfEgC9vb5/qpMNf2A59rudoa6IRl+P1QGCg== X-Forefront-Antispam-Report: CIP:192.176.1.74;CTRY:SE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:oa.msg.ericsson.com;PTR:office365.se.ericsson.net;CAT:NONE;SFS:(13230040)(376014)(1800799024)(82310400026)(23010399003)(36860700016)(10067099003)(11063799006)(56012099006)(18002099003)(22082099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: yqx0/rCunecVRkDCl2/E+TzmM/YOFB62U4Pm9d66u69gtAFLd/d8O1WL+k3HpOB8+JKVT4+EBr7VyzTrDQB+LDSWdYWcVEyudFI701swGpdoqQIaMkjh9o+/VIQHSAnS00D0WEazlUr22OE6R8CltiCMvXWas1pTSGOvDPoMfojiItr1bPFLWiMBWEXS/OOoslbKerHJ2lA9ON09uY/fvqykZPHT8bC75pZO9NmcOyZwmpRRYRC41+BpUluW3pYlClhZ6toPmnjz56wS5ta70erFRoZi+23oJcGBrG3cpYb7R2ZDFkzk5YMrQm+uW27/oluzvWDr6fqmEz/ZPPKBLVnvj9TuZ2noHNRubHJo0iiBlnGEG6ikNTgFbqWWGk7ziS4eFDZ20dH3zVTSPKiELdzggSY59TVpCVoN/d2rmY68zHB5ZR2NyFdil0t60f+I X-OriginatorOrg: ericsson.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Sep 2026 09:57:57.5646 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cad4817e-7a92-4e91-53ee-08df08d8aa7e X-MS-Exchange-CrossTenant-Id: 92e84ceb-fbfd-47ab-be52-080c6b87953f X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=92e84ceb-fbfd-47ab-be52-080c6b87953f;Ip=[192.176.1.74];Helo=[oa.msg.ericsson.com] X-MS-Exchange-CrossTenant-AuthSource: AMS0EPF000001AA.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR07MB6839 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 02 Sep 2026 09:58:13 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/20153 From: Chen Qi We want to be able to do stable version upgrade for recipes. For example, 1.0.0 -> 1.0.1 instead of 1.0.0 -> 1.1.0. To to this, we need an extra paramter to latest_versionstring so that we are able to filter out the versions we need. Using regex has the advantage of adapting to different version schemes. Signed-off-by: Chen Qi Signed-off-by: Mathieu Dubois-Briand Signed-off-by: Richard Purdie (cherry picked from commit b1c4a431b080ee328fbf21543258e226a464c118) Signed-off-by: Daniel Turull --- lib/bb/fetch2/wget.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/lib/bb/fetch2/wget.py b/lib/bb/fetch2/wget.py index fc83b301a..c292dfe7e 100644 --- a/lib/bb/fetch2/wget.py +++ b/lib/bb/fetch2/wget.py @@ -515,7 +515,7 @@ class Wget(FetchMethod): return fetchresult - def _check_latest_version(self, url, package, package_regex, current_version, ud, d): + def _check_latest_version(self, url, package, package_regex, current_version, ud, d, filter_regex=None): """ Return the latest version of a package inside a given directory path If error or no version, return "" @@ -538,6 +538,11 @@ class Wget(FetchMethod): newver = self._parse_path(package_regex, str(line)) if newver: + if filter_regex: + # filter_regex is derived from PV, and uses . as separator + # while upstream may be using _ as separator + if not re.match(filter_regex, re.sub('_', '.', newver[1])): + continue bb.debug(3, "Upstream version found: %s" % newver[1]) if valid == 0: version = newver @@ -555,7 +560,7 @@ class Wget(FetchMethod): return "" - def _check_latest_version_by_dir(self, dirver, package, package_regex, current_version, ud, d): + def _check_latest_version_by_dir(self, dirver, package, package_regex, current_version, ud, d, filter_regex=None): """ Scan every directory in order to get upstream version. """ @@ -599,7 +604,7 @@ class Wget(FetchMethod): ud.user, ud.pswd, {}]) pupver = self._check_latest_version(uri, - package, package_regex, current_version, ud, d) + package, package_regex, current_version, ud, d, filter_regex) if pupver: version[1] = pupver @@ -660,7 +665,7 @@ class Wget(FetchMethod): return package_custom_regex_comp - def latest_versionstring(self, ud, d): + def latest_versionstring(self, ud, d, filter_regex=None): """ Manipulate the URL and try to obtain the latest package version @@ -701,11 +706,11 @@ class Wget(FetchMethod): dirver_pn_regex = re.compile(r"%s\d?" % (re.escape(pn))) if not dirver_pn_regex.search(dirver): return (self._check_latest_version_by_dir(dirver, - package, package_regex, current_version, ud, d), '') + package, package_regex, current_version, ud, d, filter_regex), '') uri = bb.fetch.encodeurl([ud.type, ud.host, path, ud.user, ud.pswd, {}]) else: uri = regex_uri return (self._check_latest_version(uri, package, package_regex, - current_version, ud, d), '') + current_version, ud, d, filter_regex), '') From patchwork Wed Sep 2 09:57:36 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Turull X-Patchwork-Id: 97034 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 26271C624D5 for ; Wed, 2 Sep 2026 09:58:13 +0000 (UTC) Received: from GVXPR05CU001.outbound.protection.outlook.com (GVXPR05CU001.outbound.protection.outlook.com [52.101.83.28]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.8929.1788343085234899052 for ; Wed, 02 Sep 2026 02:58:05 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@ericsson.com header.s=selector2 header.b=Cw1/m8m+; spf=pass (domain: ericsson.com, ip: 52.101.83.28, mailfrom: edaturu@ericsson.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=bcfscEazaDbPf5YH601WQA8R9gh4xybWGOl/3DadPJ9BO4goOqjGEt52BKwLHJTg/11BbkrCqZgRI1BUUgIS84IWg737W4Tb3Q0HcQWQQES5iS4lIjzUuZcab9fPfXWNK0Di6I9mqI6FB5Far7texfuwiSl27Yi+xEEssJWa2TPwZ0Kj65Gs4GgUkYMbgRkyfQmkEZEMrBKbU3/R7+cFa+zIyLyDI3EKgrHsNR1+l57Abjd67XRWO1W195G3+4wjgIxV5m40TPGsmjqj/tOzdw8zuC/u2hugADg/0tGBxl5L3dOamtnMeW3THtflqjNmjJVaLNTvnowZvE3mOQ9Nsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=p7tM2/scC5T9E32JjBLsqKvjqaSDGUKCdB+iVLe6jRc=; b=s5/BB+oDqll6chIvjuocys6ooxfaLCIo5pEDBJ1KgCj9Wb7FjSAXq4a8cNrqnKU57W6vE8UDSo/wKn90AHD/dALz9uTQn/p2E9AFPM2VYWNoAToC2ixcwXgHIRlHBxyNR/EC5LUrwcH1unPiG6YltvoSYHXSae/Gd+QJMCWDiSOghvmjVYG4OVAgKAowMkwPrire2Gu9lLuBmYwbUXknqDorUbZmjvz859d8H0PVHE3UVXkuwj3HMVa/KfyAatGUwIj5XL828ACLi4yfQMyteU1qX7ih3xsS0kuLxYXp1FZlrRiIZGubcCc6K49qnc+9F6MoyS7kWSNPbjj1EdhtFw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 192.176.1.74) smtp.rcpttodomain=bootlin.com smtp.mailfrom=ericsson.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=ericsson.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericsson.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=p7tM2/scC5T9E32JjBLsqKvjqaSDGUKCdB+iVLe6jRc=; b=Cw1/m8m+7eEUbrscu2BgPXlF3mz7oCye01ZL+j6l/8JAC0IqzlWCzYHbYVX9seX/bgjKBdrZqEecGvQp5lKOmrfSB1JZy6oQ+BmsdUaJgzI9JH7TOqTr3vx2rONEoAG7aPtLqwOBOQMTLGxWwnTg8SQVZqu9YV5KxuGO00BjhOwEDdVOl3hHQQZHU2bnkkURk9en4EZ7Vx8GFsiUDnzJHuekvt9J2Q+HMcOujtT/OQ7GvfdmlBiUaFvgAl1A6oGzmvmIbdRT+YWW2hBOnTURkR6Psn02gifZaxUtpKOkKozeGitVMIh9tOcCMGQth1Js1tMKu5UwJCWmUjbRCaEJGg== Received: from AS9PR06CA0409.eurprd06.prod.outlook.com (2603:10a6:20b:461::18) by DU0PR07MB9267.eurprd07.prod.outlook.com (2603:10a6:10:44d::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.360.13; Wed, 2 Sep 2026 09:57:55 +0000 Received: from CPH1EPF00000526.eurprd05.prod.outlook.com (2603:10a6:20b:461:cafe::9f) by AS9PR06CA0409.outlook.office365.com (2603:10a6:20b:461::18) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.382.11 via Frontend Transport; Wed, 2 Sep 2026 09:57:55 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 192.176.1.74) smtp.mailfrom=ericsson.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=ericsson.com; Received-SPF: Pass (protection.outlook.com: domain of ericsson.com designates 192.176.1.74 as permitted sender) receiver=protection.outlook.com; client-ip=192.176.1.74; helo=oa.msg.ericsson.com; pr=C Received: from oa.msg.ericsson.com (192.176.1.74) by CPH1EPF00000526.mail.protection.outlook.com (10.167.241.137) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.382.8 via Frontend Transport; Wed, 2 Sep 2026 09:57:55 +0000 Received: from seroius18813.sero.gic.ericsson.se (153.88.142.248) by smtp-central.internal.ericsson.com (100.87.178.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.37; Wed, 2 Sep 2026 11:57:54 +0200 Received: from seroius08462.sero.gic.ericsson.se (seroius08462.sero.gic.ericsson.se [10.63.237.245]) by seroius18813.sero.gic.ericsson.se (Postfix) with ESMTP id AD36095802; Wed, 2 Sep 2026 11:57:53 +0200 (CEST) Received: by seroius08462.sero.gic.ericsson.se (Postfix, from userid 160155) id 86D57700CF25; Wed, 2 Sep 2026 11:57:53 +0200 (CEST) From: To: CC: Chen Qi , Mathieu Dubois-Briand , Richard Purdie , Daniel Turull Subject: [2.18][PATCH 3/5] fetch2/crate.py: add filter_regex parameter to latest_versionstring Date: Wed, 2 Sep 2026 11:57:36 +0200 Message-ID: <20260902095738.2840120-4-daniel.turull@ericsson.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260902095738.2840120-1-daniel.turull@ericsson.com> References: <20260902095738.2840120-1-daniel.turull@ericsson.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CPH1EPF00000526:EE_|DU0PR07MB9267:EE_ X-MS-Office365-Filtering-Correlation-Id: e0d92492-9f73-418d-ff1e-08df08d8a8fb X-SMTP-Server: smtp-central.internal.ericsson.com X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|36860700016|23010399003|1800799024|376014|10067099003|6133799003|22082099003|18002099003|56012099006|11063799006; X-Microsoft-Antispam-Message-Info: qfkh0tw6g6s229NnxKkIfcQ9gIVADXE6DSW01bxfUwSEuV6MKVohq0giapdo781csj7iU+94f4xay1YhitsKZzSKcIzsDTCR46aUSgTX/IWUJ5hlIcKZsUnt/xG3JdlgLKG1GKs5sT0n+ZwI2Ml+6IfguDllfA52CDkSeX27hRFPD1c5bvQftDkvsQY39S4QlMCzTfqbw5rkejGyYU9MNP5CIYrTUcSlQPDEsnCnpkmFmqUDtn227JKG8jBpCLTxP7oHAbclrZH4m9xcf+m76+h4ZcrR3iFwnHKc8gfKOkJaIPfn3bSxXpbQxNQXWIEqwkjxeIRMbGGbyJnm4sFKchUKYb4Lzp7Z7yNy46nl8CPWO0msLFo3p8ZPgSKkcjBEPbs/1B+SoqtGZfNpoWfv7hysj3Gww4bXn5TiisZ0hcdVzgv8zWWwessT+adHEpFYzRnqORkzaQkHqVGGYjQlPLqPZxETfDTdIg+aPIAYB8sHUFpby46WEgCbwXAcsFY1o159iCNb5kK2cYQL0YxYjzz56deFbcss2lGqKEm/mvBZ8LAvjWcHhFG/Jlkq0v6wULZ0mm1p7wM4nqp8y8Z3T6QYoFn+XTLIhm1RKNZFLTkv2hVGypOGTtHMH5rOeBRqSXpsCjjx+SrE0mai7GHRDj/j4a65IHkNhyHPtKPceQAUNaXXcOM1fvfDgiYpyaKYa9sVfWdHOrVf63ehtuvdvQ== X-Forefront-Antispam-Report: CIP:192.176.1.74;CTRY:SE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:oa.msg.ericsson.com;PTR:office365.se.ericsson.net;CAT:NONE;SFS:(13230040)(82310400026)(36860700016)(23010399003)(1800799024)(376014)(10067099003)(6133799003)(22082099003)(18002099003)(56012099006)(11063799006);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: QpOAnCF5O/TMdi+8rjNiOEfwmFNdNWKMYvNoz9c1o7XWEAkilbrwUCX77/ngz1clngpN1hjlcUf2cIOiR/ni8/NST698mDCROl4/NYRO7iWJZaN3ISjppDiKGaIITx+bXzgKQo7hz7cdBtWv/Bry/VtfYmi0cOiHuAD+yGk/a9znIXtI/nXkHMvYmqQk7+xlFLkZEnBkW/jp4z+W5mSHVv8wPgWuwNFYfapMSoXD9/StoGkWcgk7kWDz7rHKCui8go+6/80UbucN41hskyUBkNYDZwpaS/80dwFYHXQ5LZ+HRntNDAwO6AeJbPZxeaAgoblCnGT2jfuyGiCW1yN2kBLcxQbFrjQJ4lxWhueyCj8fEiAnybQ9jdjD7NHuFEmyAhpyixdTjlfslsL/m3woHrm9ae0MRdLQMNcJZb0Qhne4RBGFCskgLJjN6C9Zak1O X-OriginatorOrg: ericsson.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Sep 2026 09:57:55.0510 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e0d92492-9f73-418d-ff1e-08df08d8a8fb X-MS-Exchange-CrossTenant-Id: 92e84ceb-fbfd-47ab-be52-080c6b87953f X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=92e84ceb-fbfd-47ab-be52-080c6b87953f;Ip=[192.176.1.74];Helo=[oa.msg.ericsson.com] X-MS-Exchange-CrossTenant-AuthSource: CPH1EPF00000526.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR07MB9267 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 02 Sep 2026 09:58:13 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/20154 From: Chen Qi We want to be able to do stable version upgrade for recipes. For example, 1.0.0 -> 1.0.1 instead of 1.0.0 -> 1.1.0. To to this, we need an extra paramter to latest_versionstring so that we are able to filter out the versions we need. Using regex has the advantage of adapting to different version schemes. Signed-off-by: Chen Qi Signed-off-by: Mathieu Dubois-Briand Signed-off-by: Richard Purdie (cherry picked from commit 592477f225868e227110477f52691e031903430a) Signed-off-by: Daniel Turull --- lib/bb/fetch2/crate.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/bb/fetch2/crate.py b/lib/bb/fetch2/crate.py index eb1fd5719..6133d3756 100644 --- a/lib/bb/fetch2/crate.py +++ b/lib/bb/fetch2/crate.py @@ -13,6 +13,7 @@ BitBake 'Fetch' implementation for crates.io import hashlib import json import os +import re import subprocess import bb from bb.fetch2 import logger, subprocess_setup, UnpackError @@ -155,18 +156,20 @@ class Crate(Wget): with open(mdpath, "w") as f: json.dump(metadata, f) - def latest_versionstring(self, ud, d): + def latest_versionstring(self, ud, d, filter_regex=None): """ Return the latest version available when versionsurl is the [name]/versions URL. """ from functools import cmp_to_key json_data = json.loads(self._fetch_index(ud.versionsurl, ud, d)) versions = [(0, i["num"], "") for i in json_data["versions"]] + if filter_regex: + versions = [v for v in versions if re.match(filter_regex, v[1])] versions = sorted(versions, key=cmp_to_key(bb.utils.vercmp)) return (versions[-1][1], "") if versions else ("", "") - def latest_versionstring_from_index(self, ud, d): + def latest_versionstring_from_index(self, ud, d, filter_regex=None): """ Return the latest version available when versionsurl is a Cargo index file. @@ -181,5 +184,8 @@ class Crate(Wget): if not data.get("yanked", False): versions.append((0, data["vers"], "")) + if filter_regex: + versions = [v for v in versions if re.match(filter_regex, v[1])] + versions = sorted(versions, key=cmp_to_key(bb.utils.vercmp)) return (versions[-1][1], "") if versions else ("", "") From patchwork Wed Sep 2 09:57:37 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Turull X-Patchwork-Id: 97036 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 354FDC624D0 for ; Wed, 2 Sep 2026 09:58:13 +0000 (UTC) Received: from AS8PR04CU009.outbound.protection.outlook.com (AS8PR04CU009.outbound.protection.outlook.com [52.101.70.59]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.9219.1788343082724285186 for ; Wed, 02 Sep 2026 02:58:03 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@ericsson.com header.s=selector2 header.b=jGtK1s6m; spf=pass (domain: ericsson.com, ip: 52.101.70.59, mailfrom: edaturu@ericsson.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=cW2ay8509l0t04cAXEnEQ4CVHnNeC3Pz9F4pPQz9fNKCsIt2d5+BZGA2lRpo75xfzjFNYgbGmM4ixjKOfTXxxl+tza3BZKMAYntpJScQlDvn5kAHRhUIRSnucdJsGs0NDSwDjmE6wZzCZ/nwYd8K3+M4RK/l6x9z3osV55VKFmYN59BNvChtbcwQCuHlJrvIdtWbBD4MikXxdT1VCLFmxc73Rnjvq0/5wY/YME+RfXsepzoA427+moDBGTTwHomlDZYSYCbjRVtZ8a2nntb29TDKEzE+3MD1bMzWUPTetzw3zT/cu/GJqH7erDLBLuK9HenSP66kV5qnDRW6mgR5Zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=fYJcPgaDa5AMtEOtwzMmzQ1RJep+GDOFqFUrc5eyY0I=; b=G7IiYgegGducxZeSAheJRWpxoxCfQnEwatZjsB7QOJ7rqvN3CW+4xisVmXwodf0edQoLMkfAzpBmHw7Jk6rKZuNI/W4Eqmas9T31ntGWITVjZf5gn5Tld33YLRF/GTy1IMKs3rwAtdIhvD4A5HnAqGIBGes9St3t54iQDTgZAlY6Hhj9wA/2MIzdfoPqFB3enMi9N2d+vvy04rsGLIvc2yVKShN+dpy0jM2hPj1Qf+5KPy+mOTZTftuIWhpUgw/JNDEI2k6mcZ0w1I1kjnIBU+Aubit29yvm7uYcgKX6QhDR9kE3XZV+KlsOkC2IrfVLOq6w0cc9HaRS2x6+GlzltA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 192.176.1.74) smtp.rcpttodomain=bootlin.com smtp.mailfrom=ericsson.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=ericsson.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericsson.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fYJcPgaDa5AMtEOtwzMmzQ1RJep+GDOFqFUrc5eyY0I=; b=jGtK1s6myys1zxHzpzj7ZDajuKyQjV3rkHjCE+fye0C3OqXLBZRkn+HO4RsWr3NQSkw/QCinKrTDb2zm14RFU7FlwhDAg5YF8UhwJq3nzA4CgZNZshJQ/NE+cmIbWa/P27Y9TVfupGBHx9ihO6nwRchSm25f2u+u3aPMLRtOkikWADMgYJqkVy1KlJMwgAQxTmk32E3Oww4u/NTwc5MMzMpS+vxSpyJOGE44THHvnAMzlZozaN+RTzGZcxaPVG239GGiP+MvmTNrZc9L27DdT0s7ltCda0giWcPn56RskKE6yYN1TMdYxTr6MeFQkQKTbX+t631Wx/fNW2EmLiyyog== Received: from AS9PR04CA0152.eurprd04.prod.outlook.com (2603:10a6:20b:48a::26) by VI0PR07MB11492.eurprd07.prod.outlook.com (2603:10a6:800:31e::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.360.13; Wed, 2 Sep 2026 09:57:57 +0000 Received: from CPH1EPF00000524.eurprd05.prod.outlook.com (2603:10a6:20b:48a:cafe::4d) by AS9PR04CA0152.outlook.office365.com (2603:10a6:20b:48a::26) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.382.11 via Frontend Transport; Wed, 2 Sep 2026 09:57:57 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 192.176.1.74) smtp.mailfrom=ericsson.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=ericsson.com; Received-SPF: Pass (protection.outlook.com: domain of ericsson.com designates 192.176.1.74 as permitted sender) receiver=protection.outlook.com; client-ip=192.176.1.74; helo=oa.msg.ericsson.com; pr=C Received: from oa.msg.ericsson.com (192.176.1.74) by CPH1EPF00000524.mail.protection.outlook.com (10.167.241.135) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.382.8 via Frontend Transport; Wed, 2 Sep 2026 09:57:56 +0000 Received: from seroius18814.sero.gic.ericsson.se (153.88.142.248) by smtp-central.internal.ericsson.com (100.87.178.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.37; Wed, 2 Sep 2026 11:57:55 +0200 Received: from seroius08462.sero.gic.ericsson.se (seroius08462.sero.gic.ericsson.se [10.63.237.245]) by seroius18814.sero.gic.ericsson.se (Postfix) with ESMTP id 7AC4B4020B41; Wed, 2 Sep 2026 11:57:54 +0200 (CEST) Received: by seroius08462.sero.gic.ericsson.se (Postfix, from userid 160155) id 57148700CF25; Wed, 2 Sep 2026 11:57:54 +0200 (CEST) From: To: CC: Chen Qi , Mathieu Dubois-Briand , Richard Purdie , Daniel Turull Subject: [2.18][PATCH 4/5] fetch2/__init__.py: add filter_regex to default latest_versionstring Date: Wed, 2 Sep 2026 11:57:37 +0200 Message-ID: <20260902095738.2840120-5-daniel.turull@ericsson.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260902095738.2840120-1-daniel.turull@ericsson.com> References: <20260902095738.2840120-1-daniel.turull@ericsson.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CPH1EPF00000524:EE_|VI0PR07MB11492:EE_ X-MS-Office365-Filtering-Correlation-Id: 5a4e4539-07c2-440d-6d10-08df08d8aa18 X-SMTP-Server: smtp-central.internal.ericsson.com X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|36860700016|82310400026|1800799024|23010399003|10067099003|3023799007|18002099003|22082099003|56012099006|11063799006; X-Microsoft-Antispam-Message-Info: UJYceCW6rHdcX00iTpxbdSYGCOFNgKochBRtbGNaoqx8KbccCQtl8KHbvM9teeFDlN2LDVpSXIzY9hYmjLp2hSQXTVCNGF3afG9EizRJM6GNLftygFWXaSTTP+8eqA+LsibhonAnzgbAHvpmi7fnS84a3SWvCFxs8l3EeC35/clR2hOuLdrK5eO7Uj66D1vRPQs8tbI2So5G86Z9A982FcM/0e8jfQsk5+V5Ra+chyLBkJz0Yqb9KtvtAvS2k9PaeESlXWO3h8PpRyWzQ40ONMvHc69BWMsHs8eSsSESqDhFOGCDE82KLr9n6hhzbsO7FUeMTo7iEdZq2n5KvFS60GXfGkHsCmsD48cXyESJElH8gH/R5/s7uWcKKgObzHYc8Jxe7SJZ+kt/A7pZRTgf4rW2t5xZKQju6l4mfmHsFZWBjQNOFl+1dlAc0ChBYtqEuP5AR92M23pM08etjaQSEgU+9BaCl2HSYO0kGtfT8Fx5v7ZkvnLfzSsq/JeOsCfopLAAxT/k8bVrTe4X/AFxYXSSS2F7NgNhkvp89ltCUouWQdNoRk9MTonq9uAe2hOfjJicoGtW5sL/Fr50pkx5HnnF3Jx4gDLHWJpcb0/dyCayd1iBB7Z/hI+Y1JXOOmwsJdnqyfhfim5VhKNsFV0RXGvhaNqr/DN2J3nsQZL5LJ92cuPTYvb6wW0IO9hvXjgRx1aG+dcHmyE69oDx3gBB7Q== X-Forefront-Antispam-Report: CIP:192.176.1.74;CTRY:SE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:oa.msg.ericsson.com;PTR:office365.se.ericsson.net;CAT:NONE;SFS:(13230040)(376014)(36860700016)(82310400026)(1800799024)(23010399003)(10067099003)(3023799007)(18002099003)(22082099003)(56012099006)(11063799006);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: w2ZgxH56Xk1EABMabnwCsFNCQ9qIamH1xnBY2XGRbczJbAmROODfZU7Z4d9dwR+sVRMrjJTYD3eIzlknb+LY91BXqD3zLRKCuxdBnCpeIqQpqQtTm0GZaLC9r59+9dVYu9+z7CiXxsK0wF/E5Z977rJ5OPnmrS7O80BbX4LurXEXCRMl23ra9l7VPPPUEHuEVh10IxN2H0IzDVyhrpxlkor9gD3CSoZ0JOoBbKmHMAf+4Fo+cz2MdOfdO+VMenDvJKbByUU0rYa0ZkDucvlalwnFDVe4Pbob69QI6Jow5pwwc+/lxXkyMD8fEnm08WawQuKQSmqbxgVzm/IBfzANdUBNzApKbtnY5Icm55xeoZw9/Kg8CIRu5m2DRXHhdVwHnyZWBgoX/nEz4pzJCfsTSyPpl6O7gHo2vON3q9X4g90ubFTps6PnhD0iIPfxUfPe X-OriginatorOrg: ericsson.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Sep 2026 09:57:56.9120 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5a4e4539-07c2-440d-6d10-08df08d8aa18 X-MS-Exchange-CrossTenant-Id: 92e84ceb-fbfd-47ab-be52-080c6b87953f X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=92e84ceb-fbfd-47ab-be52-080c6b87953f;Ip=[192.176.1.74];Helo=[oa.msg.ericsson.com] X-MS-Exchange-CrossTenant-AuthSource: CPH1EPF00000524.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI0PR07MB11492 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 02 Sep 2026 09:58:13 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/20151 From: Chen Qi Add filter_regex parameter to the default latest_versionstring function so that fetchers that do not implement this function can also take the filter_regex parameter. Signed-off-by: Chen Qi Signed-off-by: Mathieu Dubois-Briand Signed-off-by: Richard Purdie (cherry picked from commit 52f4d0ffd4a51b8c279eb5df157c90fe7d471a55) Signed-off-by: Daniel Turull --- lib/bb/fetch2/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/bb/fetch2/__init__.py b/lib/bb/fetch2/__init__.py index e0494b3cb..6f5f5e792 100644 --- a/lib/bb/fetch2/__init__.py +++ b/lib/bb/fetch2/__init__.py @@ -1734,7 +1734,7 @@ class FetchMethod(object): def generate_revision_key(self, ud, d, name): return self._revision_key(ud, d, name) - def latest_versionstring(self, ud, d): + def latest_versionstring(self, ud, d, filter_regex=None): """ Compute the latest release name like "x.y.x" in "x.y.x+gitHASH" by searching through the tags output of ls-remote, comparing From patchwork Wed Sep 2 09:57:38 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Turull X-Patchwork-Id: 97037 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3555AC624D7 for ; Wed, 2 Sep 2026 09:58:13 +0000 (UTC) Received: from PA4PR04CU001.outbound.protection.outlook.com (PA4PR04CU001.outbound.protection.outlook.com [40.107.162.64]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.9218.1788343082701461412 for ; Wed, 02 Sep 2026 02:58:03 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@ericsson.com header.s=selector2 header.b=PPCM2W2Q; spf=pass (domain: ericsson.com, ip: 40.107.162.64, mailfrom: edaturu@ericsson.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=CpBzMRc9NrF3UpWUDGFkJd2O2s5hY9f9b0OCfuacMYM37m0sK+RISWgRbPD8x1ebC+2iFdoabmY8Ede4XfyBS11wqBZ4PpVkArgFhdVWE6JTEyuIyWz4SJJCoRMfM/Ftn8smxJ+2/ogdNCxm4vgiN4hPRDrwnXMtngvBq6rz4Qjiw4bdmyh/XUf8zRlqyZcyLBI5PYdBsogInkPayShDqAMiZNP1qVkdfAfYs4nDBs7ECHNXBZV6zkcgfC4IgJ0LFBCDSaAaQvyUUSOVm1Eee7wsnZBqegoFX6eacgRVRKesRVNEnWn7wE5GEgVQckBguTXZZh7xuqUMElLogTQgpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=cdIndbGZH7EkciV3sZyME1h7TPjx6C9tO2bqnpMlbak=; b=ZH/cWhnik5MUF1Cbi4ZN3MqxDdHsc5gWUht0QzPFuDHw3Xlq6Vi/ljMe5NS/VgB53ef1Am9ZMYj0NuDsxaIYJcM0as6P3orMsIXCmz7YB/5lxvPA4rWYN7NmMjAaSLfhYEMq8xxwfooKO8lskzGdZ6MhoYc6j5kTkwxB8qXGEw/txVKubAi5JETFm8EwRcta2x95T9qaRmemsIJyscn79B0BoaOcCFvxxTAxwkiTopYW8aKmVeIuoj81aatxn6DLZOeHdXf24aEamiWpN4YGr3FeQ0ZCluTtpNN9QJzgvjqwFXUh0ntNF+ceSnflTImnDa6B50yFl9Gp/qJtJwnFPw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 192.176.1.74) smtp.rcpttodomain=bootlin.com smtp.mailfrom=ericsson.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=ericsson.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericsson.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cdIndbGZH7EkciV3sZyME1h7TPjx6C9tO2bqnpMlbak=; b=PPCM2W2QS4C1aJ81Pi1DF/pjg0N/n51ODGEdUN3DzkhZkH1OfXIVngzLS4tO10kPAUgiHAAPzKJjunKyptKeK6vj7tpnl39MYIVsqoo34gi3KDXatw0TdB99mnVg/lTDkBaoVCfR3iA2EEZcAm0nNjsprDAsCw/yJLs9fppYOE8Y+FYy7V0dzgKQLLFRteJuUrqVLtif1rTjYONhmEc08iC2sGEyGTY8ful06AcaACC22rAEy4/paVRtqORJlTcr1k3Vy131BOpnnmuooZjAmV50776C0/T44Kxs/yprLUyPwjMhxd4h5D8Q1Ab5Zt12qZUd55j/o2ykImDNq+NmTQ== Received: from AM0PR02CA0133.eurprd02.prod.outlook.com (2603:10a6:20b:28c::30) by PA4PR07MB7069.eurprd07.prod.outlook.com (2603:10a6:102:f4::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.360.13; Wed, 2 Sep 2026 09:57:57 +0000 Received: from AM3PEPF00009B9F.eurprd04.prod.outlook.com (2603:10a6:20b:28c:cafe::76) by AM0PR02CA0133.outlook.office365.com (2603:10a6:20b:28c::30) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.360.13 via Frontend Transport; Wed, 2 Sep 2026 09:57:57 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 192.176.1.74) smtp.mailfrom=ericsson.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=ericsson.com; Received-SPF: Pass (protection.outlook.com: domain of ericsson.com designates 192.176.1.74 as permitted sender) receiver=protection.outlook.com; client-ip=192.176.1.74; helo=oa.msg.ericsson.com; pr=C Received: from oa.msg.ericsson.com (192.176.1.74) by AM3PEPF00009B9F.mail.protection.outlook.com (10.167.16.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.382.8 via Frontend Transport; Wed, 2 Sep 2026 09:57:57 +0000 Received: from seroius18814.sero.gic.ericsson.se (153.88.142.248) by smtp-central.internal.ericsson.com (100.87.178.60) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.37; Wed, 2 Sep 2026 11:57:57 +0200 Received: from seroius08462.sero.gic.ericsson.se (seroius08462.sero.gic.ericsson.se [10.63.237.245]) by seroius18814.sero.gic.ericsson.se (Postfix) with ESMTP id 7C6384020B41; Wed, 2 Sep 2026 11:57:56 +0200 (CEST) Received: by seroius08462.sero.gic.ericsson.se (Postfix, from userid 160155) id 59601700CF25; Wed, 2 Sep 2026 11:57:56 +0200 (CEST) From: To: CC: Chen Qi , Mathieu Dubois-Briand , Richard Purdie , Daniel Turull Subject: [2.18][PATCH 5/5] bb/tests/fetch.py: add case for filter_regex parameter in latest_versionstring Date: Wed, 2 Sep 2026 11:57:38 +0200 Message-ID: <20260902095738.2840120-6-daniel.turull@ericsson.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260902095738.2840120-1-daniel.turull@ericsson.com> References: <20260902095738.2840120-1-daniel.turull@ericsson.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM3PEPF00009B9F:EE_|PA4PR07MB7069:EE_ X-MS-Office365-Filtering-Correlation-Id: 3b0e59da-3f39-43e4-ee7f-08df08d8aa71 X-SMTP-Server: smtp-central.internal.ericsson.com X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|82310400026|23010399003|36860700016|10067099003|3023799007|11063799006|56012099006|22082099003|18002099003; X-Microsoft-Antispam-Message-Info: j7znjHfF3zFZoLLiL1QbCCRZDPZfJeymKS1xGOIk1NjAJLtQgy6bqYqqeU+3VXT8Npz7n3jp/dkJOzZS3f2ykzeVyC6F1TX9rsJ+OByQOeO7AsWErw+lphJx8fJ8Zf3JmYpkpi6JJGZygBLVPndLJ1lzbeR8k7bwMC4Y2Lvx2yeXOlUrHUPeIJG4RqSYpQHCdg69gbRV2nC2L1mUDoq2icwDGa8vzIamfDZHi2jT6K8v6Qs66MfPH8/Auj972EhV2FOQPjjvMsHsP9Ko2ze8QuBHPXN5x/ALH4XF0NrGOqzyCW6YePGH8GeSMWUcQRYzjz9C5mGbD/4wUDauugiAPCRtNEtqpdQvMTNQkYHCMqycGcKMyTnSgP4BlJMey3GqqjNed0ai4ccbfq01c9aDz1HYwxBX+aE9yx9FT9as1w5Ktn77HycsR/LaAAlTmDdrUhCeUTVZXBG/SxpnhbFhiziu4oA2Gu0CVWTSsMvxI3H2kAg6GlewR1J2XdS9QciMz2euTZpiz8DZPp8qcB22UtQNbdZkzGZm4YhQ+ldeCKRf1HGEHerbZFxF/NMAy+7y79zhOPZzcjpGbKCORlPjfZOKGRfHRW5gGFZn0iI2VpaDaMmiVXcMn1mnD18dm1Hf4lPoh+svxxJox7GtgF9nM/sA1WkpYUTEJSusXy9WaB4= X-Forefront-Antispam-Report: CIP:192.176.1.74;CTRY:SE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:oa.msg.ericsson.com;PTR:office365.se.ericsson.net;CAT:NONE;SFS:(13230040)(376014)(1800799024)(82310400026)(23010399003)(36860700016)(10067099003)(3023799007)(11063799006)(56012099006)(22082099003)(18002099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: I4Vfig/6WZt1z5zoTdjlw6j+1LplpvOdsATOSItK/0WOAnztnubSlv6dob+d/PwMazHgmTZVQ4JiDcnGvLPP5fZgwhD2U9MIQO8EYTkYWQZTRs/fUPAu/dR2JjfFSJUIRg31nYFa4yJuaoLzKKN3Nwn39vfhZhB3Y6gnOevOM25WFZfpeuv0VL8cxMUEyqOip3ZIsWAVxgyiUBB/cv+xN4jtAXYvyiXhLu/j0p1UIOcghHRQqbazPq5qqhebeFjSaqhte0iwB5qeN5Z5+r1QhFW4amwebZT2HGxYlxDHvezUT8s5tEUnxSBB4nXEXIlHa9PflgjxUWR3RccBMOkHUBiQ02GUm36XBHsx66G3GR9zOadE98DTdJciTnU3wcA0LfATTm8dhrELh+vL/QPP5u+nKfYFhixpahMvkgWO1N0yTL/9to2vUEcEtGr1+ijt X-OriginatorOrg: ericsson.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Sep 2026 09:57:57.4858 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3b0e59da-3f39-43e4-ee7f-08df08d8aa71 X-MS-Exchange-CrossTenant-Id: 92e84ceb-fbfd-47ab-be52-080c6b87953f X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=92e84ceb-fbfd-47ab-be52-080c6b87953f;Ip=[192.176.1.74];Helo=[oa.msg.ericsson.com] X-MS-Exchange-CrossTenant-AuthSource: AM3PEPF00009B9F.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR07MB7069 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 02 Sep 2026 09:58:13 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/20152 From: Chen Qi Add bitbake selftest case for fitler_regex parameter in latest_versionstring to ensure no regression. Signed-off-by: Chen Qi Signed-off-by: Mathieu Dubois-Briand Signed-off-by: Richard Purdie (cherry picked from commit 63a51b543e17d44c26a82e6ca911ed23e517fc33) Signed-off-by: Daniel Turull --- lib/bb/tests/fetch.py | 78 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 77 insertions(+), 1 deletion(-) diff --git a/lib/bb/tests/fetch.py b/lib/bb/tests/fetch.py index c071401e6..2ebfd6680 100644 --- a/lib/bb/tests/fetch.py +++ b/lib/bb/tests/fetch.py @@ -1577,7 +1577,24 @@ class FetchLatestVersionTest(FetcherTest): # basic example; version pattern "A.B.C+cargo-D.E.F" ("cargo-c", "crate://crates.io/cargo-c/0.9.18+cargo-0.69") : "0.9.29" - } + } + + test_git_stable_uris = { + ("dtc", "git://git.yoctoproject.org/bbfetchtests-dtc.git;branch=master;protocol=https", "65cc4d2748a2c2e6f27f1cf39e07a5dbabd80ebf", "", r"^1\.4\.\d+$") + : ("1.4.0", "1.5.0"), + ("systemd", "git://github.com/systemd/systemd.git;protocol=https;branch=stable/v259-stable", "b3d8fc43e9cb531d958c17ef2cd93b374bc14e8a", "", r"^259\.\d+$") + : ("259.5", "260") + } + + test_wget_stable_uris = { + ("openssh", "https://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-10.2p1.tar.gz", "10.2p1", "", "", r"^10\.2p\d+$") + : ("10.2p1", "10.3") + } + + test_crate_stable_uris = { + ("cargo-c", "crate://crates.io/cargo-c/0.9.18+cargo-0.69", r"^0\.9\.\d+") + : ("0.9.29", "0.10.0") + } @skipIfNoNetwork() def test_git_latest_versionstring(self): @@ -1634,6 +1651,65 @@ class FetchLatestVersionTest(FetcherTest): r = bb.utils.vercmp_string(v, verstring) self.assertTrue(r == -1 or r == 0, msg="Package %s, version: %s <= %s" % (k[0], v, verstring)) + @skipIfNoNetwork() + def test_git_latest_versionstring_stable(self): + for k, v in self.test_git_stable_uris.items(): + with self.subTest(pn=k[0]): + self.d.setVar("PN", k[0]) + self.d.setVar("SRCREV", k[2]) + self.d.setVar("UPSTREAM_CHECK_GITTAGREGEX", k[3]) + filter_regex = k[4] + ud = bb.fetch2.FetchData(k[1], self.d) + pupver= ud.method.latest_versionstring(ud, self.d, filter_regex=filter_regex) + verstring = pupver[0] + self.assertTrue(verstring, msg="Could not find upstream version for %s" % k[0]) + v_less_or_equal = v[0] + v_larger = v[1] + r = bb.utils.vercmp_string(v_less_or_equal, verstring) + self.assertTrue(r == -1 or r == 0, msg="Package %s, version: %s < %s" % (k[0], v_less_or_equal, verstring)) + r = bb.utils.vercmp_string(verstring, v_larger) + self.assertTrue(r == -1, msg="Package %s, version: %s <= %s" % (k[0], v_larger, verstring)) + + @skipIfNoNetwork() + def test_wget_latest_versionstring_stable(self): + for k, v in self.test_wget_stable_uris.items(): + with self.subTest(pn=k[0]): + self.d.setVar("PN", k[0]) + url = k[1] + self.d.setVar("PV", k[2]) + if k[3]: + self.d.setVar("UPSTREAM_CHECK_URI", k[3]) + if k[4]: + self.d.setVar("UPSTREAM_CHECK_REGEX", k[4]) + filter_regex = k[5] + ud = bb.fetch2.FetchData(url, self.d) + pupver= ud.method.latest_versionstring(ud, self.d, filter_regex=filter_regex) + verstring = pupver[0] + self.assertTrue(verstring, msg="Could not find upstream version for %s" % k[0]) + v_less_or_equal = v[0] + v_larger = v[1] + r = bb.utils.vercmp_string(v_less_or_equal, verstring) + self.assertTrue(r == -1 or r == 0, msg="Package %s, version: %s < %s" % (k[0], v_less_or_equal, verstring)) + r = bb.utils.vercmp_string(verstring, v_larger) + self.assertTrue(r == -1, msg="Package %s, version: %s <= %s" % (k[0], v_larger, verstring)) + + @skipIfNoNetwork() + def test_crate_latest_versionstring_stable(self): + for k, v in self.test_crate_stable_uris.items(): + with self.subTest(pn=k[0]): + self.d.setVar("PN", k[0]) + ud = bb.fetch2.FetchData(k[1], self.d) + filter_regex = k[2] + pupver = ud.method.latest_versionstring(ud, self.d, filter_regex=filter_regex) + verstring = pupver[0] + self.assertTrue(verstring, msg="Could not find upstream version for %s" % k[0]) + v_less_or_equal = v[0] + v_larger = v[1] + r = bb.utils.vercmp_string(v_less_or_equal, verstring) + self.assertTrue(r == -1 or r == 0, msg="Package %s, version: %s < %s" % (k[0], v_less_or_equal, verstring)) + r = bb.utils.vercmp_string(verstring, v_larger) + self.assertTrue(r == -1, msg="Package %s, version: %s <= %s" % (k[0], v_larger, verstring)) + class FetchCheckStatusTest(FetcherTest): test_wget_uris = ["https://downloads.yoctoproject.org/releases/sato/sato-engine-0.1.tar.gz", "https://downloads.yoctoproject.org/releases/sato/sato-engine-0.2.tar.gz",