From patchwork Tue Feb 24 23:22:35 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Kjellerstedt X-Patchwork-Id: 81852 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 70505F5542F for ; Tue, 24 Feb 2026 23:22:57 +0000 (UTC) Received: from GVXPR05CU001.outbound.protection.outlook.com (GVXPR05CU001.outbound.protection.outlook.com [52.101.83.57]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.33970.1771975367136193012 for ; Tue, 24 Feb 2026 15:22:47 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@axis.com header.s=selector1 header.b=SoFk2jXo; spf=pass (domain: axis.com, ip: 52.101.83.57, mailfrom: peter.kjellerstedt@axis.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ofidCYJvMQ5M5x9Zatdo474bErvXDX27boJLoAjhNutQyjmtfNYE1iEnyzNG7poJmg6+FlMs7usdfPyBl+TsGI/jkc+RrdL0a1OIXQRFZ5oqbHdrHD62lDvJ8+0V/bj8aoB1FEa8i6LiTgmdOfibABYq27OTdePKBygdHhpUmZt1GFOBMEna/lcf2ZL6BPRNHex2PEKSwZeOMZHYmtFs5IB+Im202ZokiPJr76NqAjJkrn/94stWvfK17iTTK9M0Cxd7NIMRnqnUkYqMEkrRxMcp0ahC0Bi/xnFO0XCMkqXSwTXDC3Bme8RGC+6A++p0Aq47l/dOm1RPPG27TkU0DQ== 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=jxneUmVlDy7gLSSxtXJ45feITE3aP7igD/hyDwQA1iU=; b=fU6n9hjGyTnwD5j6K8turWEIcO5fhXoq1sPVIS/8aYZ0RuaB2ZYlux4DGMU+7kR6NMkjS2LmXv6o9gPrxZYhsR2BDyaAvx5uSpK0qElRZNvd7irc5EeB+ISwiJdlAFNkyGAWKEPzUcFESPap5PWGYQs/wwGR9WgXytBSpLruwfkz71GvDm3tPlMIV9U3m9CWauMt/10K6SD4snIxB9RSCOCMRCKeA1rKnNPcePo6mVdt3Gohl75s5n6AEsAbXurXmZypvTqjxsn+ua3p/WMkVsHdKqlMO74ZM59/BuV9pCIn864V5P5DLbsNSkJYA4Lwh/EzVq9TK5nGbrFAmQ8pyQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 195.60.68.100) smtp.rcpttodomain=lists.openembedded.org smtp.mailfrom=axis.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=axis.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jxneUmVlDy7gLSSxtXJ45feITE3aP7igD/hyDwQA1iU=; b=SoFk2jXoRyjnx6puyI+7+Fno3Z/0cqgg/SMFoHoQwvSa+a3Al/AlAq85D4yu77RazOoej7rqo13aItvhuNdqBlfbA5bf8YQyLqEWBlthjQoyiRjfDJmnm6vIH65+sTVjRXNu8HdoAzknvDVQncdXdAhjStGZN8ifU0dTJObAp8M= Received: from DUZPR01CA0003.eurprd01.prod.exchangelabs.com (2603:10a6:10:3c3::15) by DU0PR02MB8980.eurprd02.prod.outlook.com (2603:10a6:10:476::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9632.21; Tue, 24 Feb 2026 23:22:41 +0000 Received: from DU6PEPF0000A7E0.eurprd02.prod.outlook.com (2603:10a6:10:3c3:cafe::d5) by DUZPR01CA0003.outlook.office365.com (2603:10a6:10:3c3::15) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9632.22 via Frontend Transport; Tue, 24 Feb 2026 23:22:36 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 195.60.68.100) smtp.mailfrom=axis.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=axis.com; Received-SPF: Pass (protection.outlook.com: domain of axis.com designates 195.60.68.100 as permitted sender) receiver=protection.outlook.com; client-ip=195.60.68.100; helo=mail.axis.com; pr=C Received: from mail.axis.com (195.60.68.100) by DU6PEPF0000A7E0.mail.protection.outlook.com (10.167.8.39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9632.12 via Frontend Transport; Tue, 24 Feb 2026 23:22:40 +0000 Received: from se-mail11w.axis.com (10.20.40.11) by se-mail10w.axis.com (10.20.40.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.39; Wed, 25 Feb 2026 00:22:40 +0100 Received: from se-intmail01x.se.axis.com (10.4.0.28) by se-mail11w.axis.com (10.20.40.11) with Microsoft SMTP Server id 15.2.1748.39 via Frontend Transport; Wed, 25 Feb 2026 00:22:40 +0100 Received: from pc56063-2339.se.axis.com (pc56063-2339.se.axis.com [10.92.3.2]) by se-intmail01x.se.axis.com (Postfix) with ESMTP id 883395433 for ; Wed, 25 Feb 2026 00:22:40 +0100 (CET) Received: by pc56063-2339.se.axis.com (Postfix, from userid 14323) id 7F6C4120218; Wed, 25 Feb 2026 00:22:40 +0100 (CET) From: Peter Kjellerstedt To: Subject: [PATCHv2 1/2] lib/oe/patch: Make GitApplyTree.extractPatches() return the patches Date: Wed, 25 Feb 2026 00:22:35 +0100 Message-ID: <20260224232236.2048910-1-pkj@axis.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU6PEPF0000A7E0:EE_|DU0PR02MB8980:EE_ X-MS-Office365-Filtering-Correlation-Id: 9734aeb0-fc21-4dcc-3420-08de73fb9b28 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|36860700013|82310400026|1800799024; X-Microsoft-Antispam-Message-Info: gsHfmFIllx8UuIw8NgfS1KhQU3h7bN+UVZWD+teS7hljbfVe6+p39hKNU620jCZbH3Qd55rD3cGLD9U0QmJfvqBI2lLEv/oIzf4Tx+s2+5uRMqqF/9UJ9XVcjyQxJyrqbenZDSI1ObHc9ORqNXkEfDBk8+6rbClZjDsgpouSBZ9RjKMl9M2tJWbekyWdAfvL0ZO9P4UcclTEVnB8W0ZbDZZVzNCE0x6m0Xd/XRtcCPmha9/+kSYVbmz6DErxPdTnTd1D6Z2dPkkzNl9kY2a4bXjnnMlpyGsWAi5BbhTDd4DiGWf6XguI5qyKO9GTJxovEIBLYsVOLPcvF0CqrqBIr1hSDqm1C4c7NewjTZ32b+BTtEWP5Nc0XdoKjtkRfS86kvfejCUZ4iXVXUichJ/x9DaK4Rl/iRK/gjELQKLAn+K7AdtbZvlgjRe0Uk4TqH4s8CsoDNluysFxUvrZ4YF+RgZN0Z6P6o7K+NEw8S/7YZlFEvqHiWj5JpRVI4FXWxBWYTXajQB7JUmQKFIM1ci2AvqBUBR8K15/gnO3f4QNvlae6RofP46WWjMDU1clvd1bP5BI+672T3a4cGZ8gzbkui+slEN9tiv4qXDxD+oRLCoq9Ff3G24wnCJeec2LPWXHEwI+aEeAFMeNiAxUiaTJ35Vz6gQ8xb5/PtnnkZbZjgjBLPp0gdk4YQ/vS15qbperqJKPc6tST9HOU0EGFwkauL+5FlEtfV8eg2zRTW3KxfcGld24xzrVsxob/Ow/9O73GoKnPPWnw8cr0zEWVpRQWEBEyUbtE8sX64NLlfa0/8+2dUWoQEDFWOELZ10RwynDNTRyXFjyBUK4YwRLW8koMwpV9k72/J5estZQr4h1I9JT6ARQDxgVnOzLkpK+/zSi4nWk6vWnztjQBAE1zQ2wsujSBJ8vi0Ko4xialPLSwR+e/LqHB2KuV+0COCKn7PaU7LE5po/KVXCGx0TbSVc7ZIxjZx+U41wBCmgUOT4A/WcRxjpmGsDpCftutLCIFI0/3C5XjdtVliyq91DgtQSsgNdLn9xD/ilVYgjOX+cO4lQ35FiIghU0US+HlzZO/JiQNv+znSITKoxILhavkNtE3T5RnRb/TXHDCndRF+mVyAkM383DtV9n7thGxWo0K4kfXGKhPv3nqxI5joFd4Q7zCrGavvdX7sBkuC7vly4aO12cv8Ccditsmcumahds6A/Nvee72bU1/1525DW7ZSjSXueNCx9CEmpk57vE6rxmvT9sT9AuyWNEAbL4tnjmv4XS/8G2ddZVgqxTrpBxnlD4/8D/De5SissrIeNm/rqhfkM6iUJWiL2WEpO6k7RJ+JoDolh6F8MuWn7iy0gzy9UIAkBfYUvBLqioIE1tyiH8gJ7QzNlJlM4sGbbCxjbdMNsSfYxg9wT99rzO152SIkLy83M7I4PJCrpfmbWn87020SEvu2bWz5vp/4fI93qYDUg7+2bLJpwAEfYj19J0F4sSNQ3zQIUAssAqF0Tl5wvs8s2vGgFh3U3/KkFK/xEZzGmEA3Frc0eyPa+YyzvcAOPy6yQtzG4THcMv6Z0zGLH6SEpowXKlBsM82R0lpv0u1XEIdJI3vpHUbHOtBDkcgcyOw39cfIttOEh/8VHWHOVA1URh+gi++AqYl4m0f3jPIy5f+VxJD8gotOhquggdRjZ59g== X-Forefront-Antispam-Report: CIP:195.60.68.100;CTRY:SE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.axis.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(36860700013)(82310400026)(1800799024);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: yFMxf1j1Yg2AnjF7rM5+XqjHmRciopFexl/VfS9I+j0O1OPJEgJhy/HBEKFhp92s1VwVhLdAg6aSZ7wwln+sk/NI6rtWhmpzuznfywg14wCn5oFO4VzM2szuYBHwu0wfhSpoDgIUtmjUFO1K1b1yefU7P6/1Mw1IQsEEgjSgj6iR2+S0sXpgaANRiZBtCWmo0CfVHeu8+nmVxI8l5bvxd4PgqSZyZgtXMes9/GNlssW7E2Owhzf0KWLG3BgKz/cT6HnLjsjfbR0wqsJ4mVTANxn/V+Vwu33Wc2+sfQtId3i7tW8u7Bl5ZlSlnpwUfqahZEOETvDgy1pXcmw6nSSRVRydxs7w2ZoNu800SdArlAEsqwO+r+8VrJK9AjH7yU6R50PpJWbzvqvsP3JSqRjK+CnBBlUPd/jcP19CWrlW+sQsl2Adij5HdEvvqaxxzfIE X-OriginatorOrg: axis.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Feb 2026 23:22:40.9763 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9734aeb0-fc21-4dcc-3420-08de73fb9b28 X-MS-Exchange-CrossTenant-Id: 78703d3c-b907-432f-b066-88f7af9ca3af X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=78703d3c-b907-432f-b066-88f7af9ca3af;Ip=[195.60.68.100];Helo=[mail.axis.com] X-MS-Exchange-CrossTenant-AuthSource: DU6PEPF0000A7E0.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR02MB8980 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 ; Tue, 24 Feb 2026 23:22:57 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/231919 The list of patches will be used by _export_patches() in devtool to add new patches in the correct order. Signed-off-by: Peter Kjellerstedt --- PATCHv2: New patch. meta/lib/oe/patch.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/meta/lib/oe/patch.py b/meta/lib/oe/patch.py index 246fc6221f..afc42df8a7 100644 --- a/meta/lib/oe/patch.py +++ b/meta/lib/oe/patch.py @@ -516,6 +516,7 @@ class GitApplyTree(PatchTree): import tempfile import shutil tempdir = tempfile.mkdtemp(prefix='oepatch') + patches = [] try: for name, rev in startcommits.items(): shellcmd = ["git", "format-patch", "--no-signature", "--no-numbered", rev, "-o", tempdir] @@ -553,11 +554,14 @@ class GitApplyTree(PatchTree): outfile = notes.get(GitApplyTree.original_patch, os.path.basename(srcfile)) bb.utils.mkdirhier(os.path.join(outdir, name)) - with open(os.path.join(outdir, name, outfile), 'w') as of: + patch = os.path.join(outdir, name, outfile) + with open(patch, 'w') as of: for line in patchlines: of.write(line) + patches.append(patch) finally: shutil.rmtree(tempdir) + return patches def _need_dirty_check(self): fetch = bb.fetch2.Fetch([], self.d) From patchwork Tue Feb 24 23:22:36 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Kjellerstedt X-Patchwork-Id: 81853 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 71E7CF55422 for ; Tue, 24 Feb 2026 23:22:57 +0000 (UTC) Received: from GVXPR05CU001.outbound.protection.outlook.com (GVXPR05CU001.outbound.protection.outlook.com [52.101.83.32]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.34121.1771975366815989747 for ; Tue, 24 Feb 2026 15:22:47 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@axis.com header.s=selector1 header.b=MXyWlnO2; spf=pass (domain: axis.com, ip: 52.101.83.32, mailfrom: peter.kjellerstedt@axis.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=kvFijDvO6uX6FrLFsTxKaGnmBMZpRhlq2dDqYixEHnpbBtNgLlroXBJiRyqehrp6JF+LBs4VxnKosIG/BhC0eD8P0P3QQE3hQtmH1Yg8WG53E5SVe10b4NQPCH6F5xV/LxdzuvhyHp1j8PD7RbbUEwRb++tdvAnRGIrR3NFGriXbBkK5Hr/5yykUXEI6/asn0n+FGphlRSG34Ca5gkNdl9t77nkct59Wfa+QMkE/b3f41KKjZ9FMjXNBHMQP1Cq5boHGVZ/cCv93AfSmhngPtvHPY7TnWSwcqX7meU6Wsvqe2dHwZ9TZEvhDSRd8NyduHzTgD42KXOWIbBamhhnWLw== 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=UpAe5ArrNNzv1uGtu+GSPz9qAGoM8FWFym/qo3Pg7OY=; b=EOmMyjTLXe8fQE0dsy8lJbjhwvXgNgFLYVHVXghUATLC2LmVdy9IqHHoOY4ijcf90usul2cdBBtawa1MG1alZF6rYsfwCCieRDBRvYgzbWWH0BBYjEkWDPVwcHY+RydvKEYix9zaori2UbUQU27ymN8fo+0189YNbnKvdDDpRuDOzPt3P6rfHC+wnxPdzAFoH7ie7tfbTJtInj1+1IysKC+353h8ba1Zb4tU7EYSQrZQeeJSsPFzkKUok0/BuMP/ZR0roz6VVwxbQ2aG9GH0++BbMmSQDkFXXG0de1DDg88SGwzMlWhxC+B2M5dqRf/V8fr+PFcSf+eDerhJKklMvw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 195.60.68.100) smtp.rcpttodomain=lists.openembedded.org smtp.mailfrom=axis.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=axis.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UpAe5ArrNNzv1uGtu+GSPz9qAGoM8FWFym/qo3Pg7OY=; b=MXyWlnO2oYHE8CycyqEM1PlDt39/r8RyqFilbeMOyscAmgNXeQzMM9jEpWrzn4vVLGhPZb6MR1E/OCFH+gNydUGNATnuBhNbWgmf6/bl3ncn4pm/5cmtGQxHsORlWeh2PLbED9wzbrYYl+NlVbwSzuMldVcAMf0zvSqIoe6KwHc= Received: from AS4P190CA0005.EURP190.PROD.OUTLOOK.COM (2603:10a6:20b:5de::17) by DU4PR02MB11213.eurprd02.prod.outlook.com (2603:10a6:10:5ef::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9632.22; Tue, 24 Feb 2026 23:22:41 +0000 Received: from AM3PEPF0000A790.eurprd04.prod.outlook.com (2603:10a6:20b:5de:cafe::42) by AS4P190CA0005.outlook.office365.com (2603:10a6:20b:5de::17) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9632.23 via Frontend Transport; Tue, 24 Feb 2026 23:22:35 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 195.60.68.100) smtp.mailfrom=axis.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=axis.com; Received-SPF: Pass (protection.outlook.com: domain of axis.com designates 195.60.68.100 as permitted sender) receiver=protection.outlook.com; client-ip=195.60.68.100; helo=mail.axis.com; pr=C Received: from mail.axis.com (195.60.68.100) by AM3PEPF0000A790.mail.protection.outlook.com (10.167.16.119) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9632.12 via Frontend Transport; Tue, 24 Feb 2026 23:22:41 +0000 Received: from SE-MAILARCH01W.axis.com (10.20.40.15) by se-mail11w.axis.com (10.20.40.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.2.1748.39; Wed, 25 Feb 2026 00:22:40 +0100 Received: from se-mail10w.axis.com (10.20.40.10) by SE-MAILARCH01W.axis.com (10.20.40.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.61; Wed, 25 Feb 2026 00:22:40 +0100 Received: from se-intmail01x.se.axis.com (10.4.0.28) by se-mail10w.axis.com (10.20.40.10) with Microsoft SMTP Server id 15.2.1748.39 via Frontend Transport; Wed, 25 Feb 2026 00:22:40 +0100 Received: from pc56063-2339.se.axis.com (pc56063-2339.se.axis.com [10.92.3.2]) by se-intmail01x.se.axis.com (Postfix) with ESMTP id 87EF929B7 for ; Wed, 25 Feb 2026 00:22:40 +0100 (CET) Received: by pc56063-2339.se.axis.com (Postfix, from userid 14323) id 8380D120040; Wed, 25 Feb 2026 00:22:40 +0100 (CET) From: Peter Kjellerstedt To: Subject: [PATCHv2 2/2] devtool: standard: Add new patches in correct order when finishing Date: Wed, 25 Feb 2026 00:22:36 +0100 Message-ID: <20260224232236.2048910-2-pkj@axis.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260224232236.2048910-1-pkj@axis.com> References: <20260224232236.2048910-1-pkj@axis.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM3PEPF0000A790:EE_|DU4PR02MB11213:EE_ X-MS-Office365-Filtering-Correlation-Id: 209fcd7e-a2ea-4f9d-4aa9-08de73fb9b32 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|36860700013|1800799024|376014|7142099003; X-Microsoft-Antispam-Message-Info: 1SWbYImGnP8DxgQi498vwXlHuOZE2Cfqa8xHjYnnN5EHoNqzxrRpILSPbvjGbnjHKkmP+yhbHv4TNR82X1u/xyjN8XbH4CDqhlg+jssHYCDgU/zSe7TcrGOTlxnEaC1o+W5s88eBPXFfQ8OtFFmbncYtd0V8rsoXVMCHk/i0mjZ+uVdR1S3NtYqIJNqHEU/Chm6oMYpW0m4MeJ2eespZ+xNRkn6varJ3dwNdMlgO/j5OxfY4F9Ug3lD0hEPvoqjM9T3gdRp3Y10FRmqIDPUAvpe+JqB++BojhdcCQc0Ng8OvjdI5MkbVXa9Iuyx9D9pX3t292sjk1elXiIgXN01Jr7+OSf3rS+86zxzDKzX/hOgDLgoyDimfbXGk11N2Xm47tDic4IN6ngyxWQktkTFO31aROTUN/RJJ3UwlBdI2vSn1sLEYajvJMKTLxEhipjPYxC53qDwk/gt97i5XxKs4S4ce1XE767dpiqwKGlSJniKUw5RcuvFKWxeNleIMFUlLC1cEgJOjR2RnJR9mejicQrzVskuTA99QXt8tFCKpY6WqPwpQCZgg6iXpFlCkDrDLt6O5qOyX2KMwJKMe1Cqk6StCL5ktt4pVOFoAKlH6q6KdiJsAInzp1JltwebpnwQWFlAhzHs6bPZriZJ2tXIyPVF/GAowDakPnHxcysJICyb7IBxVk8k6B2FAINMp6vE/TqDGzbjBGoGamt1KP5FOsNci/qvGZeC7JCHUqdHvwEsFCZeLBXECAGnv56NqPfdXXUGpBdiHtg7xjMXwyXnfX+gNN2jWkQI+8J90m6wIps9HGfuuV6kaaQoMGYeJsHjluFDg3RXxmZ1suNiJjewARHeqTsL6veJEcn/bPevuRSrZmzslUYTOT1fKcK5F92FeCk7DMc/a2KRmwkoc0vNdtWoEvogZ9SSn7nap15l5zIpto2KIaHc4xap8yLLQD8agPov4OTlRqAp6d6jzwI8w/MDi+/dNsQQTgjgBvL7O+5g9jFgJbRq61x+1zT7rYBa+1xSk6yyj23/hvC4LXSTR6xIbamm6ij09/q/l0eHZrtVj7M62r3x4VtMnPqp22brdSKXndVDDZp0O7ax21Aha8KDxPkBw5H5SwnSIpNLBAuans3S+NVLoix+H1dnGzdniXONu4cJe+ZiMITvxt7NMSQhg8LRfG4GbArlifvfyty864rMkvRk/LowOT0SXWX4x32LkUMe0bcwkwmO2F9orrIbfcDsq7llgXZQI0HB2vO5/NEDQtfek4KnMyBXDi2q9SZi25umcIMiiV9LKa3aoUrTGy+I3ocxV2eFg0zbRvA9bcQDGH2lqMrBKC2M4gs0rEvVgQjY6FuTxAKRrWw46OF9/5eKfWQtXnUyQQkv4v0hrQ3xXJMqYeZi6AQm3ZDN43XaqmHM5xhjJinh9IuOX6dFe8sp5RE2dEg9RRNnNryUMhsClqzQXOieKfCJMisBhZZRVlxn/Oqc+ixpv99xJxEKTN8D0l/nzLHllt3Occ+/WOy7Dseqo7p7mKdwuwrs4GspVwMCjJVu7xM4kmNwZTTyzbcb50biYlHbCcqi9Z9SQqvaV/GSsPr1TArqiSYrJA8k3goZZyKnGG5RzOfzYDcHmSeDCDbYWn19KaUPTLXVgCkuqZOfDebEqCsuje77VrDvXq0STfPRnTa9YlWTIkg== X-Forefront-Antispam-Report: CIP:195.60.68.100;CTRY:SE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.axis.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(36860700013)(1800799024)(376014)(7142099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 5NkV4llfe0yn7DY9Ruwps3/OK1Q+7MRzKnQzAul9vvMtGvl9U7mWhIk6UlEgNVwhGrfbU5Xm1kaRLb4zlA0N8smK5BAQlDpJCON6mU5XdqAWm8LP2V/640b7nzZTpUUsoyw58XllJEYA4v4jvWi+GTLHHlw7wShqQ95HJYFiRbOyTjIH7KR8CcusMITLgs2MniAGHwYc4KroyNYOk7GQCcktrlJ0LUQW69i3BInbdh4bKPtjpSFnbySUIXa/+49t6UtF0/suoRISruYVMUdF+R8wiIoyMtG1ddFu83g6v/XR97kVj0DqNr3hIg0SCLtLU49bGOTn+zGsjlVw4cML5WlFZiTFphyRFXm3TWfyBRYCC4W5GzbBW3cnDqncCk98gNx+WAeD32tHnKlU/8VOgI7qcUPtQeqE6DjjqmFKkH8MCMtGPm1P0omZxRvVx9dT X-OriginatorOrg: axis.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Feb 2026 23:22:41.0527 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 209fcd7e-a2ea-4f9d-4aa9-08de73fb9b32 X-MS-Exchange-CrossTenant-Id: 78703d3c-b907-432f-b066-88f7af9ca3af X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=78703d3c-b907-432f-b066-88f7af9ca3af;Ip=[195.60.68.100];Helo=[mail.axis.com] X-MS-Exchange-CrossTenant-AuthSource: AM3PEPF0000A790.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU4PR02MB11213 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 ; Tue, 24 Feb 2026 23:22:57 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/231918 Make sure that new patches that are added as a result of using devtool finish are added to the SRC_URI in the same order they were committed. Previously, the order was a result of the arbitrary order the patch files were returned by os.walk(), which typically resulted in them being added to the SRC_URI in the reverse order they were committed. Signed-off-by: Peter Kjellerstedt --- PATCHv2: Rely on GitApplyTree.extractPatches() to return the paths to the patches rather than using os.walk() to find them. meta/lib/oeqa/selftest/cases/devtool.py | 30 +++++-- scripts/lib/devtool/standard.py | 110 ++++++++++++------------ 2 files changed, 78 insertions(+), 62 deletions(-) diff --git a/meta/lib/oeqa/selftest/cases/devtool.py b/meta/lib/oeqa/selftest/cases/devtool.py index d1209dd94e..870317d4ff 100644 --- a/meta/lib/oeqa/selftest/cases/devtool.py +++ b/meta/lib/oeqa/selftest/cases/devtool.py @@ -2314,6 +2314,11 @@ class DevtoolUpgradeTests(DevtoolBase): result = runCmd('git status --porcelain', cwd=tempdir) self.assertIn('M maps.c', result.output) result = runCmd('git commit maps.c -m "Add a comment to the code"', cwd=tempdir) + # Make another change to the source + result = runCmd('sed -i \'/^#include "mdadm.h"/a \\/* Here is another comment *\\/\' maps.c', cwd=tempdir) + result = runCmd('git status --porcelain', cwd=tempdir) + self.assertIn('M maps.c', result.output) + result = runCmd('git commit maps.c -m "Add another comment to the code"', cwd=tempdir) for entry in os.listdir(recipedir): filesdir = os.path.join(recipedir, entry) if os.path.isdir(filesdir): @@ -2333,8 +2338,15 @@ class DevtoolUpgradeTests(DevtoolBase): self.assertNotIn(recipe, result.output, 'Recipe should have been reset by finish but wasn\'t') self.assertNotExists(os.path.join(self.workspacedir, 'recipes', recipe), 'Recipe directory should not exist after finish') expected_status = [(' M', '.*/%s$' % os.path.basename(oldrecipefile)), - ('??', '.*/.*-Add-a-comment-to-the-code.patch$')] + ('??', '.*/.*-Add-a-comment-to-the-code.patch$'), + ('??', '.*/.*-Add-another-comment-to-the-code.patch$')] self._check_repo_status(recipedir, expected_status) + result = runCmd('git diff %s' % os.path.basename(oldrecipefile), cwd=os.path.dirname(oldrecipefile)) + # Check that the recipe got updated as expected + # Can't use self._check_diff() as the order of the added files matter. + result = result.output.splitlines() + self.assertEqual('+ file://0001-Add-a-comment-to-the-code.patch \\', result[8]) + self.assertEqual('+ file://0002-Add-another-comment-to-the-code.patch \\', result[9]) def test_devtool_finish_modify_otherlayer(self): recipe, oldrecipefile, recipedir, filesdir = self._setup_test_devtool_finish_modify() @@ -2343,7 +2355,7 @@ class DevtoolUpgradeTests(DevtoolBase): relpth = os.path.relpath(recipedir, os.path.join(get_bb_var('COREBASE'), 'meta')) appenddir = os.path.join(get_test_layer(), relpth) self.track_for_cleanup(appenddir) - # Try finish to the original layer + # Try finish to another layer than the original layer self.add_command_to_tearDown('rm -rf %s ; cd %s ; git checkout %s' % (recipedir, os.path.dirname(recipedir), recipedir)) result = runCmd('devtool finish %s meta-selftest' % recipe) result = runCmd('devtool status') @@ -2356,15 +2368,19 @@ class DevtoolUpgradeTests(DevtoolBase): recipefn = recipefn.split('_')[0] + '_%' appendfile = os.path.join(appenddir, recipefn + '.bbappend') self.assertExists(appendfile, 'bbappend %s should have been created but wasn\'t' % appendfile) + # Check that the bbappend got created as expected + with open(appendfile, 'r') as f: + newlines = f.readlines() + self.assertEqual('SRC_URI += "file://0001-Add-a-comment-to-the-code.patch file://0002-Add-another-comment-to-the-code.patch"\n', newlines[2]) newdir = os.path.join(appenddir, recipe) files = os.listdir(newdir) - foundpatch = None - for fn in files: - if fnmatch.fnmatch(fn, '*-Add-a-comment-to-the-code.patch'): - foundpatch = fn + foundpatch = False + for fn in files[:]: + if fnmatch.fnmatch(fn, '*-Add-a*-comment-to-the-code.patch'): + files.remove(fn) + foundpatch = True if not foundpatch: self.fail('No patch file created next to bbappend') - files.remove(foundpatch) if files: self.fail('Unexpected file(s) copied next to bbappend: %s' % ', '.join(files)) diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py index f4d5d7cd3f..b706d9c7a1 100644 --- a/scripts/lib/devtool/standard.py +++ b/scripts/lib/devtool/standard.py @@ -1325,60 +1325,60 @@ def _export_patches(srctree, rd, start_revs, destdir, changed_revs=None): # Generate patches from Git, exclude local files directory patch_pathspec = _git_exclude_path(srctree, 'oe-local-files') - GitApplyTree.extractPatches(srctree, start_revs, destdir, patch_pathspec) - for dirpath, dirnames, filenames in os.walk(destdir): - new_patches = filenames - reldirpath = os.path.relpath(dirpath, destdir) - for new_patch in new_patches: - # Strip numbering from patch names. If it's a git sequence named patch, - # the numbers might not match up since we are starting from a different - # revision This does assume that people are using unique shortlog - # values, but they ought to be anyway... - new_basename = seqpatch_re.match(new_patch).group(2) - match_name = None - old_patch = None - for old_patch in existing_patches: - old_basename = seqpatch_re.match(old_patch).group(2) - old_basename_splitext = os.path.splitext(old_basename) - if old_basename.endswith(('.gz', '.bz2', '.Z')) and old_basename_splitext[0] == new_basename: - old_patch_noext = os.path.splitext(old_patch)[0] - match_name = old_patch_noext - break - elif new_basename == old_basename: - match_name = old_patch - break - if match_name: - # Rename patch files - if new_patch != match_name: - bb.utils.rename(os.path.join(destdir, new_patch), - os.path.join(destdir, match_name)) - # Need to pop it off the list now before checking changed_revs - oldpath = existing_patches.pop(old_patch) - if changed_revs is not None and dirpath in changed_revs: - # Avoid updating patches that have not actually changed - with open(os.path.join(dirpath, match_name), 'r') as f: - firstlineitems = f.readline().split() - # Looking for "From " line - if len(firstlineitems) > 1 and len(firstlineitems[1]) == 40: - if not firstlineitems[1] in changed_revs[dirpath]: - continue - # Recompress if necessary - if oldpath.endswith(('.gz', '.Z')): - bb.process.run(['gzip', match_name], cwd=destdir) - if oldpath.endswith('.gz'): - match_name += '.gz' - else: - match_name += '.Z' - elif oldpath.endswith('.bz2'): - bb.process.run(['bzip2', match_name], cwd=destdir) - match_name += '.bz2' - updated[match_name] = {'path' : oldpath} - if reldirpath != ".": - updated[match_name]['patchdir'] = reldirpath - else: - added[new_patch] = {} - if reldirpath != ".": - added[new_patch]['patchdir'] = reldirpath + new_patches = GitApplyTree.extractPatches(srctree, start_revs, destdir, patch_pathspec) + for patch_path in new_patches: + new_patch = os.path.basename(patch_path) + dirpath = os.path.dirname(patch_path) + patchdir = os.path.basename(dirpath) + + # Strip numbering from patch names. If it's a git sequence named patch, + # the numbers might not match up since we are starting from a different + # revision This does assume that people are using unique shortlog + # values, but they ought to be anyway... + new_basename = seqpatch_re.match(new_patch).group(2) + match_name = None + old_patch = None + for old_patch in existing_patches: + old_basename = seqpatch_re.match(old_patch).group(2) + old_basename_splitext = os.path.splitext(old_basename) + if old_basename.endswith(('.gz', '.bz2', '.Z')) and old_basename_splitext[0] == new_basename: + old_patch_noext = os.path.splitext(old_patch)[0] + match_name = old_patch_noext + break + elif new_basename == old_basename: + match_name = old_patch + break + if match_name: + # Rename patch files + if new_patch != match_name: + bb.utils.rename(patch_path, os.path.join(dirpath, match_name)) + # Need to pop it off the list now before checking changed_revs + oldpath = existing_patches.pop(old_patch) + if changed_revs is not None and dirpath in changed_revs: + # Avoid updating patches that have not actually changed + with open(os.path.join(dirpath, match_name), 'r') as f: + firstlineitems = f.readline().split() + # Looking for "From " line + if len(firstlineitems) > 1 and len(firstlineitems[1]) == 40: + if not firstlineitems[1] in changed_revs[dirpath]: + continue + # Recompress if necessary + if oldpath.endswith(('.gz', '.Z')): + bb.process.run(['gzip', match_name], cwd=destdir) + if oldpath.endswith('.gz'): + match_name += '.gz' + else: + match_name += '.Z' + elif oldpath.endswith('.bz2'): + bb.process.run(['bzip2', match_name], cwd=destdir) + match_name += '.bz2' + updated[match_name] = {'path' : oldpath} + if patchdir != '.': + updated[match_name]['patchdir'] = patchdir + else: + added[new_patch] = {} + if patchdir != '.': + added[new_patch]['patchdir'] = patchdir return (updated, added, existing_patches) @@ -1740,7 +1740,7 @@ def _update_recipe_patch(recipename, workspace, srctree, rd, appendlayerdir, wil patchdir_param['patchdir'] = patchdir patchfn = os.path.join(patches_dir, patchdir, basepath) if os.path.dirname(path) + '/' == dl_dir: - # This is a a downloaded patch file - we now need to + # This is a downloaded patch file - we now need to # replace the entry in SRC_URI with our local version logger.info('Replacing remote patch %s with updated local version' % basepath) path = os.path.join(files_dir, basepath)