From patchwork Fri Feb 16 18:59:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Kjellerstedt X-Patchwork-Id: 39549 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 4F091C48BF7 for ; Fri, 16 Feb 2024 19:00:11 +0000 (UTC) Received: from EUR02-AM0-obe.outbound.protection.outlook.com (EUR02-AM0-obe.outbound.protection.outlook.com [40.107.247.84]) by mx.groups.io with SMTP id smtpd.web10.5209.1708110007990173307 for ; Fri, 16 Feb 2024 11:00:08 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@axis.com header.s=selector1 header.b=UjqUnnCJ; spf=pass (domain: axis.com, ip: 40.107.247.84, mailfrom: peter.kjellerstedt@axis.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dWjyRKADvrfV9zjEup07tIdZY3c62L58qFhP23fZSol9MclNKvodP9c6D8Ob0B2IW31BzQ5vdHArDN4AbVtehekSD6f/wP5WNQEHI+EPZ1ds39dYUDL+BZJK8oWdE7+bhnMbHjRq0ttnOkiuSIjyMRlwsAyi2kGPnd9RU0/z3L6EQse7kfEWcUSeltcRS9o9CSvvS5oTPklJJcVtNcdObB7xsPInolNhRqZUP42TQSE9ZJEaEpbyoCAEhiD1ms+SbwY+bxBUdNjkbuyNuNxnFIrEt6aIzwHFVDxwg9ha7T53j8j4zauxNOCPxe6idgwn/o0F2BAaQ/fhT8n5LFyuNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=J2eCNrPB1/SPg+Io9nS9zFDpYMEjKFx96ex70OMLOyY=; b=UL2oqwxebKQIEBpykQh6MdWq2oUw3VNaTsI8+wFYxFvZUM13BFIL26ejvjGvC1arzDsTf1Cj56uS3lNOMmmBoehmKtLWMDvXPNbNsPFjmIEE2dAfN9aVRbgzwypTWN+bDOzPUCJEUK1AGQ91nWIKmhD9Uu2+qIhjERv1D2hDJo6PGp2UcKNRjbKVrLAqFqEjpFlxSVhORnWSdJxCQ/yR5yMfrPuXnh92zaREQzIf5YF9RaHf2aZp/mhJiPk4pyitw2f0uJbEFMEc4COP2gzlhiyBbN2vH0dt03vTJBFLlHzUn1CqKYRVi8/HcJs4LOXkd8+0r02XmG+ooMomdadINg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=fail (sender ip is 195.60.68.100) smtp.rcpttodomain=lists.openembedded.org smtp.mailfrom=axis.com; dmarc=fail (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=J2eCNrPB1/SPg+Io9nS9zFDpYMEjKFx96ex70OMLOyY=; b=UjqUnnCJ4uJGH7rRaagT5HMTyaAwEPwnUi11Ck/ccr3QJ2Da1Di0RKWT7Au3iKfbOscg+L0+QRyZUYg8wQQujdREBR5sX53eCzWryqIpBhoFUZ8YjNWZKVtruFkd5tgbyeFDag26dC4P1EjmPvObfF/kLLVRLSCh7ZWNt+3qbEg= Received: from AS4P195CA0035.EURP195.PROD.OUTLOOK.COM (2603:10a6:20b:65a::19) by VI0PR02MB10859.eurprd02.prod.outlook.com (2603:10a6:800:212::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.26; Fri, 16 Feb 2024 19:00:03 +0000 Received: from AM3PEPF00009B9B.eurprd04.prod.outlook.com (2603:10a6:20b:65a:cafe::62) by AS4P195CA0035.outlook.office365.com (2603:10a6:20b:65a::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7270.40 via Frontend Transport; Fri, 16 Feb 2024 19:00:03 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 195.60.68.100) smtp.mailfrom=axis.com; dkim=none (message not signed) header.d=none;dmarc=fail action=none header.from=axis.com; Received-SPF: Fail (protection.outlook.com: domain of axis.com does not designate 195.60.68.100 as permitted sender) receiver=protection.outlook.com; client-ip=195.60.68.100; helo=mail.axis.com; Received: from mail.axis.com (195.60.68.100) by AM3PEPF00009B9B.mail.protection.outlook.com (10.167.16.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7292.25 via Frontend Transport; Fri, 16 Feb 2024 19:00:02 +0000 Received: from SE-MAILARCH01W.axis.com (10.20.40.15) by se-mail02w.axis.com (10.20.40.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Fri, 16 Feb 2024 20:00:02 +0100 Received: from se-mail01w.axis.com (10.20.40.7) 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.2375.34; Fri, 16 Feb 2024 20:00:02 +0100 Received: from se-intmail01x.se.axis.com (10.0.5.60) by se-mail01w.axis.com (10.20.40.7) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Fri, 16 Feb 2024 20:00:02 +0100 Received: from saur (saur.se.axis.com [10.92.3.10]) by se-intmail01x.se.axis.com (Postfix) with ESMTP id 6B7FD1493D for ; Fri, 16 Feb 2024 20:00:02 +0100 (CET) Received: from saur.se.axis.com (localhost [127.0.0.1]) by saur (8.17.1/8.15.2) with ESMTPS id 41GJ02CE2607006 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Fri, 16 Feb 2024 20:00:02 +0100 Received: (from pkj@localhost) by saur.se.axis.com (8.17.1/8.17.1/Submit) id 41GJ01LH2607005 for openembedded-core@lists.openembedded.org; Fri, 16 Feb 2024 20:00:01 +0100 From: Peter Kjellerstedt To: Subject: [PATCH 1/7] devtool: standard: Add some missing whitespace Date: Fri, 16 Feb 2024 19:59:50 +0100 Message-ID: <20240216185956.2606978-1-pkj@axis.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM3PEPF00009B9B:EE_|VI0PR02MB10859:EE_ X-MS-Office365-Filtering-Correlation-Id: 9251be16-7e43-40c2-afa3-08dc2f217b5c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Vt+/Onm3a9OvMcGNzCTXGiR8tyyZTVFa/eQ69uVPbDuJTODlp8ZnYHA83XfU857TWLahX6xuUNTX5X04l0ma1rWxigrYLIswz/xh2s+MncHLuibgW0r5dfYuddOvbcAdPiGyj56VR00x9vNCOqRfJvdF4mfI0XGFDE61vPnDN58ye2SQp12isawmTyDxh4y7wdts/878gG9PrB9XcQwaYhqWV3WP6IAPar08surzKd4NvIYzg1tnRfpdw886lMqC1MsvjPpNuzvXE8l2l48zwV9Gv2jUlB8GWUiL28Rp0ZszKfl1/Q8Pov9oBCBIFuLDGttzh9+e5h7NuNWo1tJdYyhbIrx2TE+/ILilEOPTevobA316vVIBnMqCxfyxXivKlIJvcYDg1QiW2kAordrrZiNVhDLq0KIakCTkju1jqn3o8oPlvzE8efxu39u3JRQz0oQdl6Y3w2ZcCoxYjDgzuaSneD+2x2QwHT57uxM2E5v8q2zDpBP19Z6MJVOxJp5l1kcQbf+jPCNv9S5SIbH2de7serPfQxfOnwB1PaCipJq/9JZMvT/K9nVrsc+b4RO3nRYlddO8QOYjl9qiNlfvtOVevrpxdTd3kV4YAZ3GUkIS/TY9vRQ7zovvv2wwbB3naY1wWyghmSzTIwolYJE2BkgPvb5yqReGly3kZ63L5+E= 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:(13230031)(4636009)(39860400002)(346002)(136003)(376002)(396003)(230922051799003)(82310400011)(451199024)(186009)(1800799012)(64100799003)(36860700004)(40470700004)(46966006)(336012)(41300700001)(1076003)(81166007)(2616005)(83380400001)(426003)(82740400003)(356005)(26005)(6916009)(70206006)(70586007)(8676002)(2906002)(478600001)(42186006)(6666004)(316002)(8936002)(5660300002)(36756003);DIR:OUT;SFP:1101; X-OriginatorOrg: axis.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Feb 2024 19:00:02.9553 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9251be16-7e43-40c2-afa3-08dc2f217b5c 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: AM3PEPF00009B9B.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI0PR02MB10859 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 16 Feb 2024 19:00:11 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/195799 Makes it a little bit easier when reading the code. Signed-off-by: Peter Kjellerstedt --- scripts/lib/devtool/standard.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py index 0243e3bc75..dd9232da1c 100644 --- a/scripts/lib/devtool/standard.py +++ b/scripts/lib/devtool/standard.py @@ -460,7 +460,7 @@ def sync(args, config, basepath, workspace): finally: tinfoil.shutdown() -def symlink_oelocal_files_srctree(rd,srctree): +def symlink_oelocal_files_srctree(rd, srctree): import oe.patch if os.path.abspath(rd.getVar('S')) == os.path.abspath(rd.getVar('WORKDIR')): # If recipe extracts to ${WORKDIR}, symlink the files into the srctree @@ -657,9 +657,9 @@ def _extract_source(srctree, keep_temp, devbranch, sync, config, basepath, works if os.path.exists(workshareddir) and (not os.listdir(workshareddir) or kernelVersion != staging_kerVer): shutil.rmtree(workshareddir) - oe.path.copyhardlinktree(srcsubdir,workshareddir) + oe.path.copyhardlinktree(srcsubdir, workshareddir) elif not os.path.exists(workshareddir): - oe.path.copyhardlinktree(srcsubdir,workshareddir) + oe.path.copyhardlinktree(srcsubdir, workshareddir) tempdir_localdir = os.path.join(tempdir, 'oe-local-files') srctree_localdir = os.path.join(srctree, 'oe-local-files') @@ -689,7 +689,7 @@ def _extract_source(srctree, keep_temp, devbranch, sync, config, basepath, works shutil.move(tempdir_localdir, srcsubdir) shutil.move(srcsubdir, srctree) - symlink_oelocal_files_srctree(d,srctree) + symlink_oelocal_files_srctree(d, srctree) if is_kernel_yocto: logger.info('Copying kernel config to srctree') @@ -762,7 +762,7 @@ def get_staging_kver(srcdir): kerver = [] staging_kerVer="" if os.path.exists(srcdir) and os.listdir(srcdir): - with open(os.path.join(srcdir,"Makefile")) as f: + with open(os.path.join(srcdir, "Makefile")) as f: version = [next(f) for x in range(5)][1:4] for word in version: kerver.append(word.split('= ')[1].split('\n')[0]) @@ -843,10 +843,10 @@ def modify(args, config, basepath, workspace): staging_kerVer = get_staging_kver(srcdir) staging_kbranch = get_staging_kbranch(srcdir) if (os.path.exists(srcdir) and os.listdir(srcdir)) and (kernelVersion in staging_kerVer and staging_kbranch == kbranch): - oe.path.copyhardlinktree(srcdir,srctree) + oe.path.copyhardlinktree(srcdir, srctree) workdir = rd.getVar('WORKDIR') srcsubdir = rd.getVar('S') - localfilesdir = os.path.join(srctree,'oe-local-files') + localfilesdir = os.path.join(srctree, 'oe-local-files') # Move local source files into separate subdir recipe_patches = [os.path.basename(patch) for patch in oe.recipeutils.get_recipe_patches(rd)] local_files = oe.recipeutils.get_recipe_local_files(rd) @@ -870,9 +870,9 @@ def modify(args, config, basepath, workspace): for fname in local_files: _move_file(os.path.join(workdir, fname), os.path.join(srctree, 'oe-local-files', fname)) with open(os.path.join(srctree, 'oe-local-files', '.gitignore'), 'w') as f: - f.write('# Ignore local files, by default. Remove this file ''if you want to commit the directory to Git\n*\n') + f.write('# Ignore local files, by default. Remove this file if you want to commit the directory to Git\n*\n') - symlink_oelocal_files_srctree(rd,srctree) + symlink_oelocal_files_srctree(rd, srctree) task = 'do_configure' res = tinfoil.build_targets(pn, task, handle_events=True) @@ -880,7 +880,7 @@ def modify(args, config, basepath, workspace): # Copy .config to workspace kconfpath = rd.getVar('B') logger.info('Copying kernel config to workspace') - shutil.copy2(os.path.join(kconfpath, '.config'),srctree) + shutil.copy2(os.path.join(kconfpath, '.config'), srctree) # Set this to true, we still need to get initial_rev # by parsing the git repo @@ -1004,7 +1004,7 @@ def modify(args, config, basepath, workspace): ' mv ${S}/.config ${S}/.config.old\n' ' fi\n' '}\n') - if rd.getVarFlag('do_menuconfig','task'): + if rd.getVarFlag('do_menuconfig', 'task'): f.write('\ndo_configure:append() {\n' ' if [ ${@oe.types.boolean(d.getVar("KCONFIG_CONFIG_ENABLE_MENUCONFIG"))} = True ]; then\n' ' cp ${KCONFIG_CONFIG_ROOTDIR}/.config ${S}/.config.baseline\n' @@ -2081,7 +2081,7 @@ def _reset(recipes, no_clean, remove_work, config, basepath, workspace): # We don't want to risk wiping out any work in progress if srctreebase.startswith(os.path.join(config.workspace_path, 'sources')): from datetime import datetime - preservesrc = os.path.join(config.workspace_path, 'attic', 'sources', "{}.{}".format(pn,datetime.now().strftime("%Y%m%d%H%M%S"))) + preservesrc = os.path.join(config.workspace_path, 'attic', 'sources', "{}.{}".format(pn, datetime.now().strftime("%Y%m%d%H%M%S"))) logger.info('Preserving source tree in %s\nIf you no ' 'longer need it then please delete it manually.\n' 'It is also possible to reuse it via devtool source tree argument.' From patchwork Fri Feb 16 18:59:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Kjellerstedt X-Patchwork-Id: 39543 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 31C9CC48BEF for ; Fri, 16 Feb 2024 19:00:11 +0000 (UTC) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (EUR05-DB8-obe.outbound.protection.outlook.com [40.107.20.85]) by mx.groups.io with SMTP id smtpd.web11.5289.1708110006007900816 for ; Fri, 16 Feb 2024 11:00:06 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@axis.com header.s=selector1 header.b=WKHgILXo; spf=pass (domain: axis.com, ip: 40.107.20.85, mailfrom: peter.kjellerstedt@axis.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Grxuu8CrYNLqb1X6a2v1tSul56IYOjY053Uy9WhHgEHYAzwJtRr6JaLjKqy9UczQpUPQMIPk4KPOxdmYS0xn10QIpd7Ut35+QY9NiPStKORlyW1rzqwXYuJ8sxJRoDnsX2jV5EiRYsea5tHqYrGFiBfquMaexeqgUQdlb0EqlYXJILRnRUPXS0voHMN+XfxSuij6q7Z9h/fhx9pCOiR2+S8UQhAYjwd89KeYtBPzKkl5j37UfQSiMHrlv6oaRMtXUYstK/hrk9cNnovpB/HEcFe/tWj6pnp+xXtzAe18PybF0i+fu9WbZe0kSbI/+IGZe08qT2KEgvtaa6zd0KyF4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=Jz4g+PiDJCndTTvG4nyEZMrLvuy9Txk0v5JE0DdWCZ8=; b=CDry5Job9ttVe/rTxUa+sbbomjm/hUaUs9GljnrYI7NE3wnofIhhLijRGJir0aoADITzspj0ON7FN92zHsW2lt7GUhwpKh9wPm+l0MiF4JnmsschuC0WojvtJV+WTuTPL3oWTv+mhikltl3xAlwiAdsTQeS+UesdpuJXNcOLcYZ8T6bMYrdTkVVkeIHpjo9X5wUBk9jRXQxWw/4CXqQrN15xIb5kNqq3a8TGm+Pf9WdsDtEklIal6t+e2iGzwEMRzmUs7V+uegzh5Gh7qS3n/lWEFufpEwSuL8QLJo5Hr0OiNlaoHry7V0cbOZsvszmRGwr81WnyoHyoZqci++63eg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=fail (sender ip is 195.60.68.100) smtp.rcpttodomain=lists.openembedded.org smtp.mailfrom=axis.com; dmarc=fail (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=Jz4g+PiDJCndTTvG4nyEZMrLvuy9Txk0v5JE0DdWCZ8=; b=WKHgILXobA0vpYsBZMOoT4aCJavz0C7sbFaQ2/wQtcsJUjOHe6z6j5WooYuCUrDgNFFiwLRKiicTy95NAFydCKzasqUIOkv9Te1wJJxy18yOom0pZa0r32SHu+LUI8BW2l3/vA6caSNrbIIN7dxC0dc7IhboDHQcVyM9d4xVIss= Received: from AS4PR09CA0027.eurprd09.prod.outlook.com (2603:10a6:20b:5d4::17) by AM9PR02MB6529.eurprd02.prod.outlook.com (2603:10a6:20b:2c9::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.32; Fri, 16 Feb 2024 19:00:03 +0000 Received: from AM3PEPF00009BA2.eurprd04.prod.outlook.com (2603:10a6:20b:5d4:cafe::45) by AS4PR09CA0027.outlook.office365.com (2603:10a6:20b:5d4::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7270.38 via Frontend Transport; Fri, 16 Feb 2024 19:00:03 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 195.60.68.100) smtp.mailfrom=axis.com; dkim=none (message not signed) header.d=none;dmarc=fail action=none header.from=axis.com; Received-SPF: Fail (protection.outlook.com: domain of axis.com does not designate 195.60.68.100 as permitted sender) receiver=protection.outlook.com; client-ip=195.60.68.100; helo=mail.axis.com; Received: from mail.axis.com (195.60.68.100) by AM3PEPF00009BA2.mail.protection.outlook.com (10.167.16.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7292.25 via Frontend Transport; Fri, 16 Feb 2024 19:00:03 +0000 Received: from SE-MAIL21W.axis.com (10.20.40.16) by se-mail01w.axis.com (10.20.40.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Fri, 16 Feb 2024 20:00:02 +0100 Received: from se-mail01w.axis.com (10.20.40.7) by SE-MAIL21W.axis.com (10.20.40.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Fri, 16 Feb 2024 20:00:02 +0100 Received: from se-intmail01x.se.axis.com (10.0.5.60) by se-mail01w.axis.com (10.20.40.7) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Fri, 16 Feb 2024 20:00:02 +0100 Received: from saur (saur.se.axis.com [10.92.3.10]) by se-intmail01x.se.axis.com (Postfix) with ESMTP id 8750914698 for ; Fri, 16 Feb 2024 20:00:02 +0100 (CET) Received: from saur.se.axis.com (localhost [127.0.0.1]) by saur (8.17.1/8.15.2) with ESMTPS id 41GJ02QT2607010 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Fri, 16 Feb 2024 20:00:02 +0100 Received: (from pkj@localhost) by saur.se.axis.com (8.17.1/8.17.1/Submit) id 41GJ02282607009 for openembedded-core@lists.openembedded.org; Fri, 16 Feb 2024 20:00:02 +0100 From: Peter Kjellerstedt To: Subject: [PATCH 2/7] devtool: _extract_source: Correct the removal of an old backup directory Date: Fri, 16 Feb 2024 19:59:51 +0100 Message-ID: <20240216185956.2606978-2-pkj@axis.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240216185956.2606978-1-pkj@axis.com> References: <20240216185956.2606978-1-pkj@axis.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM3PEPF00009BA2:EE_|AM9PR02MB6529:EE_ X-MS-Office365-Filtering-Correlation-Id: a6113214-bb82-432e-8bf4-08dc2f217b6f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AWl2fHb8NnLeBxzXfUCbQ4oU6ANJo6KaHF7jwZZnxGQVXkN1naU2nsT8p3Yay+GXXTYeOpzxRED7l9WJMgaEKK5UCznYQNNiUrIhEGd4Fc8TMwZBU55U41l9EJWfBEiV+0pOEiR7kBg3UV1CP/79isOCqtiP05jQ624bxJrurwngJ1xI78Fya3wAy22pbIHOTE62uCFQnYf1hS09w5ffFeX6KtyZ6+sWPWf/tLFw4sECqHUezXgHks8JlapJFO1L+6cYFokFltBmCooVNRvGvnO3jfYXcujY87sn3PX6wKa2Eqz+45KKkpXJwi9paH0hXJkphnsl+D39bHrW1QDy/K8zFUAz+PimK5sYCiiB5QgWm8Kzi1DOe17IDuq5ppFhcPy4IjCr5NZHACGDq4d/um92TdXR9HvKDwhR+hDleUxM6XkIiRi3LI7F5XcrDSAco4416mV2GgL749KwjuRNrISqvLv1JU6eVTLR6We374TFisnwobE+rncrFPHglVK6HCryn9LECK+pWlbxh6JrP9V//IQ+rmBYtLutJ/NddFNTnJBsxitHarFx7YhLaTgQNztCAAys3h5z1CcDpIFWEFITU4XOGsdaA6kKQykFJE6g7IeBuLrHEhkIZH/t0ZaQw3yMW+kG2jVHjJJs2Pgisb1jwWnnJpF3oluYdLR+Fwo= 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:(13230031)(4636009)(136003)(39860400002)(396003)(346002)(376002)(230922051799003)(186009)(36860700004)(82310400011)(64100799003)(1800799012)(451199024)(46966006)(40470700004)(42186006)(6666004)(316002)(8676002)(6916009)(8936002)(5660300002)(2906002)(70206006)(70586007)(478600001)(1076003)(36756003)(2616005)(41300700001)(26005)(81166007)(83380400001)(336012)(426003)(356005)(82740400003);DIR:OUT;SFP:1101; X-OriginatorOrg: axis.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Feb 2024 19:00:03.0633 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a6113214-bb82-432e-8bf4-08dc2f217b6f 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: AM3PEPF00009BA2.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR02MB6529 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 16 Feb 2024 19:00:11 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/195793 Also correct the comment describing what is happening. Signed-off-by: Peter Kjellerstedt --- scripts/lib/devtool/standard.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py index dd9232da1c..ccb7ea851b 100644 --- a/scripts/lib/devtool/standard.py +++ b/scripts/lib/devtool/standard.py @@ -667,13 +667,13 @@ def _extract_source(srctree, keep_temp, devbranch, sync, config, basepath, works if sync: bb.process.run('git fetch file://' + srcsubdir + ' ' + devbranch + ':' + devbranch, cwd=srctree) - # Move oe-local-files directory to srctree - # As the oe-local-files is not part of the constructed git tree, - # remove them directly during the synchrounizating might surprise - # the users. Instead, we move it to oe-local-files.bak and remind - # user in the log message. + # Move the oe-local-files directory to srctree. + # As oe-local-files is not part of the constructed git tree, + # removing it directly during the synchronization might surprise + # the user. Instead, we move it to oe-local-files.bak and remind + # the user in the log message. if os.path.exists(srctree_localdir + '.bak'): - shutil.rmtree(srctree_localdir, srctree_localdir + '.bak') + shutil.rmtree(srctree_localdir + '.bak') if os.path.exists(srctree_localdir): logger.info('Backing up current local file directory %s' % srctree_localdir) From patchwork Fri Feb 16 18:59:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Kjellerstedt X-Patchwork-Id: 39544 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 2BA76C48260 for ; Fri, 16 Feb 2024 19:00:11 +0000 (UTC) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (EUR05-VI1-obe.outbound.protection.outlook.com [40.107.21.47]) by mx.groups.io with SMTP id smtpd.web10.5206.1708110006840751735 for ; Fri, 16 Feb 2024 11:00:07 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@axis.com header.s=selector1 header.b=FFANPXMo; spf=pass (domain: axis.com, ip: 40.107.21.47, mailfrom: peter.kjellerstedt@axis.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=B/llnQVp3CTgiPGt6AOfvPuv1eNZe7+VO2dAju8r+pBhneofRr+OtNAx1SwAJLqz237twJZmicW1zjMTgNojxffEmpk9Qsf064PqTRXl5KDD0IhTVwKgRqilQSa+SkWBkD13DsaRJGakaRNrsKWGnchnhwcerIePcnU3GYOhkum5DfH+QVHyoNrpoWD4cpCoZqixcQvXco+/qaXrRiQ0/BWBbfnW2O1KvYiMFOhntqQxImtw2Vv9IFWYPf6l0BetVdXepFFkvef+nDCI3tKUAquZjJZ/RrvEU8oUlDMkeaqGSgS8Jm32AmyzB93VoICDQbvaRyDJLoConvpSuIF9+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=r5d8M/L8/PK9c1gtxoMLKX49i1JAdsrNeXKArR30d0w=; b=DQYeEpc5KGYvKbEHQ+Egdphbo36ienAQrfA0oGusb0C9rnISiq64e2G6P1ML5cvQyxmE6I6PYAGUiVqIwO2wz6/YVd7RyHZc6ATtqEfZtI/WJxm+Flrba7oBypSRN4KpkL7lqSGtD5X5b9+SNIg30Z5ilo45TTNMtZcPNJe2vuIoHyKWIqux0IHNWVqh9zPjEuWN0f+hFX1WqVPt4kfcnH2/v2vShkCdOZ6S/5mFoaST3+n7JTcIRxUUAuumLrA5nKOaDryG+e+F1xFoeeVMqm6EFLefvtpxuRInMKAm3rcDH6LThEX2ytGNKlVs+sCZPvlFCKF91Aouk83dFDzUKQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=fail (sender ip is 195.60.68.100) smtp.rcpttodomain=lists.openembedded.org smtp.mailfrom=axis.com; dmarc=fail (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=r5d8M/L8/PK9c1gtxoMLKX49i1JAdsrNeXKArR30d0w=; b=FFANPXMoCBtsxrZRlg0ktx2nsRRTYfj8uVoDuSAx7ukMdisNLtoZ/xPsY2CA4+5+uVGj7IdgrRDR7Js0niBc8o1V6ANglXeLUPdNfY4sLj8yaC+PzC0/MzGX8sqfDwwOkznvcvXXm+SEuJdI426Z1gWuj1SUGvxjeRxlA70ljgI= Received: from AS4PR09CA0019.eurprd09.prod.outlook.com (2603:10a6:20b:5d4::10) by PR3PR02MB6153.eurprd02.prod.outlook.com (2603:10a6:102:64::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.31; Fri, 16 Feb 2024 19:00:03 +0000 Received: from AM3PEPF00009BA2.eurprd04.prod.outlook.com (2603:10a6:20b:5d4:cafe::c6) by AS4PR09CA0019.outlook.office365.com (2603:10a6:20b:5d4::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7270.39 via Frontend Transport; Fri, 16 Feb 2024 19:00:03 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 195.60.68.100) smtp.mailfrom=axis.com; dkim=none (message not signed) header.d=none;dmarc=fail action=none header.from=axis.com; Received-SPF: Fail (protection.outlook.com: domain of axis.com does not designate 195.60.68.100 as permitted sender) receiver=protection.outlook.com; client-ip=195.60.68.100; helo=mail.axis.com; Received: from mail.axis.com (195.60.68.100) by AM3PEPF00009BA2.mail.protection.outlook.com (10.167.16.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7292.25 via Frontend Transport; Fri, 16 Feb 2024 19:00:03 +0000 Received: from se-mail01w.axis.com (10.20.40.7) by se-mail01w.axis.com (10.20.40.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Fri, 16 Feb 2024 20:00:02 +0100 Received: from se-intmail01x.se.axis.com (10.0.5.60) by se-mail01w.axis.com (10.20.40.7) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Fri, 16 Feb 2024 20:00:02 +0100 Received: from saur (saur.se.axis.com [10.92.3.10]) by se-intmail01x.se.axis.com (Postfix) with ESMTP id ADE8A1493F for ; Fri, 16 Feb 2024 20:00:02 +0100 (CET) Received: from saur.se.axis.com (localhost [127.0.0.1]) by saur (8.17.1/8.15.2) with ESMTPS id 41GJ02hG2607014 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Fri, 16 Feb 2024 20:00:02 +0100 Received: (from pkj@localhost) by saur.se.axis.com (8.17.1/8.17.1/Submit) id 41GJ02lT2607013 for openembedded-core@lists.openembedded.org; Fri, 16 Feb 2024 20:00:02 +0100 From: Peter Kjellerstedt To: Subject: [PATCH 3/7] lib/oe/patch: Make extractPatches() not extract ignored commits Date: Fri, 16 Feb 2024 19:59:52 +0100 Message-ID: <20240216185956.2606978-3-pkj@axis.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240216185956.2606978-1-pkj@axis.com> References: <20240216185956.2606978-1-pkj@axis.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM3PEPF00009BA2:EE_|PR3PR02MB6153:EE_ X-MS-Office365-Filtering-Correlation-Id: 5675c64a-4596-4f1c-6228-08dc2f217ba6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WIxUA0bXT+rxOYtY7ahCvkc/qvP1xeval9lvPSqQs066x2Q/8rNATU9SwKqYXS66YdO7AloLY6cWoFdkmtl0xYBYZZ5owsGBG5knKIc9t+bcSEYIJdBZ2tq9aLfneJpjiVGKcH625/qsX7tOFvAishth55l3GT/0rtfR0N02H577qeppbtMJaL8q165G7Wz46OTucJT3uEhXfS5ZNrYuqhLzXSt518RMWbL14SOIXjir6ZcO7Yfe+SB/Es3ti16DiQpBEeL6z6GJmSxnuc8eoa0mEOTHA2zCZOJ8Kndu0WreyMlbB+b0wUcgxRJafeZ6jIX34DGoOdkAW2pR9ldH8gjfFUlWrFd8myeFTvMZpGD12JR2xTOO7dqMBaK1kmT37a69PIw8MMg3O1pCfztR6fgcEFtdsMCdE61+DwCJc2QOzvjqfoCTXsPW5f1QkXZKQ05kZkqaYZABYTtBYr3QjGBR2zbKDpEo7OHJdFKCPxo/5gPPd89R8GSIqMeMi5UXRvVThfSq91ioysl55c5NwzOQC2dPAAYzjXbBGF/iDkIMCaLLnDqQc5XnC3fEJNaruJ1qafNs9Vm4ONFcDjye/7WqPxOqePA+N7EVuF9zggPYR2Hf8O/u/GYUSfJkrLQO6CP+FZPuE24F6XEdTe/ooA== 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:(13230031)(4636009)(346002)(396003)(39860400002)(136003)(376002)(230922051799003)(1800799012)(186009)(64100799003)(82310400011)(36860700004)(451199024)(40470700004)(46966006)(6666004)(356005)(81166007)(82740400003)(41300700001)(30864003)(2906002)(26005)(70206006)(42186006)(478600001)(966005)(6916009)(316002)(70586007)(336012)(2616005)(1076003)(83380400001)(426003)(5660300002)(36756003)(8676002)(8936002)(19627235002);DIR:OUT;SFP:1101; X-OriginatorOrg: axis.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Feb 2024 19:00:03.4226 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5675c64a-4596-4f1c-6228-08dc2f217ba6 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: AM3PEPF00009BA2.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR02MB6153 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 16 Feb 2024 19:00:11 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/195796 If a commit is marked with "%% ignore" it means it is used by devtool to keep track of changes to the source code that are not the result of running do_patch(). These changes need to actually be ignored when extracting the patches as they typically make no sense as actual patches in a recipe. This also adds a new test for oe-selftest that verifies that there are no patches generated from ignored commits. Signed-off-by: Peter Kjellerstedt --- .../0055-Add-cstdint-for-uintXX_t-types.patch | 38 +++++++++++ ...099-cmake-Pass-PROBE_NAME-via-CFLAGS.patch | 29 +++++++++ .../sysdig/sysdig-selftest_0.28.0.bb | 64 +++++++++++++++++++ meta/lib/oe/patch.py | 16 ++--- meta/lib/oeqa/selftest/cases/devtool.py | 46 +++++++++++++ 5 files changed, 185 insertions(+), 8 deletions(-) create mode 100644 meta-selftest/recipes-extended/sysdig/sysdig-selftest/0055-Add-cstdint-for-uintXX_t-types.patch create mode 100644 meta-selftest/recipes-extended/sysdig/sysdig-selftest/0099-cmake-Pass-PROBE_NAME-via-CFLAGS.patch create mode 100644 meta-selftest/recipes-extended/sysdig/sysdig-selftest_0.28.0.bb diff --git a/meta-selftest/recipes-extended/sysdig/sysdig-selftest/0055-Add-cstdint-for-uintXX_t-types.patch b/meta-selftest/recipes-extended/sysdig/sysdig-selftest/0055-Add-cstdint-for-uintXX_t-types.patch new file mode 100644 index 0000000000..e564958dad --- /dev/null +++ b/meta-selftest/recipes-extended/sysdig/sysdig-selftest/0055-Add-cstdint-for-uintXX_t-types.patch @@ -0,0 +1,38 @@ +From 3d076ea588eb3c7f334133b4c31172a14beadf5b Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 2 Feb 2023 20:18:27 -0800 +Subject: [PATCH] Add for uintXX_t types + +gcc 13 moved some includes around and as a result is no +longer transitively included [1]. Explicitly include it +for uintXX_t. + +[1] https://gcc.gnu.org/gcc-13/porting_to.html#header-dep-changes + +Upstream-Status: Submitted [https://github.com/falcosecurity/libs/pull/862] +Signed-off-by: Khem Raj +--- + userspace/libsinsp/filter/parser.h | 1 + + userspace/libsinsp/filter_value.h | 1 + + 2 files changed, 2 insertions(+) + +--- a/userspace/libsinsp/filter/parser.h ++++ b/userspace/libsinsp/filter/parser.h +@@ -18,6 +18,7 @@ limitations under the License. + #pragma once + + #include "ast.h" ++#include + + // + // Context-free Grammar for Sinsp Filters +--- a/userspace/libsinsp/filter_value.h ++++ b/userspace/libsinsp/filter_value.h +@@ -18,6 +18,7 @@ limitations under the License. + #pragma once + + #include ++#include + #include + + // Used for CO_IN/CO_PMATCH filterchecks using PT_CHARBUFs to allow diff --git a/meta-selftest/recipes-extended/sysdig/sysdig-selftest/0099-cmake-Pass-PROBE_NAME-via-CFLAGS.patch b/meta-selftest/recipes-extended/sysdig/sysdig-selftest/0099-cmake-Pass-PROBE_NAME-via-CFLAGS.patch new file mode 100644 index 0000000000..903ccdf36a --- /dev/null +++ b/meta-selftest/recipes-extended/sysdig/sysdig-selftest/0099-cmake-Pass-PROBE_NAME-via-CFLAGS.patch @@ -0,0 +1,29 @@ +From ed8969a233adb6bf701de96d0fd0570e5ddcc787 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Mon, 21 Mar 2022 19:35:48 -0700 +Subject: [PATCH] cmake: Pass PROBE_NAME via CFLAGS + +This helps compliation of driver code where its calling modprobe on the +given kernel module via system() API + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + CMakeLists.txt | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 7dceb7ae..e156c36f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -149,6 +149,7 @@ if(CMAKE_SYSTEM_NAME MATCHES "Linux") + if(NOT DEFINED PROBE_NAME) + set(PROBE_NAME "scap") + endif() ++ add_definitions(-DPROBE_NAME="${PROBE_NAME}") + + set(DRIVERS_REPO "https://download.sysdig.com/scap-drivers") + +-- +2.35.1 + diff --git a/meta-selftest/recipes-extended/sysdig/sysdig-selftest_0.28.0.bb b/meta-selftest/recipes-extended/sysdig/sysdig-selftest_0.28.0.bb new file mode 100644 index 0000000000..e114f465a0 --- /dev/null +++ b/meta-selftest/recipes-extended/sysdig/sysdig-selftest_0.28.0.bb @@ -0,0 +1,64 @@ +SUMMARY = "A New System Troubleshooting Tool Built for the Way You Work" +DESCRIPTION = "Sysdig is open source, system-level exploration: capture \ +system state and activity from a running Linux instance, then save, \ +filter and analyze." +HOMEPAGE = "http://www.sysdig.org/" +LICENSE = "Apache-2.0 & (MIT | GPL-2.0-only)" +LIC_FILES_CHKSUM = "file://COPYING;md5=f8fee3d59797546cffab04f3b88b2d44" + +inherit cmake pkgconfig + +#OECMAKE_GENERATOR = "Unix Makefiles" +JIT ?= "jit" +JIT:mipsarchn32 = "" +JIT:mipsarchn64 = "" +JIT:riscv64 = "" +JIT:riscv32 = "" +JIT:powerpc = "" +JIT:powerpc64le = "" +JIT:powerpc64 = "" + +#DEPENDS += "libb64 lua${JIT} zlib c-ares grpc-native grpc curl ncurses jsoncpp \ +# tbb jq openssl elfutils protobuf protobuf-native jq-native valijson" +RDEPENDS:${PN} = "bash" + +SRC_URI = "git://github.com/draios/sysdig.git;branch=dev;protocol=https;name=sysdig \ + git://github.com/falcosecurity/libs;protocol=https;branch=master;name=falco;subdir=git/falcosecurity-libs \ + file://0055-Add-cstdint-for-uintXX_t-types.patch;patchdir=./falcosecurity-libs \ + file://0099-cmake-Pass-PROBE_NAME-via-CFLAGS.patch \ + " +SRCREV_sysdig = "4fb6288275f567f63515df0ff0a6518043ecfa9b" +SRCREV_falco= "caa0e4d0044fdaaebab086592a97f0c7f32aeaa9" + +SRCREV_FORMAT = "sysdig_falco" + +S = "${WORKDIR}/git" + +EXTRA_OECMAKE = "\ + -DBUILD_DRIVER=OFF \ + -DMINIMAL_BUILD=ON \ + -DUSE_BUNDLED_DEPS=OFF \ + -DCREATE_TEST_TARGETS=OFF \ + -DDIR_ETC=${sysconfdir} \ + -DLUA_INCLUDE_DIR=${STAGING_INCDIR}/luajit-2.1 \ + -DFALCOSECURITY_LIBS_SOURCE_DIR=${S}/falcosecurity-libs \ + -DVALIJSON_INCLUDE=${STAGING_INCDIR}/valijson \ +" + +#CMAKE_VERBOSE = "VERBOSE=1" + +FILES:${PN} += " \ + ${DIR_ETC}/* \ + ${datadir}/zsh/* \ + ${prefix}/src/* \ +" +# Use getaddrinfo_a is a GNU extension in libsinsp +# It should be fixed in sysdig, until then disable +# on musl +# Something like this https://code.videolan.org/ePirat/vlc/-/commit/01fd9fe4c7f6c5558f7345f38abf0152e17853ab is needed to fix it +COMPATIBLE_HOST:libc-musl = "null" +COMPATIBLE_HOST:mips = "null" +COMPATIBLE_HOST:riscv64 = "null" +COMPATIBLE_HOST:riscv32 = "null" +COMPATIBLE_HOST:powerpc = "null" +COMPATIBLE_HOST:powerpc64le = "null" diff --git a/meta/lib/oe/patch.py b/meta/lib/oe/patch.py index d5ad4f3dc1..70cdb1d9c0 100644 --- a/meta/lib/oe/patch.py +++ b/meta/lib/oe/patch.py @@ -474,9 +474,9 @@ class GitApplyTree(PatchTree): out = runcmd(["sh", "-c", " ".join(shellcmd)], os.path.join(tree, name)) if out: for srcfile in out.split(): + outfile = os.path.basename(srcfile) for encoding in ['utf-8', 'latin-1']: patchlines = [] - outfile = None try: with open(srcfile, 'r', encoding=encoding, newline='') as f: for line in f: @@ -484,7 +484,8 @@ class GitApplyTree(PatchTree): outfile = line.split()[-1].strip() continue if line.startswith(GitApplyTree.ignore_commit_prefix): - continue + outfile = None + break patchlines.append(line) except UnicodeDecodeError: continue @@ -492,12 +493,11 @@ class GitApplyTree(PatchTree): else: raise PatchError('Unable to find a character encoding to decode %s' % srcfile) - if not outfile: - outfile = os.path.basename(srcfile) - bb.utils.mkdirhier(os.path.join(outdir, name)) - with open(os.path.join(outdir, name, outfile), 'w') as of: - for line in patchlines: - of.write(line) + if outfile: + bb.utils.mkdirhier(os.path.join(outdir, name)) + with open(os.path.join(outdir, name, outfile), 'w') as of: + for line in patchlines: + of.write(line) finally: shutil.rmtree(tempdir) diff --git a/meta/lib/oeqa/selftest/cases/devtool.py b/meta/lib/oeqa/selftest/cases/devtool.py index dd3a5e9b5c..abc85c90a7 100644 --- a/meta/lib/oeqa/selftest/cases/devtool.py +++ b/meta/lib/oeqa/selftest/cases/devtool.py @@ -2227,6 +2227,52 @@ class DevtoolUpgradeTests(DevtoolBase): if files: self.fail('Unexpected file(s) copied next to bbappend: %s' % ', '.join(files)) + def test_devtool_finish_update_patch(self): + # This test uses a modified version of the sysdig recipe from meta-oe. + # - The patches have been renamed. + # - The dependencies are commented out since the recipe is not being + # built. + # + # The sysdig recipe is interesting in that it fetches two different Git + # repositories, and there are patches for both. This leads to that + # devtool will create ignore commits as it uses Git submodules to keep + # track of the second repository. + # + # This test will verify that the ignored commits actually are ignored + # when a commit in between is modified. It will also verify that the + # updated patch keeps its original name. + + # Check preconditions + self.assertTrue(not os.path.exists(self.workspacedir), 'This test cannot be run with a workspace directory under the build directory') + # Try modifying a recipe + self.track_for_cleanup(self.workspacedir) + recipe = 'sysdig-selftest' + recipefile = get_bb_var('FILE', recipe) + recipedir = os.path.dirname(recipefile) + result = runCmd('git status --porcelain .', cwd=recipedir) + if result.output.strip(): + self.fail('Recipe directory for %s contains uncommitted changes' % recipe) + tempdir = tempfile.mkdtemp(prefix='devtoolqa') + self.track_for_cleanup(tempdir) + self.add_command_to_tearDown('bitbake-layers remove-layer */workspace') + result = runCmd('devtool modify %s %s' % (recipe, tempdir)) + self.add_command_to_tearDown('cd %s; rm %s/*; git checkout %s %s' % (recipedir, recipe, recipe, os.path.basename(recipefile))) + self.assertExists(os.path.join(tempdir, 'CMakeLists.txt'), 'Extracted source could not be found') + # Make a change to one of the existing commits + result = runCmd('echo "# A comment " >> CMakeLists.txt', cwd=tempdir) + result = runCmd('git status --porcelain', cwd=tempdir) + self.assertIn('M CMakeLists.txt', result.output) + result = runCmd('git commit --fixup HEAD^ CMakeLists.txt', cwd=tempdir) + result = runCmd('git show -s --format=%s', cwd=tempdir) + self.assertIn('fixup! cmake: Pass PROBE_NAME via CFLAGS', result.output) + result = runCmd('GIT_SEQUENCE_EDITOR=true git rebase -i --autosquash devtool-base', cwd=tempdir) + result = runCmd('devtool finish %s meta-selftest' % recipe) + result = runCmd('devtool status') + 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', '.*/0099-cmake-Pass-PROBE_NAME-via-CFLAGS.patch$')] + self._check_repo_status(recipedir, expected_status) + def test_devtool_rename(self): # Check preconditions self.assertTrue(not os.path.exists(self.workspacedir), 'This test cannot be run with a workspace directory under the build directory') From patchwork Fri Feb 16 18:59:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Kjellerstedt X-Patchwork-Id: 39546 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 5CBD9C48BF8 for ; Fri, 16 Feb 2024 19:00:11 +0000 (UTC) Received: from EUR02-VI1-obe.outbound.protection.outlook.com (EUR02-VI1-obe.outbound.protection.outlook.com [40.107.241.81]) by mx.groups.io with SMTP id smtpd.web10.5207.1708110006843341487 for ; Fri, 16 Feb 2024 11:00:07 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@axis.com header.s=selector1 header.b=Lx/KBm7q; spf=pass (domain: axis.com, ip: 40.107.241.81, mailfrom: peter.kjellerstedt@axis.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AzMBHHraRCPEceFGEgFhKLvRv/+ZhSAEhmOEHaqDv/ZhQh7AJ82N8+fJ8WSHk5C1zmNf2EfknnIEwk+hSqzy85bSrKGo50LMIQCwyqKCIwy6XLyFiEXvyB/2FMFPhAkh1XPpeaOvj92R/YM1WT5lwPo6fDpMNO1lZ6ItLm1VHiO1oyAiOviJVpDMMUsqH07uOekJ+LEIcBF/3NwOWavqCoKTjrqrEtkt1mhyX/23/sCEeaGoJpBb+43bqWVpcvVt0Hawy+g3+0LadIetJoqpGy4RniFva7p8MYGLcmcxM0ikOIUll8LsA37dC8q6rFOItUoxb8jC3j0V91lMbOaWaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=a9IZylfdaz+WQ7rJOxxIIfeKL85hid8jiOfTBm37z88=; b=F1wv6rRQukPi0g+ubuxdMbwpdmoExnXzYNxbM5LkH5yr2BZFW3FQrdg/XKN89zF3RPR8kCj9oQq9DKxVIkrI44STCWTql+uusm0zqggYR8ZcBhpj5ieK76CVRlMsE4h1nhyh77EPeX8MtadmJy5zlICXJEQM/FrLMzwBFtbPdBZj952KWw3AsdD4F5RSCK+XA04ZGv22HUxp1paPSb908Z5Q8YHwlBHZUn0hmGuZ+VXbxRIykiaEfS2pz31Gk5wweDGUyPKaRY4VsgzFGT9QFFbi5c+cZAk2YZ0Z6z/P/EHalubuLJNwIomDSAMDjVxVBby4Rh6AWCpViy/fXa9GFA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=fail (sender ip is 195.60.68.100) smtp.rcpttodomain=lists.openembedded.org smtp.mailfrom=axis.com; dmarc=fail (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=a9IZylfdaz+WQ7rJOxxIIfeKL85hid8jiOfTBm37z88=; b=Lx/KBm7q7DRHWF0LTxAqDIIydb/f7Pudh/KV1/HEy/3wvoqHSwKw3pTmvZpPtBlC6dkH15TrljyuH1WMgHY9NI6Er7v2+Q0RsN7z/7Szi1fWwpO2B/H5kBbN90V+m9fcolCp1olNXqKqdvVQpTPmyAJPWKcDN20y/JgPNuVqLOc= Received: from AS4P195CA0032.EURP195.PROD.OUTLOOK.COM (2603:10a6:20b:65a::6) by DU2PR02MB10330.eurprd02.prod.outlook.com (2603:10a6:10:46e::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.27; Fri, 16 Feb 2024 19:00:03 +0000 Received: from AM3PEPF00009B9B.eurprd04.prod.outlook.com (2603:10a6:20b:65a:cafe::a8) by AS4P195CA0032.outlook.office365.com (2603:10a6:20b:65a::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.26 via Frontend Transport; Fri, 16 Feb 2024 19:00:03 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 195.60.68.100) smtp.mailfrom=axis.com; dkim=none (message not signed) header.d=none;dmarc=fail action=none header.from=axis.com; Received-SPF: Fail (protection.outlook.com: domain of axis.com does not designate 195.60.68.100 as permitted sender) receiver=protection.outlook.com; client-ip=195.60.68.100; helo=mail.axis.com; Received: from mail.axis.com (195.60.68.100) by AM3PEPF00009B9B.mail.protection.outlook.com (10.167.16.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7292.25 via Frontend Transport; Fri, 16 Feb 2024 19:00:03 +0000 Received: from SE-MAIL21W.axis.com (10.20.40.16) by se-mail02w.axis.com (10.20.40.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Fri, 16 Feb 2024 20:00:03 +0100 Received: from se-mail01w.axis.com (10.20.40.7) by SE-MAIL21W.axis.com (10.20.40.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Fri, 16 Feb 2024 20:00:02 +0100 Received: from se-intmail01x.se.axis.com (10.0.5.60) by se-mail01w.axis.com (10.20.40.7) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Fri, 16 Feb 2024 20:00:02 +0100 Received: from saur (saur.se.axis.com [10.92.3.10]) by se-intmail01x.se.axis.com (Postfix) with ESMTP id C22E014698 for ; Fri, 16 Feb 2024 20:00:02 +0100 (CET) Received: from saur.se.axis.com (localhost [127.0.0.1]) by saur (8.17.1/8.15.2) with ESMTPS id 41GJ029A2607018 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Fri, 16 Feb 2024 20:00:02 +0100 Received: (from pkj@localhost) by saur.se.axis.com (8.17.1/8.17.1/Submit) id 41GJ02Ac2607017 for openembedded-core@lists.openembedded.org; Fri, 16 Feb 2024 20:00:02 +0100 From: Peter Kjellerstedt To: Subject: [PATCH 4/7] lib/oe/patch: Add GitApplyTree.commitIgnored() Date: Fri, 16 Feb 2024 19:59:53 +0100 Message-ID: <20240216185956.2606978-4-pkj@axis.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240216185956.2606978-1-pkj@axis.com> References: <20240216185956.2606978-1-pkj@axis.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM3PEPF00009B9B:EE_|DU2PR02MB10330:EE_ X-MS-Office365-Filtering-Correlation-Id: 587aadab-6fe5-466c-d2da-08dc2f217bc0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kn4GH0Hc/AR2Rr5aNl3h4CxswMfX8MuTfUkz6SZoPhY/RXvdvEWLVmS4NEXTd7o1zx4ldxN2aYIWBIYksObQ6kBP8uijxUKVmNBYUAJMcjU4p/oXe0iGeguyt/ltIKQCANbPr6LXUk/OJ1jl/DKm04BG5iSrA/KIPU7jnKOoBqI0VbQADzQmAgAsU7uExsS70YSuWisChEqbksJ358R4G1zhc98SgmAkZpJYXnBOx7zivoKwP7cmykXRRbQAnSZrD+I2idp+afOnoMaHCe48QkvqXuepVY57/QF6vJOC0Sg5qvq6ENXdRvgYEgf9qXGCmNt5vZu2R9yf+vBeKe+/wGKHEZjqUAC+Ch/RAeSNDWFFr033mnegU227ckn+FP3S9GpM0G1dAMO+y8yVb6+/j+ayfDOuk4UNg3raTrbsJt+T/bz31s+8FyFhSKDTBIyqORQaaq5GqgVixokKof+QLrmQkg6yxa83BLWzEi095E3Kw/wx45XC2Ca3HYEYJCZgyPXTnk1g/yYCJrqWN5iXiOrniZ1qzgIS+u5ixAod78TfJ6kQOVelZjVbfG8s4ZeiJ9j5T9uLklj2wcCljYA9uq4ethfOLEci5VHDP8gI+xMRtxcO+SwKT1wYistoKJn0j54a5cg3XTNiXElCNIl2twvdhxjXOQk59bom3kUlfo0= 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:(13230031)(4636009)(376002)(346002)(136003)(39850400004)(396003)(230922051799003)(82310400011)(186009)(451199024)(1800799012)(64100799003)(36860700004)(46966006)(40470700004)(478600001)(41300700001)(2616005)(8676002)(2906002)(6916009)(8936002)(4744005)(70206006)(5660300002)(70586007)(6666004)(316002)(42186006)(26005)(1076003)(336012)(83380400001)(36756003)(82740400003)(426003)(81166007)(356005);DIR:OUT;SFP:1101; X-OriginatorOrg: axis.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Feb 2024 19:00:03.6115 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 587aadab-6fe5-466c-d2da-08dc2f217bc0 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: AM3PEPF00009B9B.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR02MB10330 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 16 Feb 2024 19:00:11 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/195795 This function can be used to create a commit that devtool will ignore when creating/updating the patches. Signed-off-by: Peter Kjellerstedt --- meta/lib/oe/patch.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/meta/lib/oe/patch.py b/meta/lib/oe/patch.py index 70cdb1d9c0..3ded5f3601 100644 --- a/meta/lib/oe/patch.py +++ b/meta/lib/oe/patch.py @@ -460,6 +460,16 @@ class GitApplyTree(PatchTree): cmd.append('--date="%s"' % date) return (tmpfile, cmd) + @staticmethod + def commitIgnored(subject, dir=None, files=None, d=None): + if files: + runcmd(['git', 'add'] + files, dir) + message = "%s\n\n%s" % (subject, GitApplyTree.ignore_commit_prefix) + cmd = ["git"] + GitApplyTree.gitCommandUserOptions(cmd, d=d) + cmd += ["commit", "-m", message, "--no-verify"] + runcmd(cmd, dir) + @staticmethod def extractPatches(tree, startcommits, outdir, paths=None): import tempfile From patchwork Fri Feb 16 18:59:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Kjellerstedt X-Patchwork-Id: 39547 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 34825C48BC4 for ; Fri, 16 Feb 2024 19:00:11 +0000 (UTC) Received: from EUR02-AM0-obe.outbound.protection.outlook.com (EUR02-AM0-obe.outbound.protection.outlook.com [40.107.247.61]) by mx.groups.io with SMTP id smtpd.web10.5208.1708110007093854274 for ; Fri, 16 Feb 2024 11:00:07 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@axis.com header.s=selector1 header.b=XHjUOP49; spf=pass (domain: axis.com, ip: 40.107.247.61, mailfrom: peter.kjellerstedt@axis.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i7p0tYnhktZAqdMR6ETXeZ6QTt+8PyHfJFpgri3CFAwzDGLMRTkIs4GEeBVgBU/RhCwWBP4cCYse4CV3dfb8D7JX1DZD/hsHrZfL3alo35VF8NF1P4H3HrAxHFXiTJuTCkVbA3qr5vKk5CC/8gi/DIdxFTQQcm2ASs9ryC21PUIRYlxNHUdfi5KuIbD8T8gmioQ6R5fIH/ZNUTGhGqt/PplbS8f5zEvsUWTAgwJEZiaz3+kyuqd1xnNKpQlfVf7qivYp3gIWSe7Bu6WWT0hngSLIKmoh1vHE0dHKb9yMN3jMTlP5aAo7IL2/WvtAdwdN7BiZBlKUAQwGSMLHkmFlJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=FVpFys/UN3QzTJpYCvXQkogN6cKHWIjSQVDt9beS9JI=; b=B0n7IFFFAC5vNOXrzY0vlLsu0A32sFbXk0mYu/sJSyw08Iq54SYHqSKbUXmFxqO6Pix5lqGGaj6HABkI7M7z/8I63URO5JvFzBuO+k14BkVabTZFyVAgljDmWa3dZmphHJ5uH40Dae3RkpgydZGHdSH3+CyM59NtSfbmYmzduUjVTCzw6YMldNpxoF748x9vPEdI5dNSz7doyrAVQ2Y0O24H4n7l5KEFMpKNH+sfsHwfm+FzPilIgWHJJsKqBCjhtPUwcPF0pyzl+aZP5Bj+mlu8HIxztBdKE2/4uqQVv3zOZleHQiXqnO7GyWVzoPuI3svZqWAjSS6K5VaL2YVDog== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=fail (sender ip is 195.60.68.100) smtp.rcpttodomain=lists.openembedded.org smtp.mailfrom=axis.com; dmarc=fail (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=FVpFys/UN3QzTJpYCvXQkogN6cKHWIjSQVDt9beS9JI=; b=XHjUOP493Hw+OKZmqLX68aOVVuwOGNQebxHNHbwfAz19a3gdDNbK4IPd8V0gQvK/2Fm/F8zFdnV03s4OjD/xL7/PsvtsX14e4a6mtCPSo4imIL5bzgcpSdKM6+g7zcCHUHE++5p3dalgH+lQbn6NqiOzAc6bJpFZRPIucPJpMt0= Received: from AS4PR09CA0022.eurprd09.prod.outlook.com (2603:10a6:20b:5d4::14) by DU5PR02MB10745.eurprd02.prod.outlook.com (2603:10a6:10:527::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.29; Fri, 16 Feb 2024 19:00:04 +0000 Received: from AM3PEPF00009BA2.eurprd04.prod.outlook.com (2603:10a6:20b:5d4:cafe::2b) by AS4PR09CA0022.outlook.office365.com (2603:10a6:20b:5d4::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7270.39 via Frontend Transport; Fri, 16 Feb 2024 19:00:03 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 195.60.68.100) smtp.mailfrom=axis.com; dkim=none (message not signed) header.d=none;dmarc=fail action=none header.from=axis.com; Received-SPF: Fail (protection.outlook.com: domain of axis.com does not designate 195.60.68.100 as permitted sender) receiver=protection.outlook.com; client-ip=195.60.68.100; helo=mail.axis.com; Received: from mail.axis.com (195.60.68.100) by AM3PEPF00009BA2.mail.protection.outlook.com (10.167.16.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7292.25 via Frontend Transport; Fri, 16 Feb 2024 19:00:03 +0000 Received: from SE-MAILARCH01W.axis.com (10.20.40.15) by se-mail01w.axis.com (10.20.40.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Fri, 16 Feb 2024 20:00:03 +0100 Received: from se-mail01w.axis.com (10.20.40.7) 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.2375.34; Fri, 16 Feb 2024 20:00:02 +0100 Received: from se-intmail01x.se.axis.com (10.0.5.60) by se-mail01w.axis.com (10.20.40.7) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Fri, 16 Feb 2024 20:00:02 +0100 Received: from saur (saur.se.axis.com [10.92.3.10]) by se-intmail01x.se.axis.com (Postfix) with ESMTP id E047714939 for ; Fri, 16 Feb 2024 20:00:02 +0100 (CET) Received: from saur.se.axis.com (localhost [127.0.0.1]) by saur (8.17.1/8.15.2) with ESMTPS id 41GJ022k2607022 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Fri, 16 Feb 2024 20:00:02 +0100 Received: (from pkj@localhost) by saur.se.axis.com (8.17.1/8.17.1/Submit) id 41GJ02ga2607021 for openembedded-core@lists.openembedded.org; Fri, 16 Feb 2024 20:00:02 +0100 From: Peter Kjellerstedt To: Subject: [PATCH 5/7] devtool: Make use of oe.patch.GitApplyTree.commitIgnored() Date: Fri, 16 Feb 2024 19:59:54 +0100 Message-ID: <20240216185956.2606978-5-pkj@axis.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240216185956.2606978-1-pkj@axis.com> References: <20240216185956.2606978-1-pkj@axis.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM3PEPF00009BA2:EE_|DU5PR02MB10745:EE_ X-MS-Office365-Filtering-Correlation-Id: 14c660d4-271a-47bc-4b39-08dc2f217bf0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AZ66p+/CgLj9B+BzwEhRrJhsVs1zqob40ZNnALDfSfaZfnlFBSZ9VmTkW+0jF2ILUTECIIj0uV+y19chtf57VZW4PjGa5kS1jaxfTgP3lV0Em6zodiLY/MZIBVRdS0LuMOkCv6B/bLJXlXeY0z3m33Us7Wmn6u2lApw/579l0VWjETwShAnJ5e8LSNo26IwSOql5T0LjSzB4i9HNOQXTEBNlWkMfn+Tf9hpLK0rMdpmdLvZ6E3xxdBRvSn/BgL9+xL5eQmdSQvUpfYdWQHoZgFgYRF1WicXic+1RW8LxhtBA9Pb2u4Nzzl20EQ2+nGikCfipCDarkGvo+//OYjz7sdj4p10LX2Rmcf4E2/m/tRoaajMMJE9/oUcM32jdEt+Nx62koY8zWoGBxRwpVKavR2BbkjQpODB4icVVr1PdydvCsJuOUzbs4GGcEiabFvjIA3wSxok2cwQWrzpZVTYR4JEkrQ5OSk9Hu8C0tMY47isk6W05zatGcKVfC9OasKerFcdfXKkBYz9IMj99JkgnLtWatb7EXrIIr0yRH4hnHk2Uq40CxleGHPDe+JRvDHv9d/drCpPRHtrNBMrkGM75mhI0YZl9fp6V38eDl/nWcpaNqFgyTEDIUJXWGZAkWaAtevMFHEUMyCNvKQjLxkVg89O50Q4mZocc+NILAGdUfrw= 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:(13230031)(4636009)(376002)(39860400002)(346002)(396003)(136003)(230922051799003)(82310400011)(451199024)(64100799003)(36860700004)(186009)(1800799012)(46966006)(40470700004)(2616005)(478600001)(41300700001)(2906002)(8936002)(6916009)(8676002)(42186006)(70206006)(5660300002)(70586007)(6666004)(316002)(36756003)(83380400001)(336012)(81166007)(426003)(26005)(1076003)(356005)(82740400003);DIR:OUT;SFP:1101; X-OriginatorOrg: axis.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Feb 2024 19:00:03.9070 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 14c660d4-271a-47bc-4b39-08dc2f217bf0 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: AM3PEPF00009BA2.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU5PR02MB10745 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 16 Feb 2024 19:00:11 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/195797 This makes use of the oe.patch.GitApplyTree.commitIgnored() function to create commits that shall be ignored by `devtool finish`. Signed-off-by: Peter Kjellerstedt --- scripts/lib/devtool/__init__.py | 4 +--- scripts/lib/devtool/standard.py | 6 +----- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/scripts/lib/devtool/__init__.py b/scripts/lib/devtool/__init__.py index c7fc3cfc41..6133c1c5b4 100644 --- a/scripts/lib/devtool/__init__.py +++ b/scripts/lib/devtool/__init__.py @@ -253,9 +253,7 @@ def setup_git_repo(repodir, version, devbranch, basetag='devtool-base', d=None): bb.process.run('git submodule add %s %s' % (remote_url, os.path.relpath(root, os.path.join(root, ".."))), cwd=os.path.join(root, "..")) found = True if found: - useroptions = [] - oe.patch.GitApplyTree.gitCommandUserOptions(useroptions, d=d) - bb.process.run('git %s commit -m "Adding additionnal submodule from SRC_URI\n\n%s"' % (' '.join(useroptions), oe.patch.GitApplyTree.ignore_commit_prefix), cwd=os.path.join(root, "..")) + oe.patch.GitApplyTree.commitIgnored("Add additional submodule from SRC_URI", dir=os.path.join(root, ".."), d=d) found = False if os.path.exists(os.path.join(repodir, '.gitmodules')): bb.process.run('git submodule foreach --recursive "git tag -f %s"' % basetag, cwd=repodir) diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py index ccb7ea851b..6d7fd17fbd 100644 --- a/scripts/lib/devtool/standard.py +++ b/scripts/lib/devtool/standard.py @@ -484,11 +484,7 @@ def symlink_oelocal_files_srctree(rd, srctree): os.symlink('oe-local-files/%s' % fn, destpth) addfiles.append(os.path.join(relpth, fn)) if addfiles: - bb.process.run('git add %s' % ' '.join(addfiles), cwd=srctree) - useroptions = [] - oe.patch.GitApplyTree.gitCommandUserOptions(useroptions, d=rd) - bb.process.run('git %s commit -m "Committing local file symlinks\n\n%s"' % (' '.join(useroptions), oe.patch.GitApplyTree.ignore_commit_prefix), cwd=srctree) - + oe.patch.GitApplyTree.commitIgnored("Add local file symlinks", dir=srctree, files=addfiles, d=rd) def _extract_source(srctree, keep_temp, devbranch, sync, config, basepath, workspace, fixed_setup, d, tinfoil, no_overrides=False): """Extract sources of a recipe""" From patchwork Fri Feb 16 18:59:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Kjellerstedt X-Patchwork-Id: 39545 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 4D8D0C48BF5 for ; Fri, 16 Feb 2024 19:00:11 +0000 (UTC) Received: from EUR03-DBA-obe.outbound.protection.outlook.com (EUR03-DBA-obe.outbound.protection.outlook.com [40.107.104.79]) by mx.groups.io with SMTP id smtpd.web10.5205.1708110006335943639 for ; Fri, 16 Feb 2024 11:00:06 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@axis.com header.s=selector1 header.b=cdVv8b0b; spf=pass (domain: axis.com, ip: 40.107.104.79, mailfrom: peter.kjellerstedt@axis.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n91JlDDhNjEIkd4Vz2OvawJaLff/3quUVfd4GHo0VLBU6Qceqw79dxIwNL+YFAAhw1uh84yBI+DvbbiFvYdVLcUJMVO0sROXod1GplhWu3KUzmAurLR0HtLnXhmTTRHgJsxhjonhu3UF2Y9neAyyrK00B3G+SYBHkeHFFe7jjgPQgp2DxNXOWQbwBRuTK/ma9emfu46uKnKT5kw5ffjr4qU22yRABYoW325wF/r+6JXCHr+/9iXPrFgqXCBgmz0Yp5sGjEwthDT5MeyfT+MwmVINZxhwxVBORGD+WvAFYmhzqUQwFBeg/nb6/I9VAkfeFShm8sGSktrjB/zpKYI3eA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=trhDGfwis0o0vWS8pNIYbD71DN6HVqcS5/4wQeDeS5o=; b=lhXT7EbfqmEdpT6yiZ5hRp2veUxuYCtVc74VsVgAIr5S1bh/Kz0nvSKaa77WFMT/hyHyJqsKwK3rA7v/+bFmA2qk8Jsjws6epumv4gibDotUHQVs4m+aiZ5EHnvQx+ZdsaX3xqObUU0sZSTWXhEpCaFEzEUvKaZ+I8stYAssuduXJAhyK8QDsHumoeHWAo4norzzvabJ7PhfKv2YuRryXdMJObACeQaHyc4v7inf0cIoFVLA6Op6zyKqGvRIXn7YmWQN9PZwMoj26AfIeQfAUcN5MItT2qSBn9UtcQUpbo7LxD+8a45ee/qac1i+blonAT+w8gGSkM8ANE5GnjZ6KQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=fail (sender ip is 195.60.68.100) smtp.rcpttodomain=lists.openembedded.org smtp.mailfrom=axis.com; dmarc=fail (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=trhDGfwis0o0vWS8pNIYbD71DN6HVqcS5/4wQeDeS5o=; b=cdVv8b0bj2PA9xHthqMKMCz7pz6eBw54A77LEnwIGIDNb5QVevesnG3QrHtvO1LPiMdcFP82iRd6q8Oq5EQXWxo6wBSfMR9DA6P4L7SozKbixAszTBCKtnDW5muYohAGI+nySDL9ldBE/0v6qvyM4M4Kef3/ZxVa2N4DeB+GSoQ= Received: from AS4PR09CA0025.eurprd09.prod.outlook.com (2603:10a6:20b:5d4::15) by AS8PR02MB10169.eurprd02.prod.outlook.com (2603:10a6:20b:63f::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.29; Fri, 16 Feb 2024 19:00:03 +0000 Received: from AM3PEPF00009BA2.eurprd04.prod.outlook.com (2603:10a6:20b:5d4:cafe::be) by AS4PR09CA0025.outlook.office365.com (2603:10a6:20b:5d4::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7270.39 via Frontend Transport; Fri, 16 Feb 2024 19:00:03 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 195.60.68.100) smtp.mailfrom=axis.com; dkim=none (message not signed) header.d=none;dmarc=fail action=none header.from=axis.com; Received-SPF: Fail (protection.outlook.com: domain of axis.com does not designate 195.60.68.100 as permitted sender) receiver=protection.outlook.com; client-ip=195.60.68.100; helo=mail.axis.com; Received: from mail.axis.com (195.60.68.100) by AM3PEPF00009BA2.mail.protection.outlook.com (10.167.16.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7292.25 via Frontend Transport; Fri, 16 Feb 2024 19:00:03 +0000 Received: from se-mail01w.axis.com (10.20.40.7) by se-mail01w.axis.com (10.20.40.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Fri, 16 Feb 2024 20:00:03 +0100 Received: from se-intmail01x.se.axis.com (10.0.5.60) by se-mail01w.axis.com (10.20.40.7) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Fri, 16 Feb 2024 20:00:03 +0100 Received: from saur (saur.se.axis.com [10.92.3.10]) by se-intmail01x.se.axis.com (Postfix) with ESMTP id 0A19F14944 for ; Fri, 16 Feb 2024 20:00:03 +0100 (CET) Received: from saur.se.axis.com (localhost [127.0.0.1]) by saur (8.17.1/8.15.2) with ESMTPS id 41GJ02X72607026 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Fri, 16 Feb 2024 20:00:02 +0100 Received: (from pkj@localhost) by saur.se.axis.com (8.17.1/8.17.1/Submit) id 41GJ02al2607025 for openembedded-core@lists.openembedded.org; Fri, 16 Feb 2024 20:00:02 +0100 From: Peter Kjellerstedt To: Subject: [PATCH 6/7] patch.bbclass: Make use of oe.patch.GitApplyTree.commitIgnored() Date: Fri, 16 Feb 2024 19:59:55 +0100 Message-ID: <20240216185956.2606978-6-pkj@axis.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240216185956.2606978-1-pkj@axis.com> References: <20240216185956.2606978-1-pkj@axis.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM3PEPF00009BA2:EE_|AS8PR02MB10169:EE_ X-MS-Office365-Filtering-Correlation-Id: df3fa98f-a656-4729-4ca8-08dc2f217bd1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: k8PKjrVoXAMdkL+0E4PjnpOJQexxbEhA2sIvvUWJMel+iKojKGaVynth9TU7amS4fu6B6fOv3gmkt5cgc7qy7hKUvSoxi1YegriBKb6/yYyy+zGFezzmaFvnaNyLIvY8I3piQcVJy/ORnKDCAtqLGL/zRboyJpukMPpcjIzvxKc67Lp/RChREkLDqE8W9wr1auCr03VPopY2+dAY/3JPMVLzjykkMdRZLJdBZqcXAq+QeXTG0vMicgQQ6MNkSIyHVA37mCk022BanaEbo4RDSAP8ytTzuJeeUbyGINxUOxAXB7GTU8VAMadpo0VDObaYemjMPveMLs/3NBib94dTpACyVZ0Weye2JR+gVBLhb72O4U5y3qsZYUBn6dsutpofL1C5V7bj+SM2i5EZcQjgLJFBkwL//80UUlcQqUApcIlIDxLDTjlANLy0LqtFXkw57quTaJCBsLLEdHUUINY+s4z6/QzqOgBUAjmijpHlbZblBRnrz9kJMq6OdrNIVAx0m1IZ+EpU9NFwoZSq1cg/cy6vQztZJMQcMTnPquVr8N/BnRv4fsXXCI+dBkA0l5b8oE4wIxMgNFGPN3KpX253oLUxpT9HIZiaeE8Ri8GUlsRz0uCA2HQ9PDMfBGAgC/vnlYE9/FNlJoCDPW/7OS94hQ== 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:(13230031)(4636009)(136003)(376002)(346002)(396003)(39860400002)(230922051799003)(64100799003)(451199024)(82310400011)(1800799012)(186009)(36860700004)(40470700004)(46966006)(478600001)(2616005)(6916009)(2906002)(8676002)(8936002)(70206006)(70586007)(5660300002)(316002)(83380400001)(42186006)(41300700001)(26005)(356005)(1076003)(36756003)(6666004)(336012)(81166007)(426003)(82740400003);DIR:OUT;SFP:1101; X-OriginatorOrg: axis.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Feb 2024 19:00:03.7039 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: df3fa98f-a656-4729-4ca8-08dc2f217bd1 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: AM3PEPF00009BA2.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR02MB10169 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 16 Feb 2024 19:00:11 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/195794 This makes use of the oe.patch.GitApplyTree.commitIgnored() function to create commits that shall be ignored by `devtool finish`. Signed-off-by: Peter Kjellerstedt --- meta/classes-global/patch.bbclass | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/meta/classes-global/patch.bbclass b/meta/classes-global/patch.bbclass index e3157c7b18..e5786b1c9a 100644 --- a/meta/classes-global/patch.bbclass +++ b/meta/classes-global/patch.bbclass @@ -79,9 +79,7 @@ python patch_task_postfunc() { bb.process.run('git checkout patches', cwd=srcsubdir) stdout, _ = bb.process.run('git status --porcelain .', cwd=srcsubdir) if stdout: - useroptions = [] - oe.patch.GitApplyTree.gitCommandUserOptions(useroptions, d=d) - bb.process.run('git add .; git %s commit -a -m "Committing changes from %s\n\n%s"' % (' '.join(useroptions), func, oe.patch.GitApplyTree.ignore_commit_prefix + ' - from %s' % func), cwd=srcsubdir) + oe.patch.GitApplyTree.commitIgnored("Add changes from %s" % func, dir=srcsubdir, files=['.'], d=d) } def src_patches(d, all=False, expand=True): From patchwork Fri Feb 16 18:59:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Kjellerstedt X-Patchwork-Id: 39548 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 400C1C48BF6 for ; Fri, 16 Feb 2024 19:00:11 +0000 (UTC) Received: from EUR02-DB5-obe.outbound.protection.outlook.com (EUR02-DB5-obe.outbound.protection.outlook.com [40.107.249.66]) by mx.groups.io with SMTP id smtpd.web11.5290.1708110007413027266 for ; Fri, 16 Feb 2024 11:00:07 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@axis.com header.s=selector1 header.b=cnxSZcGL; spf=pass (domain: axis.com, ip: 40.107.249.66, mailfrom: peter.kjellerstedt@axis.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KysNeWo+0nPvqWuhjBT2arTnbX5eYgQPcsOrPV+Mikdal51uowgXOwY+iVHeQFiaOHlIZMtMQVI/FTaXQ6WiqtnSvgUpz4Dw9guXDZqa5cnPIa4OKK94Q82Jmuos90HX8pHqyGEqhDee+ZoGb30ZwyLrjqv91T5MB8o+ji2z/9r/IcUM8GP3qtC0WojiwZu8qaT61h+VU1oLqCaOb8ISlxos2De35PGmKgM6SkTvvveGcTfniGwrA6qe9a/MTkKT2l2EOUTqVqQo5f2XzhUy26rxRTyHLSrKBfUKVl7QLvFtGmFL2w9LS7frgiQXGPR1JcSrEoGJgmAUrSC/S1+/Ug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=WQClh1L5SUYw3CkUp4hhyPpDibiGkBobckKUQ+Ch7hI=; b=h4Y6SSjOWB3xEWm6Scr4puxhZ9vFC45FmFNLdyotCKHtGYomLOwH3B7pKKZQb3YmEAcqxrkdb+1+o/fCKw/xjMjuXM4enW+49q4pGtU78BWE3lk92k/vhbLDrDEWSJNlvIQFjcJrQJeeWTqFvP2Oxi5Va7naEgxbNNbA3aWS6ZZ33BwOYDbTy9XuF+PxOO22FViaPh4ez+Iz0BX+p7CvZ9UsodwGmGHyQPcj/GYJS8NL8/heyGfi7gq4SbqZIidgDe0jAgBKwohannrbJg6FO/YuJr3A07qcwY44U88ItDq5s4vUjq4hmV8BYymIGowi3jykEDOWKIhVv26zWxDFMA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=fail (sender ip is 195.60.68.100) smtp.rcpttodomain=lists.openembedded.org smtp.mailfrom=axis.com; dmarc=fail (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=WQClh1L5SUYw3CkUp4hhyPpDibiGkBobckKUQ+Ch7hI=; b=cnxSZcGL2ul2hQuf5m1/L3uK6Dfjp1gPjurdk3HgFNnv+sjeFJk7ALzjYd4UF6kw3mQqajDLhQTB1sJswqvTb3LWUpaIsFGpYquO6hxikG8w5CKSlAK12bXvnGt/q5DHFc59kpFAQVpF2CQFZ6e+Ow5CmqT2fStuGDgjfJhlzn8= Received: from AS4PR09CA0029.eurprd09.prod.outlook.com (2603:10a6:20b:5d4::18) by DB9PR02MB9996.eurprd02.prod.outlook.com (2603:10a6:10:460::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.31; Fri, 16 Feb 2024 19:00:04 +0000 Received: from AM3PEPF00009BA2.eurprd04.prod.outlook.com (2603:10a6:20b:5d4:cafe::eb) by AS4PR09CA0029.outlook.office365.com (2603:10a6:20b:5d4::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7270.37 via Frontend Transport; Fri, 16 Feb 2024 19:00:04 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 195.60.68.100) smtp.mailfrom=axis.com; dkim=none (message not signed) header.d=none;dmarc=fail action=none header.from=axis.com; Received-SPF: Fail (protection.outlook.com: domain of axis.com does not designate 195.60.68.100 as permitted sender) receiver=protection.outlook.com; client-ip=195.60.68.100; helo=mail.axis.com; Received: from mail.axis.com (195.60.68.100) by AM3PEPF00009BA2.mail.protection.outlook.com (10.167.16.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7292.25 via Frontend Transport; Fri, 16 Feb 2024 19:00:04 +0000 Received: from SE-MAIL21W.axis.com (10.20.40.16) by se-mail01w.axis.com (10.20.40.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Fri, 16 Feb 2024 20:00:03 +0100 Received: from se-mail01w.axis.com (10.20.40.7) by SE-MAIL21W.axis.com (10.20.40.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Fri, 16 Feb 2024 20:00:03 +0100 Received: from se-intmail01x.se.axis.com (10.0.5.60) by se-mail01w.axis.com (10.20.40.7) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Fri, 16 Feb 2024 20:00:03 +0100 Received: from saur (saur.se.axis.com [10.92.3.10]) by se-intmail01x.se.axis.com (Postfix) with ESMTP id 283E714698 for ; Fri, 16 Feb 2024 20:00:03 +0100 (CET) Received: from saur.se.axis.com (localhost [127.0.0.1]) by saur (8.17.1/8.15.2) with ESMTPS id 41GJ03Qw2607030 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Fri, 16 Feb 2024 20:00:03 +0100 Received: (from pkj@localhost) by saur.se.axis.com (8.17.1/8.17.1/Submit) id 41GJ033B2607029 for openembedded-core@lists.openembedded.org; Fri, 16 Feb 2024 20:00:03 +0100 From: Peter Kjellerstedt To: Subject: [PATCH 7/7] lib/oe/patch: Use git notes to store the filenames for the patches Date: Fri, 16 Feb 2024 19:59:56 +0100 Message-ID: <20240216185956.2606978-7-pkj@axis.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240216185956.2606978-1-pkj@axis.com> References: <20240216185956.2606978-1-pkj@axis.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM3PEPF00009BA2:EE_|DB9PR02MB9996:EE_ X-MS-Office365-Filtering-Correlation-Id: 504fb278-fc42-4483-aac8-08dc2f217c30 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /T52HtHgOKpV7t8Mf+m+LMD5keyhYkiDeV3VxLmEqDdjkKXM6u3R+nQCQVW5owKUvBP1RREmPhmjcVwCHhikG73vL8B7fZiD2YXbKeWtbSl5aiayFRvHbT9bcM4fkHjJ6jtU7rpg5vAhYRnq3Pt9ijnWpXchTxh0MBdr6XDf2tfXyy93ubg+Uml2Wt28Heuakrb32EV8C2lYVK3wEAIKN10hm6HY3xEobRTc+7iLpKw/0KN8wfhGacsNUl2K0YTqzzE3qKix4RH5oDuV3XYq9Ud1jXW0IwJFncyVfuKBaYGx8GDGKLS2a1DsPTT8GCoPAKJA0xwDMclBndNRwetD4pAhDcT51KPnLoSVRgLXuErJ1j11RpditjFd/57MkEl7vyjZfL7EXHy9ZlwFxlPmoZ60KK3CkcNKGRoJUkmxnJWaqm7lhOuRYT1e+KjYDfNvMeIYbUi6/F4/+Wd9nJVhzEKfJLUqcK7rFPC6ZOVhQ3dTMl7VoMUHaQ7Yzn72gX3+c+HYPsZ1/Eq2VFBcdXto14sTHvLQtv2+u6P9+w8LambDI6gQ5jjLS9OsY5I8I9VU5kjMtl1qwIATzwjUgUhnV3i+/SSh+3tZyfMbtJd2gN6RYhHOJLMW83x5QVod4weQJRJ2FElBFhREyvHorcvFDSDE1VhDbWjO/UNlcTxDRJU= 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:(13230031)(4636009)(376002)(396003)(39860400002)(346002)(136003)(230922051799003)(36860700004)(82310400011)(64100799003)(1800799012)(451199024)(186009)(40470700004)(46966006)(2906002)(30864003)(5660300002)(426003)(2616005)(336012)(1076003)(41300700001)(8676002)(70586007)(316002)(70206006)(6916009)(8936002)(83380400001)(26005)(6666004)(42186006)(478600001)(82740400003)(81166007)(36756003)(356005);DIR:OUT;SFP:1101; X-OriginatorOrg: axis.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Feb 2024 19:00:04.3289 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 504fb278-fc42-4483-aac8-08dc2f217c30 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: AM3PEPF00009BA2.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR02MB9996 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 16 Feb 2024 19:00:11 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/195798 The old way of keeping track of the filenames for the patches that correspond to the commits was to add a special comment line to the end of the commit message, e.g., "%% original patch: ", using a temporary git hook. This method had some drawbacks, e.g.: * It caused problems if one wanted to push the commits upstream as the comment line had to be manually removed. * The comment line would end up in patches if someone used git format-path rather than devtool finish to generate the patches. * The comment line could interfere with global Git hooks used to validate the format of the Git commit message. * When regenerating patches with `devtool finish --force-patch-refresh`, the process typically resulted in adding empty lines to the end of the commit messages in the updated patches. A better way of keeping track of the patch filenames is to use Git notes. This way the commit messages remain unaffected, but the information is still shown when, e.g., doing `git log`. A special Git notes space, refs/notes/devtool, is used to not intefere with the default Git notes. It is configured to be shown in, e.g., `git log` and to survive rewrites (i.e., `git commit --amend` and `git rebase`). Since there is no longer any need for a temporary Git hook, the code that manipulated the .git/hooks directory has also been removed. To avoid potential problems due to global Git hooks, --no-verify was added to the `git commit` command. To not cause troubles for those who have done `devtool modify` for a recipe with the old solution and then do `devtool finish` with the new solution, the code will fall back to look for the old strings in the commit message if no Git note can be found. While not technically motivated like above, the way to keep track of ignored commits is also changed to use Git notes to avoid having different methods to store similar information. Signed-off-by: Peter Kjellerstedt --- meta/lib/oe/patch.py | 105 +++++++++++++++--------- meta/lib/oeqa/selftest/cases/devtool.py | 9 +- scripts/lib/devtool/standard.py | 15 ++-- 3 files changed, 78 insertions(+), 51 deletions(-) diff --git a/meta/lib/oe/patch.py b/meta/lib/oe/patch.py index 3ded5f3601..4e971f8b30 100644 --- a/meta/lib/oe/patch.py +++ b/meta/lib/oe/patch.py @@ -294,8 +294,9 @@ class PatchTree(PatchSet): self.Pop(all=True) class GitApplyTree(PatchTree): - patch_line_prefix = '%% original patch' - ignore_commit_prefix = '%% ignore' + notes_ref = "refs/notes/devtool" + original_patch = 'original patch' + ignore_commit = 'ignore' def __init__(self, dir, d): PatchTree.__init__(self, dir, d) @@ -452,7 +453,7 @@ class GitApplyTree(PatchTree): # Prepare git command cmd = ["git"] GitApplyTree.gitCommandUserOptions(cmd, commituser, commitemail) - cmd += ["commit", "-F", tmpfile] + cmd += ["commit", "-F", tmpfile, "--no-verify"] # git doesn't like plain email addresses as authors if author and '<' in author: cmd.append('--author="%s"' % author) @@ -460,15 +461,49 @@ class GitApplyTree(PatchTree): cmd.append('--date="%s"' % date) return (tmpfile, cmd) + @staticmethod + def addNote(repo, ref, key, value=None): + note = key + (": %s" % value if value else "") + notes_ref = GitApplyTree.notes_ref + cmd = ["git", "config", "--fixed-value", "notes.displayRef", notes_ref, notes_ref] + runcmd(cmd, repo) + cmd = ["git", "config", "--fixed-value", "notes.rewriteRef", notes_ref, notes_ref] + runcmd(cmd, repo) + cmd = ["git", "notes", "--ref", notes_ref, "append", "-m", note, ref] + runcmd(cmd, repo) + + @staticmethod + def getNotes(repo, ref): + import re + + note = None + cmd = ["git", "notes", "--ref", GitApplyTree.notes_ref, "show", ref] + try: + note = runcmd(cmd, repo) + prefix = "" + except CmdError: + cmd = ['git', 'show', '-s', '--format=%B', ref] + note = runcmd(cmd, repo) + prefix = "%% " + + note_re = re.compile(r'^%s(.*?)(?::\s*(.*))?$' % prefix) + notes = dict() + for line in note.splitlines(): + m = note_re.match(line) + if m: + notes[m.group(1)] = m.group(2) + + return notes + @staticmethod def commitIgnored(subject, dir=None, files=None, d=None): if files: runcmd(['git', 'add'] + files, dir) - message = "%s\n\n%s" % (subject, GitApplyTree.ignore_commit_prefix) cmd = ["git"] GitApplyTree.gitCommandUserOptions(cmd, d=d) - cmd += ["commit", "-m", message, "--no-verify"] + cmd += ["commit", "-m", subject, "--no-verify"] runcmd(cmd, dir) + GitApplyTree.addNote(dir, "HEAD", GitApplyTree.ignore_commit) @staticmethod def extractPatches(tree, startcommits, outdir, paths=None): @@ -484,18 +519,20 @@ class GitApplyTree(PatchTree): out = runcmd(["sh", "-c", " ".join(shellcmd)], os.path.join(tree, name)) if out: for srcfile in out.split(): - outfile = os.path.basename(srcfile) + # This loop, which is used to remove any line that + # starts with "%% original patch", is kept for backwards + # compatibility. If/when that compatibility is dropped, + # it can be replaced with code to just read the first + # line of the patch file to get the SHA-1, and the code + # below that writes the modified patch file can be + # replaced with a simple file move. for encoding in ['utf-8', 'latin-1']: patchlines = [] try: with open(srcfile, 'r', encoding=encoding, newline='') as f: for line in f: - if line.startswith(GitApplyTree.patch_line_prefix): - outfile = line.split()[-1].strip() + if line.startswith("%% " + GitApplyTree.original_patch): continue - if line.startswith(GitApplyTree.ignore_commit_prefix): - outfile = None - break patchlines.append(line) except UnicodeDecodeError: continue @@ -503,11 +540,16 @@ class GitApplyTree(PatchTree): else: raise PatchError('Unable to find a character encoding to decode %s' % srcfile) - if outfile: - bb.utils.mkdirhier(os.path.join(outdir, name)) - with open(os.path.join(outdir, name, outfile), 'w') as of: - for line in patchlines: - of.write(line) + sha1 = patchlines[0].split()[1] + notes = GitApplyTree.getNotes(os.path.join(tree, name), sha1) + if GitApplyTree.ignore_commit in notes: + continue + 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: + for line in patchlines: + of.write(line) finally: shutil.rmtree(tempdir) @@ -555,28 +597,11 @@ class GitApplyTree(PatchTree): return runcmd(["sh", "-c", " ".join(shellcmd)], self.dir) - # Add hooks which add a pointer to the original patch file name in the commit message reporoot = (runcmd("git rev-parse --show-toplevel".split(), self.dir) or '').strip() if not reporoot: raise Exception("Cannot get repository root for directory %s" % self.dir) - gitdir = (runcmd("git rev-parse --absolute-git-dir".split(), self.dir) or '').strip() - if not gitdir: - raise Exception("Cannot get gitdir for directory %s" % self.dir) - hooks_dir = os.path.join(gitdir, 'hooks') - hooks_dir_backup = hooks_dir + '.devtool-orig' - if os.path.lexists(hooks_dir_backup): - raise Exception("Git hooks backup directory already exists: %s" % hooks_dir_backup) - if os.path.lexists(hooks_dir): - shutil.move(hooks_dir, hooks_dir_backup) - os.mkdir(hooks_dir) - commithook = os.path.join(hooks_dir, 'commit-msg') - applyhook = os.path.join(hooks_dir, 'applypatch-msg') - with open(commithook, 'w') as f: - # NOTE: the formatting here is significant; if you change it you'll also need to - # change other places which read it back - f.write('echo "\n%s: $PATCHFILE" >> $1' % GitApplyTree.patch_line_prefix) - os.chmod(commithook, 0o755) - shutil.copy2(commithook, applyhook) + + patch_applied = True try: patchfilevar = 'PATCHFILE="%s"' % os.path.basename(patch['file']) if self._need_dirty_check(): @@ -587,7 +612,7 @@ class GitApplyTree(PatchTree): pass else: if output: - # The tree is dirty, not need to try to apply patches with git anymore + # The tree is dirty, no need to try to apply patches with git anymore # since they fail, fallback directly to patch output = PatchTree._applypatch(self, patch, force, reverse, run) output += self._commitpatch(patch, patchfilevar) @@ -620,10 +645,12 @@ class GitApplyTree(PatchTree): output = PatchTree._applypatch(self, patch, force, reverse, run) output += self._commitpatch(patch, patchfilevar) return output + except: + patch_applied = False + raise finally: - shutil.rmtree(hooks_dir) - if os.path.lexists(hooks_dir_backup): - shutil.move(hooks_dir_backup, hooks_dir) + if patch_applied: + GitApplyTree.addNote(self.dir, "HEAD", GitApplyTree.original_patch, os.path.basename(patch['file'])) class QuiltTree(PatchSet): diff --git a/meta/lib/oeqa/selftest/cases/devtool.py b/meta/lib/oeqa/selftest/cases/devtool.py index abc85c90a7..a94f4a7148 100644 --- a/meta/lib/oeqa/selftest/cases/devtool.py +++ b/meta/lib/oeqa/selftest/cases/devtool.py @@ -988,9 +988,10 @@ class DevtoolModifyTests(DevtoolBase): self.assertIn(tempdir, result.output) # Check git repo self._check_src_repo(tempdir) - # Check that the patch is correctly applied - # last commit message in the tree must contain - # %% original patch: + # Check that the patch is correctly applied. + # The last commit message in the tree must contain the following note: + # Notes (devtool): + # original patch: # .. patchname = None for uri in src_uri: @@ -998,7 +999,7 @@ class DevtoolModifyTests(DevtoolBase): patchname = uri.replace("file://", "").partition('.patch')[0] + '.patch' self.assertIsNotNone(patchname) result = runCmd('git -C %s log -1' % tempdir) - self.assertIn("%%%% original patch: %s" % patchname, result.output) + self.assertIn("Notes (devtool):\n original patch: %s" % patchname, result.output) # Configure the recipe to check that the git dependencies are correctly patched in cargo config bitbake('-c configure %s' % testrecipe) diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py index 6d7fd17fbd..7972b4f822 100644 --- a/scripts/lib/devtool/standard.py +++ b/scripts/lib/devtool/standard.py @@ -937,14 +937,13 @@ def modify(args, config, basepath, workspace): seen_patches = [] for branch in branches: branch_patches[branch] = [] - (stdout, _) = bb.process.run('git log devtool-base..%s' % branch, cwd=srctree) - for line in stdout.splitlines(): - line = line.strip() - if line.startswith(oe.patch.GitApplyTree.patch_line_prefix): - origpatch = line[len(oe.patch.GitApplyTree.patch_line_prefix):].split(':', 1)[-1].strip() - if not origpatch in seen_patches: - seen_patches.append(origpatch) - branch_patches[branch].append(origpatch) + (stdout, _) = bb.process.run('git rev-list devtool-base..%s' % branch, cwd=srctree) + for sha1 in stdout.splitlines(): + notes = oe.patch.GitApplyTree.getNotes(srctree, sha1.strip()) + origpatch = notes.get(oe.patch.GitApplyTree.original_patch) + if origpatch and origpatch not in seen_patches: + seen_patches.append(origpatch) + branch_patches[branch].append(origpatch) # Need to grab this here in case the source is within a subdirectory srctreebase = srctree