From patchwork Mon May 4 06:36:09 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Turull X-Patchwork-Id: 87463 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 6067ACD3436 for ; Mon, 4 May 2026 06:36:33 +0000 (UTC) Received: from OSPPR02CU001.outbound.protection.outlook.com (OSPPR02CU001.outbound.protection.outlook.com [40.107.159.40]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.9182.1777876589952577506 for ; Sun, 03 May 2026 23:36:30 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@ericsson.com header.s=selector1 header.b=t0D6qjLx; spf=pass (domain: ericsson.com, ip: 40.107.159.40, mailfrom: edaturu@ericsson.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=PBWCHnCcwUXkLMZ98PWpMVqWkstuUgYYSnlVRdJog54t6mwRCqF/ZCvsxqEVRhgoil7ahmHf0rR1EUNv5be0aQ4K2ZlQfX5Y5W31v3xNbQSPDE4J8fTr49XlCDSK/SPEB5knpsJ5kV6UUlWD47kdUWcKM3LiZz+I1RsfU3bTVt2sMZugiYStxIMRqFaiMD5ojMV5sEHRzFkdcKBq3Dxwh4egJ/FPnI8ou85PWzAm4FUwlheHAFKBdtc7CkYwGcDcY3wRjOBSvQOsMLVQFKbct19gnmR67KdhQOB4CaxsgMcSMVGAFuuKIl3HwnTdgjf6wci7JwVNg7mpjDUKUXHhAw== 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=tU5Md78VTt7spqNceUUA7shWNsWLtZs7j9duyWE7ZVM=; b=XRTpZQxNVWqSrAB1oy7FNbugE8b2BgoyZA6sa/s3y9TncfO9YhM9J+fMROTc56EJwt9HT6jwJfM7W8kqsgJx/CUPDdvzG/ARhpP3Qnh3aA5WcW4xz29GxIvp7bpLizF3/AIN2fkSKTRmwnn4o2cJeA73UMwPDQf4DykMbQgpR6cVx7vbTEJRUD7Pm7ihlRHqI7zAjnayiMxVs7Ju3W7In2P0lhAJC8sOycwo7qQMt7DD5807l1BLZ7UIQnHjNF/1wJfeaxiPoqQZEeMe1IIhF1F8FWFas7Ki5AQw9cFPCqefaFivskufpY+zj7X0SUMVkR30j0k4H4qnt/j3kqnbPA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 192.176.1.74) smtp.rcpttodomain=arm.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=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tU5Md78VTt7spqNceUUA7shWNsWLtZs7j9duyWE7ZVM=; b=t0D6qjLx3En/Io/9Njrcy2lvJ/zrnOhhmnKg1ZIR+hsAnDRlRRgevBdacW2fGxGbFJZ+xXOtBfbuQ26zB9w9gxjGoDt18MOnt83OKmBqBCfjCv3bL9J/T7E2RtB4db+xV9IRC3M4WkuMPo5VX3EpbRL3EDM+D8CcdtKFAEH13/phslAlf0DtuFnO5/F3kjwERVxWHNPPT6Gw4mmZ7n6nXtGnpAIcw6b6AxZGlld6Kiu8Cy0nevWPCnk1SiGTekX0xAxgF9Z3uzXMdOoiESyxRNYybjKgdy2blRKni1F9k4edlaEqv9gZRdCST5aMSDmEwcEnBmECPf14+a40ezJ4Xg== Received: from DUZPR01CA0115.eurprd01.prod.exchangelabs.com (2603:10a6:10:4bc::27) by AMBPR07MB11787.eurprd07.prod.outlook.com (2603:10a6:20b:72f::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9870.25; Mon, 4 May 2026 06:36:26 +0000 Received: from DB1PEPF000509F9.eurprd02.prod.outlook.com (2603:10a6:10:4bc:cafe::4) by DUZPR01CA0115.outlook.office365.com (2603:10a6:10:4bc::27) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9870.25 via Frontend Transport; Mon, 4 May 2026 06:36:26 +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 DB1PEPF000509F9.mail.protection.outlook.com (10.167.242.155) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9891.9 via Frontend Transport; Mon, 4 May 2026 06:36:26 +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.29; Mon, 4 May 2026 08:36:23 +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 BF2844020673; Mon, 4 May 2026 08:36:22 +0200 (CEST) Received: by seroius08462.sero.gic.ericsson.se (Postfix, from userid 160155) id AB4A5700DB92; Mon, 4 May 2026 08:36:22 +0200 (CEST) From: To: , CC: , , , Subject: [AUH][PATCH v3 1/4] steps.py: resolve symlinks in recipe_dir Date: Mon, 4 May 2026 08:36:09 +0200 Message-ID: <20260504063614.3831203-2-daniel.turull@ericsson.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260504063614.3831203-1-daniel.turull@ericsson.com> References: <20260504063614.3831203-1-daniel.turull@ericsson.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB1PEPF000509F9:EE_|AMBPR07MB11787:EE_ X-MS-Office365-Filtering-Correlation-Id: cc916e98-4f24-42af-6be0-08dea9a77779 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|1800799024|82310400026|56012099003|18002099003|22082099003; X-Microsoft-Antispam-Message-Info: thDpfofB3kjpqdlAiTOxkzkB1bweX4+5qAJ0GgVAiYf7lU3DZwSr1cyMPT6upKez8TdA/cRAaifFppNrSiiB98GM0CSYJ0D0aaxB1h2cs0aPY9ZthL5yc7C9q8PyZ1W2XBV1gqkE7d+e9GFdrRx8/DCY/5nxmb6jwrsNKrETknNo/bXPsCl/hBsoP7f6VtLk1SuojEX92hAglDTAcKaD2Zg3lqcWpFvtVtia03/PEn3ttddAzOAI5BAuI2iKqcqAPqgc+LkFzS3zpBgUGWudB7iLaToTfSBM7349mTeDWF2/Z/t3dKjGcMCvGZfhhtzYFhvMGikmtqsC+dkh6AWhkIR22fGH1hMKj0i2/MwSj4l0QmIgYa3XsMq/jwwbjy1EUi5Jq4uAv1WnhOZAmIdsj8gISgSltp2jiZduKiZ/06igvw9QjV8HhSLKOgwKPzLEDcJ+PO6hc4cGpEQwJxe2z/KafYoezm6ZmlDxffPOOr7puA4o+5ezL3K34WlqYI5oKAoEVOTHlNmvJApDM5yyRurawO7RhyOWcz0WaP234CvxNWDe7j9FifBtVVgqJHnYe5jkC/nI+8Tc7jLClNjGftmTuLSW9Muw//1jjZpEutE/5APMGbBUm/nr1IU7Qh/9ViiSVHb2ZeAseiQ5zP5h2GgpS8VTQfMsUSg4hu9/rlmc57IdhI4sO6A183/p4kbF/IFeaMOu4NUCRonxbyQHGjgiBHA/9OYzxVBFOXzqxrg= 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)(1800799024)(82310400026)(56012099003)(18002099003)(22082099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 9xr1Gd6Qjg5VBgVyHAqUhhUEt/WomZcBLuREZhSY7IlCuklhnSgWN6/3o0FYj76rMmYLG/t7mm1APLcdBjg+jpFaMuzKtJBpg4aXbY2HXFqcwHd50fgKrzmoiN/3MDCBRxQslaQD7YnLJnO5uY2YWcbvVs3rvwKEDnAwvsPVS5B6yiE15fee6D2AhoqtxhEPK/Os6xRvQk45DTBj0VaiqSTBdB5laanHYxMhWFe2eNgH1w+ZQ2GDYaCHs9Q5Idola7cTxNp9RWZzflK4l+kVqeyIjs0sWwF2rzj3R+bVy8Okw9A0ymrimOA4rMTQpCoTxAIYJchzeQH5NPs6kzKTNwR+SzkniiDTLbqSa2C2yZcuXymt8PaxFI1dpyyTYU81+wx5SruinjVurn4Z/rMGY+PmwjxSyfvOYQSkPDEYZT3N2VC/tVY5tUqgYH5ZR3JP X-OriginatorOrg: ericsson.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 May 2026 06:36:26.1483 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cc916e98-4f24-42af-6be0-08dea9a77779 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: DB1PEPF000509F9.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AMBPR07MB11787 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 ; Mon, 04 May 2026 06:36:33 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto-patches/message/3898 From: Daniel Turull Use os.path.realpath() on recipe_dir so that git operations work when bblayers.conf references layers through symlinks (e.g. meta -> openembedded-core/meta). Without this, git add fails because the symlinked path is outside the git repo. Assisted-by: kiro:claude-opus-4.6 Signed-off-by: Daniel Turull --- modules/steps.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/steps.py b/modules/steps.py index a6ec341..b3ec61c 100644 --- a/modules/steps.py +++ b/modules/steps.py @@ -36,7 +36,7 @@ def load_env(devtool, bb, git, opts, group): os.mkdir(group['workdir']) for pkg_ctx in group['pkgs']: pkg_ctx['env'] = bb.env(pkg_ctx['PN']) - pkg_ctx['recipe_dir'] = os.path.dirname(pkg_ctx['env']['FILE']) + pkg_ctx['recipe_dir'] = os.path.realpath(os.path.dirname(pkg_ctx['env']['FILE'])) def buildhistory_init(devtool, bb, git, opts, group): if not opts['buildhistory']: From patchwork Mon May 4 06:36:10 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Turull X-Patchwork-Id: 87464 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 CDA38FF885A for ; Mon, 4 May 2026 06:36:32 +0000 (UTC) Received: from PA4PR04CU001.outbound.protection.outlook.com (PA4PR04CU001.outbound.protection.outlook.com [40.107.162.8]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.9184.1777876591522821079 for ; Sun, 03 May 2026 23:36:31 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@ericsson.com header.s=selector1 header.b=Rhq7dWio; spf=pass (domain: ericsson.com, ip: 40.107.162.8, mailfrom: edaturu@ericsson.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=mwLV5bFvdwoHUaZhuFIOtkRZoXfxF+mV+nC+i7eFi2w4N4eLG/3UP6deyUqs3gNFW9VmbABzM8H8rdDXFdpvKbI9HEg/lg4npKzBQwT71nmQbhIxdGO5evSCZnxTzbG/7mOuM4GK6cMpM0aLHyi67E08Iq9GdN5PC5JjxeiYlY4c3F6ystJoXTj8qLQ1CPnF/4DaolGFCvxJhUdgd7TJUNLQBMoM1Wzl+RrPo71imboGmPWABVCicEutyLar2RmqqA1VRsDgoDhv5gs4PiJ7uQyFu19Nyf40i8Qyl8WChvqpFU/2aZ09N3/rJjw95Vpt0DcpR6ud9NCEBsHkGW95MQ== 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=YADxAm3orDF3CHpqrbA74XUx5UoJ5YI6SvEalGdUJqk=; b=dAuM5l5QgFzfZVg6vnXCacNtqZ9UwN/cy2fR0bBT/4cR7e8sH66YkWHUmKV3JKR6Ax+MQUWv9b40ye74xzoexug3NvhZfpOHQfsd5TObJgdZs1wftkECddRQYtqGcnkuY4KVYKOt+yM7b2HLk03rfaokQcL3F/jKeW7wcGXMFGZ8cy7R2bOZ3xpM/nfPlIioPiLykOu9CIxA7RRwzl1u5PfNiu94kK5zhfYLBUiVd8OZkLR6ghKVU9yfjoHdIOrXyadkIhtmZPm3XMAe39OZLNR3oyZKJVyCYQGbcdwYHaSWkNbEW28iPq5A7/7J+LdZTrucOrVKkOzMbLUR66tUqg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 192.176.1.74) smtp.rcpttodomain=arm.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=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YADxAm3orDF3CHpqrbA74XUx5UoJ5YI6SvEalGdUJqk=; b=Rhq7dWio5VggdC4MGXqmbcD8nW7fjIeQiGm5vceQMysR8CJejE/4DeMi7Vzuxl6qfwO723CxY5OUC1ILPoJMQK08XSLUhnsjv358Z/tav5vBYI9PTZahBxt/TUtMhVSDHdo78rfAexwA2XQwZNX6qD2w5VCVwuAUsdCnwmEOJia7htKu1tpn5LD10sQHmktND24/QD5Cpkzw39arucrlLO7mqhkh7S2P6YX+yd0VxhkztJA6g1CY3XcfZOhNLR6KfDHM1VXep1sLeKA4J899wkgOCEgMV50btr3cHTqn//tmqJ8KFnw+EhlmXJt/ObX8TYFQN72Vp1zFDm5l3EeIjA== Received: from DU7PR01CA0026.eurprd01.prod.exchangelabs.com (2603:10a6:10:50e::22) by PAXPR07MB8030.eurprd07.prod.outlook.com (2603:10a6:102:131::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9870.25; Mon, 4 May 2026 06:36:25 +0000 Received: from DU6PEPF00009525.eurprd02.prod.outlook.com (2603:10a6:10:50e:cafe::cd) by DU7PR01CA0026.outlook.office365.com (2603:10a6:10:50e::22) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9870.25 via Frontend Transport; Mon, 4 May 2026 06:36:25 +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 DU6PEPF00009525.mail.protection.outlook.com (10.167.8.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9891.9 via Frontend Transport; Mon, 4 May 2026 06:36:25 +0000 Received: from seroius18813.sero.gic.ericsson.se (153.88.142.248) by smtp-central.internal.ericsson.com (100.87.178.63) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.29; Mon, 4 May 2026 08:36:23 +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 C40FC9569F; Mon, 4 May 2026 08:36:22 +0200 (CEST) Received: by seroius08462.sero.gic.ericsson.se (Postfix, from userid 160155) id AFC5D700DB93; Mon, 4 May 2026 08:36:22 +0200 (CEST) From: To: , CC: , , , Subject: [AUH][PATCH v3 2/4] upgrade-helper.py: Add compatibility with Yocto scarthgap Date: Mon, 4 May 2026 08:36:10 +0200 Message-ID: <20260504063614.3831203-3-daniel.turull@ericsson.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260504063614.3831203-1-daniel.turull@ericsson.com> References: <20260504063614.3831203-1-daniel.turull@ericsson.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU6PEPF00009525:EE_|PAXPR07MB8030:EE_ X-MS-Office365-Filtering-Correlation-Id: 6cf1da25-b35b-4d7f-fd97-08dea9a77716 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|1800799024|36860700016|376014|18002099003|22082099003|56012099003; X-Microsoft-Antispam-Message-Info: FRbtAKUk2Q0nCOqp+ASs4xsL2ECn2MmhRDe3N+KZSqnsYQ/GTyDEaU5layMQlQ1PqpvpMfxrw4dCqGP558B3zvo2xhQhO1LRPWVTAy/SK95MkRLT7IAtNHaJVFGTkGMuVOq6VS6AQczeqXeM+wHqsuctQtaVg7Xpks1YEQr8Wyk9xJAuJoUPwxRFC3OSC7zglt7pdyRHbU6fgDaNK5DG42NJJUtNVtGO2inFJARfRe9dsWoaETz7ANWodowkRC6YPBKWAI4NrG6/Or5+6LfjT2+OyeTe/5jchBEPX21M9PBfkvjrDbGEyZ3R6CFu1kE+9Cq/xxrjkCLromXvi4RGd2KQzSqHbMh1y/74eTF8LgDHhSBejMV6MnrayfvIHC6vQULw5bl5/AHXHAcXh2YdmTNiyG1zzJTlSebqS0UEVs5uRxgmudnHR/VIBLKZlwwh+J4/mjS2NNv0YyoIS/mGJ/RpHoSfLZTXu95fvmMfPKs6ZlEgU0maybzPSsaNUsrhP4cV2bpCfK7wfGsql+yZkCIfZ6ljnQuVDURMd5kKkEl7RpRaDADtDfSDsgSN1I1sK4Cv97yGge2pk9pqm9unVSk1dxiMQ/9XYGCdBfnhzPIY8oyIVccEBvcO99L/4r/zlK28k0rRXosQ+P/luIz+/GUw2tGTaBbRchyZFMiy3pOEwmjPHyVp8hoEKzS24xb4JfHZAffUHA7FHTFb6iZiH3jFf/LSssXIcssi9WkUwxY= 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)(1800799024)(36860700016)(376014)(18002099003)(22082099003)(56012099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: k0Yjo66IZbVGgX1ybpOg+s2uDXATB7li/URzKikoNFGT1NKPx1kNr+9K9+kYxu94uCeJmdzMZsrD8kIejaC44SrHXqlAs2GCsA1dpbrBTI7M3qT4ti8tXywR1DqQ0uRT0wdyvthdt7RaPXGKoyYaR64/QtanalBsfG5TjmIQCZTFqPrVc1oIhmLaeE8pyiwht6bJam4nEoYIqO7vm18Xess5lGTy3KS3QAO3/TFBInZB7eX03xY0qlVGAySgkjp4CoViO1m9RJXIq8o0bGb8CEtSuRG+R2azBS6LjLVlQlzc5WmIJ4VWPNqzSuzsxDQF2RVeFtjKntW3rdxCskVFpnCV2Be6BWWB8aaLLvkiCUGM0EM7eMJDGcFo58irMb+d0DKu7HXcUd8dFWHm/nYJjsac3tt8r77khW9vgGgBFiCDS8SzVYVzsnrGSoImJbcT X-OriginatorOrg: ericsson.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 May 2026 06:36:25.5007 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6cf1da25-b35b-4d7f-fd97-08dea9a77716 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: DU6PEPF00009525.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR07MB8030 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 ; Mon, 04 May 2026 06:36:32 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto-patches/message/3900 From: Daniel Turull - Handle flat tuple format from get_recipe_upgrade_status (scarthgap) in addition to the list-of-dicts format (master). Scarthgap's _get_recipe_upgrade_status returns a plain tuple of 7 elements per recipe; detect this with isinstance(group, tuple) and normalize. Add a length assertion to catch upstream schema changes early. - Fallback to MACHINE env var when bitbake-config-build is not available (not present in scarthgap). Assisted-by: kiro:claude-opus-4.6 Signed-off-by: Daniel Turull --- modules/utils/bitbake.py | 11 +++++++++-- upgrade-helper.py | 12 ++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/modules/utils/bitbake.py b/modules/utils/bitbake.py index 5514c98..bd670d0 100644 --- a/modules/utils/bitbake.py +++ b/modules/utils/bitbake.py @@ -24,6 +24,7 @@ # import os +import shutil from logging import debug as D import sys import re @@ -123,8 +124,14 @@ class Bitbake(object): env = "TCLIBC={}".format(libc) else: env = "" - bb.process.run("bitbake-config-build enable-fragment machine/{}".format(machine)) - return self._cmd(recipe, env_var=env) + if shutil.which("bitbake-config-build"): + bb.process.run("bitbake-config-build enable-fragment machine/{}".format(machine)) + env_var = env if env else None + else: + D("bitbake-config-build not found, using MACHINE env var") + env_var = "MACHINE={}{}".format(machine, + " " + env if env else "") + return self._cmd(recipe, env_var=env_var) def dependency_graph(self, package_list): return self._cmd(package_list, "-g") diff --git a/upgrade-helper.py b/upgrade-helper.py index 40f31c4..9954a66 100755 --- a/upgrade-helper.py +++ b/upgrade-helper.py @@ -714,6 +714,18 @@ class UniverseUpdater(Updater): pkggroups = oe.recipeutils.get_recipe_upgrade_status(layer_recipes) for group in pkggroups: + + # Scarthgap returns flat tuples from _get_recipe_upgrade_status(); + # field order: (pn, status, cur_ver, next_ver, maintainer, + # revision, no_upgrade_reason) — see oe/recipeutils.py. + if isinstance(group, tuple): + assert len(group) == 7, \ + "unexpected tuple length %d from get_recipe_upgrade_status" % len(group) + pn, status, cur_ver, next_ver, maintainer, revision, no_upgrade_reason = group + group = [{'pn': pn, 'status': status, 'cur_ver': cur_ver, + 'next_ver': next_ver, 'maintainer': maintainer, + 'revision': revision, 'no_upgrade_reason': no_upgrade_reason}] + upgrade_group = [] for pkg in group: maintainer = pkg['maintainer'] From patchwork Mon May 4 06:36:11 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Turull X-Patchwork-Id: 87465 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 11B9ECD342F for ; Mon, 4 May 2026 06:36:33 +0000 (UTC) Received: from OSPPR02CU001.outbound.protection.outlook.com (OSPPR02CU001.outbound.protection.outlook.com [40.107.159.61]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.9183.1777876590142260986 for ; Sun, 03 May 2026 23:36:30 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@ericsson.com header.s=selector1 header.b=WQYAcmyG; spf=pass (domain: ericsson.com, ip: 40.107.159.61, mailfrom: edaturu@ericsson.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=bmvOND6EoMLiqWoNHGE41vWtdwhc5zZpVtZWVbABQe/V/5cpZEUs7MpSrVIVrChTGZ748tBwoQ+JfFkawAXTIIyhjBpB+qd3vq0E/EqSAUVRmhoIFnklog1OraqfJau/P7HI0WCgUPP4N159+98yH5dQeQsOhdJJWUO9oNAp4yvqOikLCWhLT+C/yt+Ym2W7uHv8j6oZ3bry20R8B9XfuLi4hy7/I8++hnC31TAsZAvIZzUo6kPwhs+zdVxnzomRu0PgdB1cJZxyii9moKmYAQbNR9IEynTeYyzfTHWlYcTF6zM/tjARbiJY+b1NQOYqLnLtqIe4GZ1QSJn3vkixrQ== 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=bpFmFRCFsHuQ3E+OmRNAXJn59TPAnX3kFgdq+CDw6oE=; b=WxMY56zdZ6Lb5HHjt2HawFBvmW4RuhJZ+QK9JP8v5wKvTOaFhGyXOYce/0O6AlRPHq4WZ5cqd0nYYqxRqmEacCGgeqpq1uz8wiU6LoGy73Z9q1EbXqA7IMdYfS/1GNeCzvfmM4PgjKW65XmI9J4sl201WggGrNhPCpJwMOGJiwL0GDEQRQ8m4NCfh8NdheguQFrLO8bWME+siTYB350+lUZsatZ8CacZcQYLgYg7RFJ0qc5L9DA/XNvfehKvKPbcQVh41Bi6EzW9/7DgGJnAM3PRhfeBEIfKYsiasagSGhaqN1vFolMGckzBSzTYcp196uAsTmPlfbSB+C3NGQhdSw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 192.176.1.74) smtp.rcpttodomain=arm.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=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bpFmFRCFsHuQ3E+OmRNAXJn59TPAnX3kFgdq+CDw6oE=; b=WQYAcmyGrgGo8bTAjEFoxMNXnjbDUVag2q0WEfvX5ezZLXbVLZvc+UisWol4ddDX7FP2vKPIp5dMw6pFm6/m0+6Lp/T5TmSIGp2Vmr6M0O8Pz/Pa7P6gCm0H58P+Zs6fKsaYQW3sD8dKh38gQzdUPWC8H8J070NyhKQfEgW72+Mrb3Tat6F6rpVrneHK0IiSSsMWO9ecWpzg4bSyIiTIY4sLN9zgA8/5Bw6eXaeM62HrriM3EKjyvx0TeW63wYFINze8/G8qghRnjRrRAdib75e0wguPgz+JN6S/02pAKa+DB9uatixsQeuqcUezu2GVAp3Z55tTzDT0DTWyUWtmaw== Received: from CWLP123CA0228.GBRP123.PROD.OUTLOOK.COM (2603:10a6:400:19f::20) by DB9PR07MB11090.eurprd07.prod.outlook.com (2603:10a6:10:5fb::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9870.25; Mon, 4 May 2026 06:36:23 +0000 Received: from AM3PEPF00009B9F.eurprd04.prod.outlook.com (2603:10a6:400:19f:cafe::27) by CWLP123CA0228.outlook.office365.com (2603:10a6:400:19f::20) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9870.25 via Frontend Transport; Mon, 4 May 2026 06:36:23 +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.20.9891.9 via Frontend Transport; Mon, 4 May 2026 06:36:23 +0000 Received: from seroius18814.sero.gic.ericsson.se (153.88.142.248) by smtp-central.internal.ericsson.com (100.87.178.65) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.29; Mon, 4 May 2026 08:36:23 +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 C9A594020B7B; Mon, 4 May 2026 08:36:22 +0200 (CEST) Received: by seroius08462.sero.gic.ericsson.se (Postfix, from userid 160155) id B467A700DB94; Mon, 4 May 2026 08:36:22 +0200 (CEST) From: To: , CC: , , , Subject: [AUH][PATCH v3 3/4] upgrade-helper.py: Add stable option for patch-only upgrades Date: Mon, 4 May 2026 08:36:11 +0200 Message-ID: <20260504063614.3831203-4-daniel.turull@ericsson.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260504063614.3831203-1-daniel.turull@ericsson.com> References: <20260504063614.3831203-1-daniel.turull@ericsson.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM3PEPF00009B9F:EE_|DB9PR07MB11090:EE_ X-MS-Office365-Filtering-Correlation-Id: 97777bdb-fc19-47c3-7bdb-08dea9a775f3 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|36860700016|22082099003|18002099003|56012099003; X-Microsoft-Antispam-Message-Info: C0WN0UXKkPUAM+IfUEv4/WjmtRnrUHCOQXyuyKnbNwzpcnwgcEcO0RGQXu9uxwqSxFUdp6srgvS23Mo3mAAdbc6vO97jgyHioS3QwMG2TiCbJ1yGB6IFd9rrzfD3Hf7JxaoukDz84Rj3lQBO4BAa6wSXqGJv5dBLt5wnKf3OMFShbO+ayOJhwe9iqoMM5KPXtXuP2TW2/ZqjUzyqgN7VG72afHEi4hPBr1B2U9NWuikBu+4bNnCAkuuW8YTmqeCBXB+DfACttFXY48ZGbyUIWyPTfgQbiS86S1GhqbOPltOiWetjpvJNfh0Llf3ZxLy2mTIgo0P7hhCgQvt5Dr68IVVYpi5oGj517QBUTrht+QZY3BWGKzd6g00BNaXTsSNNW9vvyvy01dtBbbf/HPH7L+AmjqQHk+PPbXd8i+wmKfhSxEwWfp18sZCnM0+a1EqMZ6054u84jDD2rb19+irkGkWjUhEZDK8IijhovnWjFfi/IsBYes56nnrGaTh2SVmtPbNQUfmkXeOQk5jzLpMJxjY+YVAJjIJMy1hRo3t8crAx1BbT1la0XwIYt/3SLFqzzsfPBMS/DB3yHSIE0fAGr5TWj+QkMosX6U3KdeniZZ5BV2wTc3cnuE1YTg8lUUtc6AGTEdmolzS6W9hzfvBnhqCD7x4aS5+udJuERWaaMlJkzv/Dj9DY+3kmMuklB3BjMFT36x/mfrMPzDHPy8z8F8OeKJs9VykQFBI/lkSpHOg= 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)(36860700016)(22082099003)(18002099003)(56012099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: XN9mVv5b4YqlcMPCrdzfawO/Fc5abXb4sDPliuMr405okmFN7/VsX+Wd6S+BE+sCqiuh6YpKflZXpxKCIiPJ2f4p8lSv9TfQRu0XJS9XaOejYaLaYmDA3ZPq4swBHMr0asp0hTrAFAaY7HWtWuKdmJQVr3am616vGsgIKrqUE0Pzs4sdXXku8siISRxGbzWk3GAKylYgHiSTOYOeOup7tuuj4bBoED8jBFgJ3izcR5/xex4VvJTd7tlA6Sje/u6NdaAxcIksNCIec4qrgjrNFucsTpROpsC3keRULflPZA/0mqmQkCLwfc5XvqP5dWwiHquIs37UuRXHo8iw482KloWI0vbkKEPrnyPFMDEGR4VvEeY5FdOKHy0MOzhapfNjyMQEk4trI1t6g8C0jKpNJSV8429vLgQruXxTFHDGV43yBbEaV6nG+T7UhFI4erPC X-OriginatorOrg: ericsson.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 May 2026 06:36:23.6112 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 97777bdb-fc19-47c3-7bdb-08dea9a775f3 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: DB9PR07MB11090 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 ; Mon, 04 May 2026 06:36:33 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto-patches/message/3899 From: Daniel Turull Add --stable flag to restrict upgrades to the next patch version within the current stable branch (e.g. 1.2.3 -> 1.2.4). When the latest upstream version is a major/minor bump, AUH queries all available versions and picks the best patch-level update. Per-recipe policy can be overridden via AUH_UPGRADE_POLICY (read from tinfoil), supporting 'patch' (default), 'minor', and 'none' values. Quick-path optimization: recipes where next_ver is already a patch update are accepted without opening tinfoil. Tinfoil is only opened for recipes that need policy lookup or version scanning. Assisted-by: kiro:claude-opus-4.6 Signed-off-by: Daniel Turull --- modules/utils/version.py | 185 +++++++++++++++++++++++++++++++++++++++ upgrade-helper.py | 104 ++++++++++++++++++++++ 2 files changed, 289 insertions(+) create mode 100644 modules/utils/version.py diff --git a/modules/utils/version.py b/modules/utils/version.py new file mode 100644 index 0000000..4417bd5 --- /dev/null +++ b/modules/utils/version.py @@ -0,0 +1,185 @@ +# SPDX-License-Identifier: GPL-2.0-or-later +# +# Version utilities for --stable patch-only upgrades. +# +# get_all_upstream_versions() collects *all* available upstream versions so +# that we can pick the highest patch-level release within the current stable +# branch. The existing bitbake/oe-core APIs (latest_versionstring, +# get_recipe_upstream_version) only return the single highest version, so we +# must re-implement the inner loops here. +# +# The HTTP path mirrors bb.fetch2.wget.Wget._check_latest_version() and the +# git path mirrors bb.fetch2.git.Git.latest_versionstring(), both from +# bitbake scarthgap. We cannot modify oe-core on a stable release, hence +# the duplication. +# +# Requires: beautifulsoup4 (python3-beautifulsoup4 in oe-core) + +import functools +import re +from logging import warning as W + +import bb.utils +import bb.fetch2 +from bs4 import BeautifulSoup, SoupStrainer + + +def _split_version(ver): + # Split on '.', '-', '_' and letter-digit boundaries (e.g. 10.0p2 -> [10, 0, p, 2]) + parts = re.split(r'[\.\-_]', ver) + result = [] + for p in parts: + result.extend(re.split(r'(?<=[a-zA-Z])(?=\d)|(?<=\d)(?=[a-zA-Z])', p)) + return result + + +def is_patch_update(current_ver, candidate_ver): + """Check if candidate is a patch-level update. + + A patch update changes only the last version component while keeping + all preceding components identical. Also accepts sub-patch extensions + (e.g. 1.2.3 -> 1.2.3.1). + """ + cur = _split_version(current_ver) + cand = _split_version(candidate_ver) + if len(cur) < 2 or len(cand) < 2: + return False + if bb.utils.vercmp_string(candidate_ver, current_ver) <= 0: + return False + # All but the last component of the current version must match + # the corresponding prefix of the candidate + if len(cand) < len(cur): + return False + return cur[:-1] == cand[:len(cur) - 1] + + +def is_minor_update(current_ver, candidate_ver): + """Check if candidate is a newer release within the same major version.""" + cur = _split_version(current_ver) + cand = _split_version(candidate_ver) + if len(cur) < 2 or len(cand) < 2: + return False + if cur[0] != cand[0]: + return False + return bb.utils.vercmp_string(candidate_ver, current_ver) > 0 + + +def _find_best_version(current_ver, all_versions, filter_fn): + candidates = [v for v in all_versions if filter_fn(current_ver, v)] + if not candidates: + return None + candidates.sort( + key=functools.cmp_to_key(bb.utils.vercmp_string), reverse=True + ) + return candidates[0] + + +def find_patch_version(current_ver, all_versions): + return _find_best_version(current_ver, all_versions, is_patch_update) + + +def find_minor_version(current_ver, all_versions): + return _find_best_version(current_ver, all_versions, is_minor_update) + + +def get_all_upstream_versions(rd): + """Get all upstream versions using the fetcher infrastructure. + + Unlike ud.method.latest_versionstring() which returns only the highest + version, this collects every version so the caller can filter for + patch-only updates. + """ + src_uris = rd.getVar('SRC_URI') + if not src_uris: + return [] + + src_uri = src_uris.split()[0] + fetch = bb.fetch2.Fetch([src_uri], rd) + ud = fetch.ud[fetch.urls[0]] + + if ud.type == 'git': + return _get_git_versions(ud, rd) + return _get_http_versions(ud, rd) + + +def _get_http_versions(ud, rd): + """Collect all upstream versions from an HTTP index page. + + Adapted from bb.fetch2.wget.Wget._check_latest_version() and + ._init_regexes(). The upstream code only keeps the highest version; + we collect them all. Uses BeautifulSoup to parse tags, matching + the upstream behaviour. + """ + try: + package = ud.path.split("/")[-1] + + regex_uri = rd.getVar('UPSTREAM_CHECK_URI') + if not regex_uri: + path = ud.path.split(package)[0] + regex_uri = bb.fetch2.encodeurl([ud.type, ud.host, path, + ud.user, ud.pswd, {}]) + + page = ud.method._fetch_index(regex_uri, ud, rd) + if not page: + return [] + + regex = rd.getVar('UPSTREAM_CHECK_REGEX') + if regex: + regex = re.compile(regex) + else: + regex = ud.method._init_regexes(package, ud, rd) + if not regex: + return [] + + # Parse HTML links, same as Wget._check_latest_version() + soup = BeautifulSoup(page, "html.parser", + parse_only=SoupStrainer("a")) + if not soup: + return [] + + versions = set() + for link in soup.find_all('a', href=True): + for text in (link['href'], str(link)): + m = regex.search(text) + if m and 'pver' in m.groupdict() and m.group('pver'): + versions.add(re.sub('_', '.', m.group('pver'))) + break + return list(versions) + except Exception as e: + W(" Failed to get HTTP versions: %s" % e) + return [] + + +def _get_git_versions(ud, rd): + """Collect all tagged versions from a git remote. + + Adapted from bb.fetch2.git.Git.latest_versionstring(). The upstream + code only keeps the highest version; we collect them all. + """ + try: + output = ud.method._lsremote(ud, rd, "refs/tags/*") + except (bb.fetch2.FetchError, bb.fetch2.NetworkAccess, OSError) as e: + W(" Failed to list remote tags: %s" % e) + return [] + + rev_tag_re = re.compile(r"([0-9a-f]{40})\s+refs/tags/(.*)") + pver_re = re.compile( + rd.getVar('UPSTREAM_CHECK_GITTAGREGEX') + or r"(?P([0-9][\.|_]?)+)" + ) + nonrel_re = re.compile(r"(alpha|beta|rc|final)+") + + versions = set() + for line in output.split("\n"): + if not line: + continue + m = rev_tag_re.match(line) + if not m: + continue + tag = m.group(2) + if nonrel_re.search(tag): + continue + m = pver_re.search(tag) + if m: + versions.add(m.group('pver').replace("_", ".")) + return list(versions) diff --git a/upgrade-helper.py b/upgrade-helper.py index 9954a66..aecb207 100755 --- a/upgrade-helper.py +++ b/upgrade-helper.py @@ -59,6 +59,9 @@ from utils.emailhandler import Email from statistics import Statistics from steps import upgrade_steps from testimage import TestImage +from utils.version import (is_patch_update, find_patch_version, + is_minor_update, find_minor_version, + get_all_upstream_versions) if not os.getenv('BUILDDIR', False): E(" You must source oe-init-build-env before running this script!\n") @@ -74,6 +77,7 @@ scriptpath.add_bitbake_lib_path() scriptpath.add_oe_lib_path() import oe.recipeutils +import bb.tinfoil help_text = """Usage examples: * To upgrade xmodmap recipe to the latest available version: @@ -96,6 +100,9 @@ def parse_cmdline(): parser.add_argument("-t", "--to_version", help="version to upgrade the recipe to") + parser.add_argument("--stable", action="store_true", default=False, + help="only upgrade to the next patch version within the stable branch (e.g. 1.2.3 -> 1.2.4)") + parser.add_argument("-d", "--debug-level", type=int, default=4, choices=range(1, 6), help="set the debug level: CRITICAL=1, ERROR=2, WARNING=3, INFO=4, DEBUG=5") parser.add_argument("-e", "--send-emails", action="store_true", default=False, @@ -679,6 +686,67 @@ class UniverseUpdater(Updater): def _get_packagegroups_to_upgrade(self, packages=None): + def _resolve_stable_version(pn, cur_ver, next_ver, tinfoil): + """Find the best version within the policy allowed by AUH_UPGRADE_POLICY. + + Only called when --stable is active. --stable enables version + filtering globally; AUH_UPGRADE_POLICY overrides the policy + per-recipe within that filtering. + + AUH_UPGRADE_POLICY can be set per-recipe in local.conf or in the + recipe itself: + "patch" (default) - only patch-level updates (e.g. 1.2.3 -> 1.2.4) + "minor" - same-major updates (e.g. 1.2.3 -> 1.3.0) + "none" - skip this recipe entirely + """ + # Quick path: if next_ver is already a patch update, accept it + # without parsing the recipe (covers the common case). + if is_patch_update(cur_ver, next_ver): + return next_ver, None + + try: + rd = tinfoil.parse_recipe(pn) + except Exception: + rd = None + if not rd: + I(" %s: could not parse recipe, skipping" % pn) + return None, None + + policy = (rd.getVar('AUH_UPGRADE_POLICY') or 'patch').strip().lower() + if policy not in ('patch', 'minor', 'none'): + W(" %s: unrecognized AUH_UPGRADE_POLICY '%s'," + " defaulting to 'patch'" % (pn, policy)) + policy = 'patch' + if policy == 'none': + I(" %s: AUH_UPGRADE_POLICY=none, skipping" % pn) + return None, None + + if policy == 'minor': + check_fn = is_minor_update + find_fn = find_minor_version + else: + check_fn = is_patch_update + find_fn = find_patch_version + + if check_fn(cur_ver, next_ver): + return next_ver, None + + I(" %s: latest version %s is not a %s update from %s," + " searching for versions..." % + (pn, next_ver, policy, cur_ver)) + try: + all_versions = get_all_upstream_versions(rd) + ver = find_fn(cur_ver, all_versions) + if ver: + I(" %s: found version %s" % (pn, ver)) + return ver, "N/A" + else: + I(" %s: no suitable version available, skipping" % pn) + return None, None + except Exception as e: + I(" %s: failed to search for versions: %s" % (pn, e)) + return None, None + # Prepare a single pkg dict data (or None is not upgradable) from recipeutils.get_recipe_upgrade_status data. def _get_pkg_to_upgrade(self, layer_name, pn, status, cur_ver, next_ver, maintainer, revision, no_upgrade_reason): pkg_to_upgrade = None @@ -736,6 +804,42 @@ class UniverseUpdater(Updater): upgrade_group.append(pkg_to_upgrade) if upgrade_group: upgrade_pkggroups.append(upgrade_group) + + if self.args.stable and upgrade_pkggroups: + # Quick-path: accept packages where next_ver is already a patch + # update without opening tinfoil. For the rest, tinfoil must + # remain open because bb.fetch2.Fetch needs a live rd object. + needs_tinfoil = [] + for group in upgrade_pkggroups: + quick_group = [] + slow_pkgs = [] + for pkg in group: + if is_patch_update(pkg['cur_ver'], pkg['next_ver']): + quick_group.append(pkg) + else: + slow_pkgs.append(pkg) + if quick_group or slow_pkgs: + needs_tinfoil.append((quick_group, slow_pkgs)) + + if any(slow for _, slow in needs_tinfoil): + stable_tinfoil = bb.tinfoil.Tinfoil() + stable_tinfoil.prepare(config_only=False) + try: + for quick_group, slow_pkgs in needs_tinfoil: + for pkg in slow_pkgs: + ver, rev = _resolve_stable_version( + pkg['pn'], pkg['cur_ver'], + pkg['next_ver'], stable_tinfoil) + if ver is not None: + pkg['next_ver'] = ver + if rev is not None: + pkg['revision'] = rev + quick_group.append(pkg) + finally: + stable_tinfoil.shutdown() + + upgrade_pkggroups = [g for g, _ in needs_tinfoil if g] + return upgrade_pkggroups def pkg_upgrade_handler(self, pkg_ctx): From patchwork Mon May 4 06:36:12 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Turull X-Patchwork-Id: 87462 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 B2B7DCD3427 for ; Mon, 4 May 2026 06:36:32 +0000 (UTC) Received: from PA4PR04CU001.outbound.protection.outlook.com (PA4PR04CU001.outbound.protection.outlook.com [40.107.162.69]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.9214.1777876591485309772 for ; Sun, 03 May 2026 23:36:31 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@ericsson.com header.s=selector1 header.b=v6MhtNCp; spf=pass (domain: ericsson.com, ip: 40.107.162.69, mailfrom: edaturu@ericsson.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Y0qIzt3oFSuiVCSldy8i+BAXBdV3k5r0I4EytgqloSeUOLmhTY7L91IXhg0ltXtgurK7ljG8muwopfo/Qu2mFcL8uWejGHy9KUjpCL9t1RVTfA+bmHbBVSRGpjzh21V2z9lpUhqqvkU+n2TP9ITfYNoANmjP4oNIyUWnHeMNDBAF62Nkapp645/aHUaN+pSx3miq9nOr8RGKgl4V4VXIX4sSJjho0uRneuC1HNEhDvb4O6SRA60rj5f5+uQ3Px8ehqCk7NmItZ1ynZBV7o2ROhU2njafx8DTzIBTDFGl48dIsNIAXwAZQKsoySu+plvAJtGHPpc1KopEoiRNbegyxw== 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=Dt3X/fc2Xqo7sATJa1rIR27Z8i584wHhxlzzOMEZEIo=; b=SBejLjJi6etiLWr3mBc5apNGlr+ix0MLIuiuuSvQVhUS+F3bINpqJ6B7u/uR/kjFi8WDvHzAW7NSIl8QOAqDlQo8pRKBKKzTYmjuAD494nwyAb1+GX8B27HNOXQPN5XclkFJe6St8WZu9ZZCWbp25My5g2EoufN+RolPPuMyJbmaxlEeMyi/JkX7mn/ell9p5bWVmxAFGKhXFXUsDLfGOhlW0qFifUh/DTwO5cmtNWcfW13jEof8JHejGUKftX23s7nGNRrfFaUNz37OhdFX3uBjWKKM6TgzdPk5hBPkrRwgEuDrBN5oNgY5f2SzKSW5LEKPDHH9TLACV1q137vcPg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 192.176.1.74) smtp.rcpttodomain=arm.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=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Dt3X/fc2Xqo7sATJa1rIR27Z8i584wHhxlzzOMEZEIo=; b=v6MhtNCpOfnw5VWSl+5yrO703N1DTgG8dck02DPRqV1ccGY7FS9fn09YsqMpkZDY94aSyKkNxcHb93ioCDVgHWaMnZvVFJTLIL9ufbGjYOBO9anj+PQWS0l8Swq6wjAePiJdv67HsBat2xKirhXUr7esQ4Ko72SHz+hH5fzvhQJI2pS3+gRcGnL4pMRQf+wFTBA1hIx8FN486iaiay3/RslbAawRAFfFSOhtCC4vlKP0cYhrpOjUmhA6oBldiYhbHZpStm1gjc7XMtogdRpINg3wuPfCz1Of/GH77EiqYX1drZPE2akFBGbesyTdTSlXu4Warrxxg7neRX6kYuYzew== Received: from CWLP123CA0124.GBRP123.PROD.OUTLOOK.COM (2603:10a6:401:87::16) by DB9PR07MB9887.eurprd07.prod.outlook.com (2603:10a6:10:4c6::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9870.25; Mon, 4 May 2026 06:36:24 +0000 Received: from AM4PEPF00027A68.eurprd04.prod.outlook.com (2603:10a6:401:87:cafe::76) by CWLP123CA0124.outlook.office365.com (2603:10a6:401:87::16) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9870.25 via Frontend Transport; Mon, 4 May 2026 06:36:24 +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 AM4PEPF00027A68.mail.protection.outlook.com (10.167.16.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9891.9 via Frontend Transport; Mon, 4 May 2026 06:36:24 +0000 Received: from seroius18815.sero.gic.ericsson.se (153.88.142.248) by smtp-central.internal.ericsson.com (100.87.178.62) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.29; Mon, 4 May 2026 08:36:23 +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 CDC644021580; Mon, 4 May 2026 08:36:22 +0200 (CEST) Received: by seroius08462.sero.gic.ericsson.se (Postfix, from userid 160155) id B8C01700DB95; Mon, 4 May 2026 08:36:22 +0200 (CEST) From: To: , CC: , , , Subject: [AUH][PATCH v3 4/4] upgrade-helper.py: Add resume option to skip already attempted recipes Date: Mon, 4 May 2026 08:36:12 +0200 Message-ID: <20260504063614.3831203-5-daniel.turull@ericsson.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260504063614.3831203-1-daniel.turull@ericsson.com> References: <20260504063614.3831203-1-daniel.turull@ericsson.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM4PEPF00027A68:EE_|DB9PR07MB9887:EE_ X-MS-Office365-Filtering-Correlation-Id: 91c39a71-7eda-461e-66bb-08dea9a776ab 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|36860700016|1800799024|376014|82310400026|22082099003|18002099003|56012099003; X-Microsoft-Antispam-Message-Info: nw2DMVDLCqHzxg8iAjp6zPCHTilv4+E4ymAecWDoQ4nNCSixcOIn134rzlMNLWM1TGGqucc9xMHiAHOEhdd+O+9Ces87jiZUpIwPg3Jzihe0Z4gG5lhYZBY2+aKbI09IeBwD5U9RHkGHFqDi8rXBbwdmOiJjSoqwg05kybZ523vbBkXQzK+NYBVsxU7eBRq/Teet9ZBSM8FkETAFRJ0xarAYowcmo+vCiLQEb7O9/Sg7OlR8JIB7JTkE8iDfa+qBtg5ouANmDnAVTpb+faNZUjTBh48HT9DSCq7dYOWOskqIrlMict993IC4DAbhQ5MuV7qU0BAzdFvofTf2U2WdPAeT5S3imp3uoRqjBUCXD8T86EJ72fVcmG/G+pJXM1ur5H/YyQs3IRE9LCPonoyfAivgNRE6RnGternzs1nBnDAZbcsRDy3p1Upy9LaF55j4Gj6ropvmvKDuDG8BQaNBiVBl6oZJIFPeiV75Q0I7PeZPdpGJfrlgvooX566KoZ13bmllxXuW0uJrDNfYee1KM/Cnoyp3ZZPfThZBiJ4OU0BCR1AW/ja9dspMuUhgsSl/MywYsDOqjRVNl4oxqi9elsRNcFC15HpntywzyITurqDUvK6RQyhQVcYyB9vmwSsVwv3oK430PXUJBxkOXGT9t/lu5pkn1BWM7unRwjaZ/2zQG74CO7D0BwC3e9nn02pN3luS4L4OseC/GfyKgNrc5jUK3QYVkFkq0dAsi2sht6Y= 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)(36860700016)(1800799024)(376014)(82310400026)(22082099003)(18002099003)(56012099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 26htK7DdYJNABG4ES4bPX+ijyGgLRImbFLqlPlr2U5Gn6y8/cH9sTQdNB5faI9JJDL9e9d/c5k3ffLFlWjM728LOjKkChv3P7ao88sH4PTB1C07e1r4F0T0UcSq2swkTUEHxIQcSePxuaZDkpbYHxCAYhg+gEWXfm1NOcLsyOOyJPsjEV+JCUtzYW6wL9JqAQVn74eb91U5kGFSTKgETKyJTveSG1pfenuyIC5iocajEZdwCYREeXglwIMDh38jSKOyclKn3pMYA5Q0K9k8GFAdVkWoJte8ifPtm42/P5/b8wIqKLRvo9uwPtIB8N3Qxfo6n/MlSQESAxKnVl03NWyNWMle37CT0fPik4aa/hcbzzylk+0zFF1aUMc1AVY0N6S95iE7f8QZbJPAYOmiba/HI9bgXU+S07PtlZOb1ptlITXnzhzbFR7NSur1vnE1y X-OriginatorOrg: ericsson.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 May 2026 06:36:24.8125 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 91c39a71-7eda-461e-66bb-08dea9a776ab 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: AM4PEPF00027A68.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR07MB9887 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 ; Mon, 04 May 2026 06:36:32 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto-patches/message/3901 From: Daniel Turull Add --resume option that checks the most recent run's succeed/ and failed/ directories to determine which recipes were already attempted. Symlinks in these directories are now created immediately after each recipe is processed (rather than at the end of the run), so an interrupted run still leaves behind the right state for --resume. This allows restarting an interrupted run without re-processing recipes that have already been handled, saving significant time on large runs (e.g. 12h for 135 recipes). Assisted-by: kiro:claude-opus-4.6 Signed-off-by: Daniel Turull --- upgrade-helper.py | 48 +++++++++++++++++++++++++++++++++++++---------- 1 file changed, 38 insertions(+), 10 deletions(-) diff --git a/upgrade-helper.py b/upgrade-helper.py index aecb207..e6ae77f 100755 --- a/upgrade-helper.py +++ b/upgrade-helper.py @@ -42,6 +42,7 @@ import re import signal import sys import configparser +import glob from datetime import datetime from datetime import date import shutil @@ -99,10 +100,12 @@ def parse_cmdline(): parser.add_argument("-t", "--to_version", help="version to upgrade the recipe to") - parser.add_argument("--stable", action="store_true", default=False, help="only upgrade to the next patch version within the stable branch (e.g. 1.2.3 -> 1.2.4)") + parser.add_argument("--resume", action="store_true", default=False, + help="skip recipes already attempted in the last run") + parser.add_argument("-d", "--debug-level", type=int, default=4, choices=range(1, 6), help="set the debug level: CRITICAL=1, ERROR=2, WARNING=3, INFO=4, DEBUG=5") parser.add_argument("-e", "--send-emails", action="store_true", default=False, @@ -493,10 +496,34 @@ class Updater(object): succeeded_pkggroups_ctx = [] failed_pkggroups_ctx = [] attempted_pkggroups = 0 + + # --resume: skip recipes already attempted in the most recent run + resume_skip = set() + if self.args.resume: + prev_runs = sorted(glob.glob(os.path.join(self.uh_dir, "20*"))) + prev_runs = [r for r in prev_runs if r != self.uh_work_dir] + if prev_runs: + prev_dir = prev_runs[-1] + for d in ("succeed", "failed"): + result_dir = os.path.join(prev_dir, d) + if os.path.isdir(result_dir): + resume_skip.update(os.listdir(result_dir)) + if resume_skip: + I(" --resume: skipping %d recipes from %s" % + (len(resume_skip), prev_dir)) + else: + W(" --resume: no previous run found, nothing to skip") for g in pkggroups_ctx: attempted_pkggroups += 1 pkggroup_name = g["name"] + + if g['name'] in resume_skip: + I(" SKIP PACKAGE GROUP %d/%d (already attempted): %s" % + (attempted_pkggroups, total_pkggroups, pkggroup_name)) + continue + I(" ATTEMPT PACKAGE GROUP %d/%d" % (attempted_pkggroups, total_pkggroups)) + try: for pkg_ctx in g['pkgs']: I(" %s: Upgrading to %s" % (pkg_ctx['PN'], pkg_ctx['NPV'])) @@ -541,6 +568,15 @@ class Updater(object): succeeded_pkggroups_ctx.remove(g) failed_pkggroups_ctx.append(g) + # Create symlink immediately so --resume can find it + if 'workdir' in g: + if any(g['name'] == s['name'] for s in succeeded_pkggroups_ctx): + link = os.path.join(self.uh_recipes_succeed_dir, g['name']) + else: + link = os.path.join(self.uh_recipes_failed_dir, g['name']) + if not os.path.exists(link): + os.symlink(g['workdir'], link) + if self.opts['testimage']: ctxs = {} ctxs['succeeded'] = succeeded_pkggroups_ctx @@ -551,15 +587,7 @@ class Updater(object): tim.run() - for g in pkggroups_ctx: - - if g in succeeded_pkggroups_ctx: - os.symlink(g['workdir'], os.path.join( \ - self.uh_recipes_succeed_dir, g['name'])) - else: - os.symlink(g['workdir'], os.path.join( \ - self.uh_recipes_failed_dir, g['name'])) - + for g in succeeded_pkggroups_ctx + failed_pkggroups_ctx: self.statistics.update(g) self.pkg_upgrade_handler(g)