From patchwork Wed Dec 6 19:21:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Kjellerstedt X-Patchwork-Id: 35800 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 4EE0FC46CA3 for ; Wed, 6 Dec 2023 19:22:40 +0000 (UTC) Received: from EUR03-AM7-obe.outbound.protection.outlook.com (EUR03-AM7-obe.outbound.protection.outlook.com [40.107.105.80]) by mx.groups.io with SMTP id smtpd.web10.42347.1701890556685127257 for ; Wed, 06 Dec 2023 11:22:37 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@axis.com header.s=selector1 header.b=QemwfCnB; spf=pass (domain: axis.com, ip: 40.107.105.80, mailfrom: peter.kjellerstedt@axis.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=c+1ee4sWUxe3Njk8uQFXdXQV4C95eZ7Ld7Wnh2imLY7IJz4i/SEtFXxWxQgHI9z7grbeRqMH0odHds2Ox7BXU2N88PTqV4oyb2DIfvYA6SgTy1kctwUk4H+l/DWYWA0MeRF4BveYXL5ffod1Rp8RuTEnfczswyi9rVDIzq6G4T5xXOMTbTr7wUxadwx9RkeSJ6jPbZgosdK7rzTyoZc8Y1THeBlIEKUcFym6B3BmS41nWLWtRRLbVsq+QeoxYBjQJld5mv/ffpj1QxZmQUB2hEKFwM8UvUGfrJ6nb8HGzzNWzyRcR3E0XF3DIJD7p+7rjR25b1cdyrsUkadrPeJHrg== 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=jKU+TA0vtuleRncv3nkdi+MNGeUQE8Cv1y/L86RoGUo=; b=Sv7SZ0CaxBR46geaLCZWKNUXqQw+TRjbShb5dQxpvEpIlD8Xs9pXUxMTp0HCGHl6kF9R4fC0VsmmKn13Q9UT5T8bkQ+nrQfDhbTfPG+5pUKMa87vYdsmDd8IJmo9MrUl/68QERvIeH5u8+hHfe5u4zEnubcRp0uwMwXEgvNmjrd/vqQT/9Lg06g/JKbcn1wMtDVjPSim/YZjhoSJ5DNJ1SHP8Qh1SygbDMpxyR6IAan29qqno9qI6rgstAFVDDOyj/dEjgrUXIkA/2U/5YCtutyZnCPOQKkNXectDBSBXq0DUD3x6G9zA32O3nkqZWUOUKLbp5Cp2eiXAO4ImKOe8Q== 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=jKU+TA0vtuleRncv3nkdi+MNGeUQE8Cv1y/L86RoGUo=; b=QemwfCnBnnkPvoD94hHUGfuqbDrmQGLeOu59gFnf/6vvITP9o5Tz0jbAutRM4X06Z9PVEJmz2lezZBdE1oCTphS1POusvF0Zl0fFJ1kbY0pB9aGp9E6PECbK0CJQ8HfAYMJ0AkRZpO5Axwpr4NtauRD0O+yID11YwNewpg4SlNw= Received: from DB7PR02CA0009.eurprd02.prod.outlook.com (2603:10a6:10:52::22) by AM7PR02MB6147.eurprd02.prod.outlook.com (2603:10a6:20b:1a6::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.25; Wed, 6 Dec 2023 19:22:33 +0000 Received: from DU6PEPF0000B621.eurprd02.prod.outlook.com (2603:10a6:10:52:cafe::9e) by DB7PR02CA0009.outlook.office365.com (2603:10a6:10:52::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.34 via Frontend Transport; Wed, 6 Dec 2023 19:22:33 +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 DU6PEPF0000B621.mail.protection.outlook.com (10.167.8.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7068.20 via Frontend Transport; Wed, 6 Dec 2023 19:22:33 +0000 Received: from se-mail01w.axis.com (10.20.40.7) 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; Wed, 6 Dec 2023 20:22:32 +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; Wed, 6 Dec 2023 20:22:32 +0100 Received: from saur (saur.se.axis.com [10.92.3.10]) by se-intmail01x.se.axis.com (Postfix) with ESMTP id 62A96F676 for ; Wed, 6 Dec 2023 20:22:32 +0100 (CET) Received: from saur.se.axis.com (localhost [127.0.0.1]) by saur (8.17.1/8.15.2) with ESMTPS id 3B6JMWfp2838173 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Wed, 6 Dec 2023 20:22:32 +0100 Received: (from pkj@localhost) by saur.se.axis.com (8.17.1/8.17.1/Submit) id 3B6JMWDl2838172 for openembedded-core@lists.openembedded.org; Wed, 6 Dec 2023 20:22:32 +0100 From: Peter Kjellerstedt To: Subject: [PATCH 1/9] oeqa/selftest/devtool: Correct git clone of local repository Date: Wed, 6 Dec 2023 20:21:59 +0100 Message-ID: <20231206192207.2838077-2-pkj@axis.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231206192207.2838077-1-pkj@axis.com> References: <20231206192207.2838077-1-pkj@axis.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU6PEPF0000B621:EE_|AM7PR02MB6147:EE_ X-MS-Office365-Filtering-Correlation-Id: 2455651e-9bae-4eb7-0ead-08dbf690b286 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kbHCGgmT+QvG50o9DOgq3OCYO027R1uJB2nqPgSFfwz9JUJgR7xIzktJ8S35CyesR3TWRNDqlC6KXhxH70/DvM/RaatyTTTTssoBOvN9RwEUAsz26rif5WcWyrJnOW/sv35Y9zb+r7x/tUPpS0z5UBl8w2KD7EA0YlhlKyB2l3DICL4IVVsIjIBFzfC7E2Gk5GnTwth6Phx8VY/+vWq8JvLp8Ia9gsIjybbSe5TNH9qfBK72clAKRF/AGUbyRzd8qRQZQTTUZY03fHa2xLC7RgFo/yvlsEIf9kjQJxQFckA+NqjJZVr9RQC+O3iSk/7qiZ08DPCJRkeeEcRlsRRmQnIkXg4Ihho7LUf6BCBMZ4m+pQ2mo18TRAl0AymNpK2gpMdlzr38l1WkJnPKGbPhlP4Y9x2AJQHMXGWgKHf1hVPk33fnQ38EXSZz5kFKTXgdbSVAKTm9Gays7IVNOf3X0BQo0MOXnJMOIyidDc8mj+Rr+PQxzvqX7x3gNTYwkkFB2nB480UzSZoGkUHerSDaPUWEJxVe2rJf2beGmjK4woEL7ssjkab81cnlVAzYMJPpnn13FQ/QxaZVxcG1nF5jMvYUU6eH6OmbTIFBV32BuymSgKc+5HT2J7cwNOTNkOM8mwH8LlNv/JMuSOog+p8pRw9ahAG0VZ1tXtsUoJ/jJxtgEjWFnCaicN+zn9BAPAamg4qkCmSJ4Qb1k6x7maTqTg+XYgc2nROQhsCA/pjrmmPHSEmW5Bl4olDahdFgV+t5OjGDmjn4buKooxp4KMARqw== 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)(136003)(39850400004)(376002)(230922051799003)(82310400011)(64100799003)(451199024)(1800799012)(186009)(46966006)(40470700004)(36840700001)(36860700001)(356005)(478600001)(81166007)(40480700001)(6666004)(47076005)(82740400003)(426003)(336012)(26005)(2616005)(36756003)(1076003)(83380400001)(8936002)(8676002)(2906002)(5660300002)(41300700001)(6916009)(70586007)(70206006)(42186006)(316002)(40460700003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: axis.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Dec 2023 19:22:33.3285 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2455651e-9bae-4eb7-0ead-08dbf690b286 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: DU6PEPF0000B621.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR02MB6147 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 ; Wed, 06 Dec 2023 19:22:40 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/191908 If the build environment is setup using `repo`, then poky/.git/object is a symbolic link rather than a directory. To clone such repositories, the source path must be prefixed with "file://". This avoids the following error: fatal: failed to start iterator over '.../poky/.git/objects': Not a directory Signed-off-by: Peter Kjellerstedt --- meta/lib/oeqa/selftest/cases/devtool.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/lib/oeqa/selftest/cases/devtool.py b/meta/lib/oeqa/selftest/cases/devtool.py index 2a11886e4b..55bfc24b7c 100644 --- a/meta/lib/oeqa/selftest/cases/devtool.py +++ b/meta/lib/oeqa/selftest/cases/devtool.py @@ -54,7 +54,7 @@ def setUpModule(): result = runCmd('git rev-parse --show-toplevel', cwd=canonical_layerpath) oldreporoot = result.output.rstrip() newmetapath = os.path.join(corecopydir, os.path.relpath(oldmetapath, oldreporoot)) - runCmd('git clone %s %s' % (oldreporoot, corecopydir), cwd=templayerdir) + runCmd('git clone file://%s %s' % (oldreporoot, corecopydir), cwd=templayerdir) # Now we need to copy any modified files # You might ask "why not just copy the entire tree instead of # cloning and doing this?" - well, the problem with that is From patchwork Wed Dec 6 19:22:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Kjellerstedt X-Patchwork-Id: 35798 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 414B3C10F07 for ; Wed, 6 Dec 2023 19:22:40 +0000 (UTC) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (EUR05-DB8-obe.outbound.protection.outlook.com [40.107.20.68]) by mx.groups.io with SMTP id smtpd.web10.42348.1701890556914418268 for ; Wed, 06 Dec 2023 11:22:37 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@axis.com header.s=selector1 header.b=qE8EoAsg; spf=pass (domain: axis.com, ip: 40.107.20.68, mailfrom: peter.kjellerstedt@axis.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XHDwhLVpMgKtt7I3aa76wGYgKRtqbUKV/ZjjEuCL8nrjXg0kirZgh+Ckr8D+lK1VJlzy2QLb72kZQcEb+e41neUYnVgY8jGtJGzWh7X5tlwXYVGkOQxc2DvRPk1h9gwkKCopl296XCA+mB5B3R+O0OXBnrpBLMEDEVtR5wJGrUD+ot1fRd1kyHlqYroKepJRNQ7kUUOwKWq5G7SotIb+gwq+3ziu7rEGPduKceB1MumtwxtfJOY/Lj7MIVLqfE0rkDo7wHnT3syfqTIeXyBizGULUN2et0vdKe4hIGKOXai64gDbkRet9zf8zlTHCyAJPBADlh45sj1p8leKUC0i0w== 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=ITdXrzmINnU0eW1TlV36Xf2yJczCZHY8vJBBHyqPFWQ=; b=B54Od17hykxBwdUGTq9ApMomqDtX60WAuI9LxESIHTXhbL4lwiUIiTkwOSXgBNtwVm5YdrFN9R6CLZ+waY6T8DXjeLwLI14QcvHJocTsUXzr6X9dx3LvxtUJDoW4oEb0QpL08KFFfa3zcBNLjnLhUkjEFDNQrnpl7xIiVDNZW38E/bNcBfJ6PJIkog2kK/VEbPsVVo/KhB3w/Imc6Ha4ZhxY3Jpmuq9hQ3TzybDJUIqmfTM8LbIGwCVxJ6zRYAiNU/aFwx+IEzyIX00h5vrDrQ+n9eJzYKhBLyczWpEjQpIIm6+E9VLe1AgP6qtd1KXxQEK2aicemuwUnDmt7sCgcQ== 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=ITdXrzmINnU0eW1TlV36Xf2yJczCZHY8vJBBHyqPFWQ=; b=qE8EoAsgJActRkFi9RBcmnuJ8WYO2dVrzV7gCd+C8tMFMppJJGhygxaHH/vTomu/zfVfHCTccpAiPL5KlJvogY2tItcOaHJb/VdTanVpTeCoQeEJ5ot/N6+p6dN426XxjphjR+lQ9zi1pcUxWGgoyOviO4U8aF7v4fADlmovN8o= Received: from DB7PR02CA0002.eurprd02.prod.outlook.com (2603:10a6:10:52::15) by PAVPR02MB8989.eurprd02.prod.outlook.com (2603:10a6:102:322::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.34; Wed, 6 Dec 2023 19:22:33 +0000 Received: from DU6PEPF0000B621.eurprd02.prod.outlook.com (2603:10a6:10:52:cafe::f2) by DB7PR02CA0002.outlook.office365.com (2603:10a6:10:52::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.34 via Frontend Transport; Wed, 6 Dec 2023 19:22:33 +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 DU6PEPF0000B621.mail.protection.outlook.com (10.167.8.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7068.20 via Frontend Transport; Wed, 6 Dec 2023 19:22:33 +0000 Received: from se-mail01w.axis.com (10.20.40.7) 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; Wed, 6 Dec 2023 20:22:32 +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; Wed, 6 Dec 2023 20:22:32 +0100 Received: from saur (saur.se.axis.com [10.92.3.10]) by se-intmail01x.se.axis.com (Postfix) with ESMTP id 84AACF5C4 for ; Wed, 6 Dec 2023 20:22:32 +0100 (CET) Received: from saur.se.axis.com (localhost [127.0.0.1]) by saur (8.17.1/8.15.2) with ESMTPS id 3B6JMWTa2838177 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Wed, 6 Dec 2023 20:22:32 +0100 Received: (from pkj@localhost) by saur.se.axis.com (8.17.1/8.17.1/Submit) id 3B6JMW602838176 for openembedded-core@lists.openembedded.org; Wed, 6 Dec 2023 20:22:32 +0100 From: Peter Kjellerstedt To: Subject: [PATCH 2/9] oeqa/selftest/devtool: Avoid global Git hooks when amending a patch Date: Wed, 6 Dec 2023 20:22:00 +0100 Message-ID: <20231206192207.2838077-3-pkj@axis.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231206192207.2838077-1-pkj@axis.com> References: <20231206192207.2838077-1-pkj@axis.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU6PEPF0000B621:EE_|PAVPR02MB8989:EE_ X-MS-Office365-Filtering-Correlation-Id: baeaf873-acd1-42b3-46f7-08dbf690b2bf X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: A8N1vMe3Zb4RVzQGFNvbozEKll6ADmNsY0dKQOgUe/QU2tNgZp2NBaz7dPC+8Vd1/bzbiMZ4lqLfCjUL1vEJh/LKrQUmsi1n1BjcYRW0NkCVkv9zEt3xJOgvEj3DlCUW8AhPMoPoUwnbdrQ+T+nT42XvO1BhQiBoUDH8u3WYe69q3BwKbqEhhdAJhNb2fmnr5dpZDx8pexVAxUAvGUUU6ppZZ5kqGMKQlqID2J6UoSwoZKmyrwpy6h8+u+YNpjP1ZYFW1lVa0LhbNeUzEq5xRtj0XBr40g4x2I8v2ntN+9jsARQtC6Av8Q7FUZFus9RbkBNMvQfZ8qOzcGQx8zkz+vZPr4Q6sF/btii2gYNhBhMWAW11zpUMUK6crQUm4tq9IgGE5DvG8wU0eQdY9cb56A0y54/w2lDKzqDUGEWqiqr64P94c4bk0yYFUTwBgIdkRpu6HlNmjCrH09fLV1J8DmN7zUGHOgESR59h0ytGzLBGixcMPaZpyPu/di9lH1JbZCPyzyfyRj5OPirS6QDJMtpo9qeo3RfQUkKjDpVlyt4Jct//ttUtkVjHAuoFBb6pow53YMuHDzbXWwW440W2czCctHHl7a1n4EjTFF4RnjwAFRSfwdXaV0mw2EX0ouuw3cTGawJobhaJaywBd2C4OMHS+KbbR2e+wfl0jCVcnJL2UTeOWZ87u6pWXTshRXIyDhFKHpg/Fv3kJUzafCqD3bzu12vdbYe4t0RDKw87p+vkXUdMRG261Ygn7yCAB6fhCLlgJzhl46ed+LF4e1cukg== 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)(346002)(396003)(376002)(39860400002)(230922051799003)(1800799012)(451199024)(186009)(64100799003)(82310400011)(36840700001)(46966006)(40470700004)(40460700003)(426003)(83380400001)(478600001)(2616005)(26005)(1076003)(336012)(6666004)(316002)(42186006)(6916009)(41300700001)(8936002)(36756003)(70586007)(70206006)(8676002)(36860700001)(40480700001)(2906002)(5660300002)(356005)(82740400003)(81166007)(47076005)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: axis.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Dec 2023 19:22:33.7035 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: baeaf873-acd1-42b3-46f7-08dbf690b2bf 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: DU6PEPF0000B621.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAVPR02MB8989 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 ; Wed, 06 Dec 2023 19:22:40 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/191907 To avoid potential problems due to global Git hooks, add --no-verify to a `git commit --amend` command. Signed-off-by: Peter Kjellerstedt --- meta/lib/oeqa/selftest/cases/devtool.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/lib/oeqa/selftest/cases/devtool.py b/meta/lib/oeqa/selftest/cases/devtool.py index 55bfc24b7c..03d57cc30a 100644 --- a/meta/lib/oeqa/selftest/cases/devtool.py +++ b/meta/lib/oeqa/selftest/cases/devtool.py @@ -1495,7 +1495,7 @@ class DevtoolUpdateTests(DevtoolBase): # Modify one file srctree = os.path.join(self.workspacedir, 'sources', testrecipe) runCmd('echo "Another line" >> README', cwd=srctree) - runCmd('git commit -a --amend --no-edit', cwd=srctree) + runCmd('git commit -a --amend --no-edit --no-verify', cwd=srctree) self.add_command_to_tearDown('cd %s; rm %s/*; git checkout %s %s' % (os.path.dirname(recipefile), testrecipe, testrecipe, os.path.basename(recipefile))) result = runCmd('devtool update-recipe %s' % testrecipe) expected_status = [(' M', '.*/%s/readme.patch.gz$' % testrecipe)] From patchwork Wed Dec 6 19:22:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Kjellerstedt X-Patchwork-Id: 35801 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 251BEC4167B for ; Wed, 6 Dec 2023 19:22:40 +0000 (UTC) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (EUR01-HE1-obe.outbound.protection.outlook.com [40.107.13.58]) by mx.groups.io with SMTP id smtpd.web10.42352.1701890558444140481 for ; Wed, 06 Dec 2023 11:22:38 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@axis.com header.s=selector1 header.b=Sage0pcC; spf=pass (domain: axis.com, ip: 40.107.13.58, mailfrom: peter.kjellerstedt@axis.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Tt43/fVYi5IPP9M+jLG2ofiZfMA6A3gQ6tGjdG1ab7Pezh5sATlkyhQsSoNor6mel/g0jxSK9GvdAFC8ZjfTupKP8Ooj836IKZRtwhMM8dfyYYqjm8f9FDx4snEui+H596Q04EPU8/NafbpkwcfKjCYv+VADohKgqNVtuteBHD3ZkN4zwFdgg5DT9qwyFY65kQZkCLJiXvTUrm7rxhSBxw66dZgrBEFoBnk6m2jUBr6Gv7KkHgKiAxVfFia09+VA6sRBb+eM4f1jhqH3iDSwwqkgZB6dAbO3DmGNLDigChXviS9z2+pS45Kd9HJcr9bksik1Lv6GrRGg6SgFHNKlaw== 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=JF8m6DKRmVN4OnX9tNhdI2h89/Bk3qPGMuFSjfKRxKQ=; b=ayNgZIq5Jr3zHRCAo3uY/2HQ32ZuyRip+o8u7ygdRDLCp+4VCuR9t1i2EC40iCDGYB1KkX0NjoS74d/hg7Na9DJizj5YkEsIdjZe7jmjK8Cn4N4L48A9Bhi5y1vq+nbgT/m1JYGk6DZOYg2dgOYRhbNwwsm1F0xUXsa0yyysnfzIPdIdWCJVVQozGJ5sY+cSLgshAwBiLC2045rlWbL6gokNv62nMWQy8Y2ngfdtEiMVD9d4Tj3ulSwebFpOEvkiPR0v9jEqljg3DOcZDY3wz0Uunm6EAnmFcL1bh0MjzNZuM2FSLErtiTIk27hCDm2isX3Z4h1oI2zwB443NdnAVQ== 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=JF8m6DKRmVN4OnX9tNhdI2h89/Bk3qPGMuFSjfKRxKQ=; b=Sage0pcCgfG1rQ4UuzgBfgt3y0bXM9nI5b1Yg1/P/oQpZe5E1PLdB8ueB95qyQ5G1fXHB+otjI5HjYpV0p23BD7fXgSBc+kB4rk2rA8xAWkiOtsiBnQy9jZsobNT1ZUcsxLUE2Uj0gtiwGmpYRszmZXmQ5yumhykSs8KTx4qcZY= Received: from DB7PR02CA0003.eurprd02.prod.outlook.com (2603:10a6:10:52::16) by AS2PR02MB10123.eurprd02.prod.outlook.com (2603:10a6:20b:64f::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.26; Wed, 6 Dec 2023 19:22:34 +0000 Received: from DU6PEPF0000B621.eurprd02.prod.outlook.com (2603:10a6:10:52:cafe::4b) by DB7PR02CA0003.outlook.office365.com (2603:10a6:10:52::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.34 via Frontend Transport; Wed, 6 Dec 2023 19:22:34 +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 DU6PEPF0000B621.mail.protection.outlook.com (10.167.8.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7068.20 via Frontend Transport; Wed, 6 Dec 2023 19:22:34 +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; Wed, 6 Dec 2023 20:22:32 +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; Wed, 6 Dec 2023 20:22:32 +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; Wed, 6 Dec 2023 20:22:32 +0100 Received: from saur (saur.se.axis.com [10.92.3.10]) by se-intmail01x.se.axis.com (Postfix) with ESMTP id A4A60F676 for ; Wed, 6 Dec 2023 20:22:32 +0100 (CET) Received: from saur.se.axis.com (localhost [127.0.0.1]) by saur (8.17.1/8.15.2) with ESMTPS id 3B6JMWIa2838181 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Wed, 6 Dec 2023 20:22:32 +0100 Received: (from pkj@localhost) by saur.se.axis.com (8.17.1/8.17.1/Submit) id 3B6JMWQp2838180 for openembedded-core@lists.openembedded.org; Wed, 6 Dec 2023 20:22:32 +0100 From: Peter Kjellerstedt To: Subject: [PATCH 3/9] oeqa/selftest/devtool: Make test_devtool_load_plugin more resilient Date: Wed, 6 Dec 2023 20:22:01 +0100 Message-ID: <20231206192207.2838077-4-pkj@axis.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231206192207.2838077-1-pkj@axis.com> References: <20231206192207.2838077-1-pkj@axis.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU6PEPF0000B621:EE_|AS2PR02MB10123:EE_ X-MS-Office365-Filtering-Correlation-Id: fda9c55f-9de0-4e1d-ca91-08dbf690b344 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WANAwC9LKpikvxgYz5y9HugQUbwHWquoloziG0kfJYt4OlT3x8hp4t86UHazJtHx7bsyBN5vagbQpS107Ofu5v8lO7HFzZo9PJgxMZbti0/ruJa32RaNBO+BKrd9KGwcPU7+p0hleHVHMEr2u9YmmNuBqdebSW4jj0hcSoeSQARbE5VAIzq6QJBb3CyK+73H/0zcb4tghEtC1CZ/mL6T3qiU8bHer1wgGqVaNMZunK0XPNEPTqZWWLH2Dqb/NpjYumIC9GdqZp5SG87pqkh5wEPsqNMeq+nSFn6R48T42ulqK4m9spaFZFAewXM1SBuXOGFn7aug5bZVQocNZ/w32pITtvFCkIfoDlCqqtpDIpb3VoU3RlG67xx9SCJ6Z/r/sd5xrew62/J8oou0GORYKpDtAV6rkKPKxWRj1lJaO0Mg/y52V7uKbYIYyH0fNRpxcP0y7eCGz5lvTfwbvif5ZgRprtsQzwtbvIUJeaT3Iavh/Tku1mjOWCvvSU9ww6yE23yNbCG/NAxllXLSjdyD7/bI3+gR4n45QF7UoZF1oj/MR3QFdQPbvmIQgqH2CceE3M2oc5QG8h19VJJwbZNHvm/uGLS4oF4v/lWyrjSIduf8ktWhnw1EWXug7huSU1sG8vqoqjbkuujm2sYLKFRvm8bM0hV+reKhhUSBuO+/Ern50V/XMA/jnYfYDxR+VBArnjUGmMvv+moSfvMYa/dIPA1RZvMhUfZFtwAstOAdfw8XMP3dCZSSqXhmXmRltFVDhIqHRnGD5YG7ukt8he/FqA== 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)(376002)(346002)(230922051799003)(1800799012)(82310400011)(64100799003)(451199024)(186009)(36840700001)(46966006)(40470700004)(40480700001)(36860700001)(5660300002)(47076005)(82740400003)(6666004)(81166007)(356005)(41300700001)(36756003)(8676002)(8936002)(2906002)(40460700003)(42186006)(316002)(426003)(26005)(83380400001)(336012)(1076003)(2616005)(478600001)(6916009)(70586007)(70206006)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: axis.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Dec 2023 19:22:34.5160 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fda9c55f-9de0-4e1d-ca91-08dbf690b344 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: DU6PEPF0000B621.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR02MB10123 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 ; Wed, 06 Dec 2023 19:22:40 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/191914 * Avoid trying to write to read-only directories and file systems. * Support symbolic links in BBPATH. Signed-off-by: Peter Kjellerstedt --- meta/lib/oeqa/selftest/cases/devtool.py | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/meta/lib/oeqa/selftest/cases/devtool.py b/meta/lib/oeqa/selftest/cases/devtool.py index 03d57cc30a..e01ab01869 100644 --- a/meta/lib/oeqa/selftest/cases/devtool.py +++ b/meta/lib/oeqa/selftest/cases/devtool.py @@ -4,6 +4,7 @@ # SPDX-License-Identifier: MIT # +import errno import os import re import shutil @@ -1900,7 +1901,15 @@ class DevtoolUpgradeTests(DevtoolBase): for p in paths: dstdir = os.path.join(dstdir, p) if not os.path.exists(dstdir): - os.makedirs(dstdir) + try: + os.makedirs(dstdir) + except PermissionError: + return False + except OSError as e: + if e.errno == errno.EROFS: + return False + else: + raise e if p == "lib": # Can race with other tests self.add_command_to_tearDown('rmdir --ignore-fail-on-non-empty %s' % dstdir) @@ -1908,8 +1917,12 @@ class DevtoolUpgradeTests(DevtoolBase): self.track_for_cleanup(dstdir) dstfile = os.path.join(dstdir, os.path.basename(srcfile)) if srcfile != dstfile: - shutil.copy(srcfile, dstfile) + try: + shutil.copy(srcfile, dstfile) + except PermissionError: + return False self.track_for_cleanup(dstfile) + return True def test_devtool_load_plugin(self): """Test that devtool loads only the first found plugin in BBPATH.""" @@ -1927,15 +1940,17 @@ class DevtoolUpgradeTests(DevtoolBase): plugincontent = fh.readlines() try: self.assertIn('meta-selftest', srcfile, 'wrong bbpath plugin found') - for path in searchpath: - self._copy_file_with_cleanup(srcfile, path, 'lib', 'devtool') + searchpath = [ + path for path in searchpath + if self._copy_file_with_cleanup(srcfile, path, 'lib', 'devtool') + ] result = runCmd("devtool --quiet count") self.assertEqual(result.output, '1') result = runCmd("devtool --quiet multiloaded") self.assertEqual(result.output, "no") for path in searchpath: result = runCmd("devtool --quiet bbdir") - self.assertEqual(result.output, path) + self.assertEqual(os.path.realpath(result.output), os.path.realpath(path)) os.unlink(os.path.join(result.output, 'lib', 'devtool', 'bbpath.py')) finally: with open(srcfile, 'w') as fh: From patchwork Wed Dec 6 19:22:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Kjellerstedt X-Patchwork-Id: 35804 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 64F81C46CA7 for ; Wed, 6 Dec 2023 19:22:40 +0000 (UTC) Received: from EUR04-HE1-obe.outbound.protection.outlook.com (EUR04-HE1-obe.outbound.protection.outlook.com [40.107.7.81]) by mx.groups.io with SMTP id smtpd.web11.41993.1701890557580937168 for ; Wed, 06 Dec 2023 11:22:38 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@axis.com header.s=selector1 header.b=rMJg5T0c; spf=pass (domain: axis.com, ip: 40.107.7.81, mailfrom: peter.kjellerstedt@axis.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VL2LGUJjqjzarPjflxjL/jaTilUtpFeNVRtRCszlNuHoZ3qMKM0VjsuQc8zi8HgXow2k/h60fQREE4/i/G4iU2VWkIYsYJrFjW7Us9WfhSPe0fJyiBMmUdqIslY99j7B+EM2Vj80EUx/CD11/pk9pb9CIbH8cB00fFzqyU5ZQAsTRmZeJW/0aBKeJl/IqxM5e6Vs5U8Ew1sNfJHmrkawCD4A/0KrE/jMbDGztSxnPS900VQPXc9VPJz4q2QGXhdqeJWz8utCWaPtxRAtsSmbNoRQrvLoVUt7qsNGKf+FJ8UJp7P6YGC7+a96aiuplB0MUaDJy48G0M00PuMGaLdLjw== 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=Z2OnWcBxh3olzslySUW58TaI2XWrQx0dnh0ToS3CdtI=; b=L/n2dN+rbBDtauSQbU4un3VgqiDeki91JSLTsfgj8nz+4Xl83hYE8zzmj92UZ9eSvAKLqD0kA8ncHJ9GbtFon9s0gUmQaOgDBDBUHGdGjCWoG6+CIr3TiCF7boFYxbeFnMX/IVsim0b2byaE0CNeoIRflvRX6dllnIXscM3rA3f6K87tqF8so5lUewFh3PJ9+vOkbgqLAdL2Aq/Sjt9104uh/UgcKEW3wxqvlFeWZmz8zN2A+5yYqEeP5WnA+hTKa4fhQJOdR4CdfRX8CGwkWY+ziVBbQ+X129zxrZg1Bu+c6FiNrsy/0ixmQZy+1UBbs+31Nvf+fMdXiklazVa/JQ== 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=Z2OnWcBxh3olzslySUW58TaI2XWrQx0dnh0ToS3CdtI=; b=rMJg5T0cd/yYa6cXBeSnF3r91Dq9i3ZlnhEbBMI/XNXUImqbV1B5jhht1fGis3unHBpTEnNjUhLP64fSuPgMx/wIdjoc8yPDPeQs8ZTvACZ+ShrFBexzQh6ut/OhO+TatLXht0miXNFqz/Ph1ROWjDZGAf4O7GI5l81h+25VuB4= Received: from DB7PR02CA0014.eurprd02.prod.outlook.com (2603:10a6:10:52::27) by DB9PR02MB7083.eurprd02.prod.outlook.com (2603:10a6:10:223::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.26; Wed, 6 Dec 2023 19:22:34 +0000 Received: from DU6PEPF0000B621.eurprd02.prod.outlook.com (2603:10a6:10:52:cafe::f3) by DB7PR02CA0014.outlook.office365.com (2603:10a6:10:52::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.34 via Frontend Transport; Wed, 6 Dec 2023 19:22:34 +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 DU6PEPF0000B621.mail.protection.outlook.com (10.167.8.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7068.20 via Frontend Transport; Wed, 6 Dec 2023 19:22:34 +0000 Received: from se-mail01w.axis.com (10.20.40.7) 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; Wed, 6 Dec 2023 20:22:32 +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; Wed, 6 Dec 2023 20:22:32 +0100 Received: from saur (saur.se.axis.com [10.92.3.10]) by se-intmail01x.se.axis.com (Postfix) with ESMTP id C41C6F5C4 for ; Wed, 6 Dec 2023 20:22:32 +0100 (CET) Received: from saur.se.axis.com (localhost [127.0.0.1]) by saur (8.17.1/8.15.2) with ESMTPS id 3B6JMW7w2838185 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Wed, 6 Dec 2023 20:22:32 +0100 Received: (from pkj@localhost) by saur.se.axis.com (8.17.1/8.17.1/Submit) id 3B6JMWGM2838184 for openembedded-core@lists.openembedded.org; Wed, 6 Dec 2023 20:22:32 +0100 From: Peter Kjellerstedt To: Subject: [PATCH 4/9] oeqa/selftest/recipetool: Make test_recipetool_load_plugin more resilient Date: Wed, 6 Dec 2023 20:22:02 +0100 Message-ID: <20231206192207.2838077-5-pkj@axis.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231206192207.2838077-1-pkj@axis.com> References: <20231206192207.2838077-1-pkj@axis.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU6PEPF0000B621:EE_|DB9PR02MB7083:EE_ X-MS-Office365-Filtering-Correlation-Id: 869791c0-77c1-442e-08ab-08dbf690b302 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5pTERGaL9gKGNJPruVZz1UuBsgo8x4YwZ4OfJO5KDM/gkZhbdDBmlm3jxw3CSSwImi4i7gKZKCZW48Jb/nnDG0C3Hr5ZaaO0ls1NcIeCL2Js/VaiVALKqCmNa9G1ScAprwIRKg2g7yXvgz2b4rcHdFDEiHuH1jOeOKpS7XNueXiHTOOTclzFesmBi5uZet38Qc9AjWK0Lza8mnORZ3imSSv9Zo+Td+29pmu4xuURpzoDxyhuOgxlwqFriABCj35bmxIdCZxf22QGrfeVHABzAIx44dvGedza3u2MroAMm4haAT/EfBjWeRenM+gS2E7gDMjr0p78TsVhMVBnk+F/kYmUX24cHkiTh+GhAI3NIHZ2hzDMz9I7qWoEGj7nFBCKG2urS+mSECsFV1UeOgfEME9QRlr7dWaqlQOy9aU81HajrcLLjMTF9Yd6g4xsxEINY1uRjkwr51b7NwCxHhwAeagkX0hQloPZT+SqCBISbRdSmBeea3I7g1dIlKLvP2jqCgUAUBIWLwF9MWZK6Al14jsEigFZQIRDSfF3f9mw7uJWe5tN6ztGK8Ob+GE7n4TRydSqcsDyzFD0tJu7Pwm02IGiQNvSMYN4W6VwsgwXmIkz7wgR/0MqgNt5LgyFKiWHOIFKFTIFzwdv2PJjEeCYgm57/GKmTZCbDSUxlg/9y9IG9hAGhKF7RrZXOxj2qjgTCCmyqfwz4/N5y8zJJ4LEFaEols+H1bKv4v41qOrpuXPOnQCiXpmtGW+RkNMzYdSosycd+SU9FeMy6sVyXCEJ+A== 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)(396003)(136003)(346002)(376002)(39860400002)(230922051799003)(186009)(64100799003)(451199024)(82310400011)(1800799012)(36840700001)(46966006)(40470700004)(478600001)(40460700003)(426003)(2616005)(336012)(1076003)(26005)(81166007)(356005)(82740400003)(83380400001)(47076005)(36756003)(36860700001)(6666004)(2906002)(40480700001)(5660300002)(41300700001)(42186006)(6916009)(316002)(70586007)(70206006)(8936002)(8676002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: axis.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Dec 2023 19:22:34.1410 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 869791c0-77c1-442e-08ab-08dbf690b302 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: DU6PEPF0000B621.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR02MB7083 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 ; Wed, 06 Dec 2023 19:22:40 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/191910 * Avoid trying to write to read-only directories and file systems. * Support symbolic links in BBPATH. Signed-off-by: Peter Kjellerstedt --- meta/lib/oeqa/selftest/cases/recipetool.py | 25 +++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/meta/lib/oeqa/selftest/cases/recipetool.py b/meta/lib/oeqa/selftest/cases/recipetool.py index 55cbba9ca7..3a05343210 100644 --- a/meta/lib/oeqa/selftest/cases/recipetool.py +++ b/meta/lib/oeqa/selftest/cases/recipetool.py @@ -4,6 +4,7 @@ # SPDX-License-Identifier: MIT # +import errno import os import shutil import tempfile @@ -860,7 +861,15 @@ class RecipetoolTests(RecipetoolBase): for p in paths: dstdir = os.path.join(dstdir, p) if not os.path.exists(dstdir): - os.makedirs(dstdir) + try: + os.makedirs(dstdir) + except PermissionError: + return False + except OSError as e: + if e.errno == errno.EROFS: + return False + else: + raise e if p == "lib": # Can race with other tests self.add_command_to_tearDown('rmdir --ignore-fail-on-non-empty %s' % dstdir) @@ -868,8 +877,12 @@ class RecipetoolTests(RecipetoolBase): self.track_for_cleanup(dstdir) dstfile = os.path.join(dstdir, os.path.basename(srcfile)) if srcfile != dstfile: - shutil.copy(srcfile, dstfile) + try: + shutil.copy(srcfile, dstfile) + except PermissionError: + return False self.track_for_cleanup(dstfile) + return True def test_recipetool_load_plugin(self): """Test that recipetool loads only the first found plugin in BBPATH.""" @@ -883,15 +896,17 @@ class RecipetoolTests(RecipetoolBase): plugincontent = fh.readlines() try: self.assertIn('meta-selftest', srcfile, 'wrong bbpath plugin found') - for path in searchpath: - self._copy_file_with_cleanup(srcfile, path, 'lib', 'recipetool') + searchpath = [ + path for path in searchpath + if self._copy_file_with_cleanup(srcfile, path, 'lib', 'recipetool') + ] result = runCmd("recipetool --quiet count") self.assertEqual(result.output, '1') result = runCmd("recipetool --quiet multiloaded") self.assertEqual(result.output, "no") for path in searchpath: result = runCmd("recipetool --quiet bbdir") - self.assertEqual(result.output, path) + self.assertEqual(os.path.realpath(result.output), os.path.realpath(path)) os.unlink(os.path.join(result.output, 'lib', 'recipetool', 'bbpath.py')) finally: with open(srcfile, 'w') as fh: From patchwork Wed Dec 6 19:22:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Kjellerstedt X-Patchwork-Id: 35805 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 6FACAC10F14 for ; Wed, 6 Dec 2023 19:22:40 +0000 (UTC) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (EUR05-DB8-obe.outbound.protection.outlook.com [40.107.20.76]) by mx.groups.io with SMTP id smtpd.web11.41995.1701890558015190177 for ; Wed, 06 Dec 2023 11:22:38 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@axis.com header.s=selector1 header.b=EGYsy2GH; spf=pass (domain: axis.com, ip: 40.107.20.76, mailfrom: peter.kjellerstedt@axis.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dV8Ygq66x9xy5RUN28CZCZ2cUagvEW7cF4rXQ6ZP5CXUZvATMElCtGweal+ZuyD6bq81G+od39nz7eqLsyzWs6gpU8fCUCFRs7CZ1wXUpBXKpCa48tJTy0lUn6qnIvTuyiz5Vhq+9CROsExxhw1hs8m6EA31apVDbQXgZHeAnOXfoESJFAjaFjJg5f1/iMwyxlh8JIWPN5xIQhU7r2euB0xV3VzvGeHW6NMP/5l85c5Eame739qxTZhcXLRDecaaQzepE1I3SUa069XuUui9EA9u8s+ryF21bllHzmLaFDhkLR6R2bqhaVQOIbiS6QjFrr70mZe83HS6hKggLWyNRA== 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=XTP8TwNLzKAfEhjGXHWlvSf4qmbtRzEYAF9ugy4qC5c=; b=Q8J8Kf31JUlN1TJKOe2zy8ikcMUVhAuCurj0CkkDM2uTWAyvF3zsM6mO8dUEozTUDLYksxhnWcCwkSdSHQyD5PsfoeVgbQKE2P+kEpopOv0WIi8RNoqXkGVPsNg7B7sHK1L0SW7r3qzf1ILFUMs+sHsv+Def7KLkN1woO/hiLGE/BxmS7WKwiPmCvoqnYhG61rwjzZINn6U0FxknGFBsQralq/Ex8T+V2wHYRhzlHzidSNQ1SbFnvZKuRCSU5nmkl4ZMReS+Zoi6SByCpoFtrlgBENkMyWxf2WPX2EWYgN41iZ4yiN+jGo0USSD9T+q+oYlr04s/5vUgVeVaDD1eWA== 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=XTP8TwNLzKAfEhjGXHWlvSf4qmbtRzEYAF9ugy4qC5c=; b=EGYsy2GHsy1M3ny4Nrv84DvG+xbWzPi9Cnz4jtunW77gb8sYDRzLv2WX75tU4C22WKNU3zjMjwD9xvKdUkrUCCIfbxnBewR4M5rVUjVdvfsZcDOJr6vQii68dZx5TkoGb9X00jYq2xqxViRwOdRMY9nauvrQ7cH+7SMVkVUMEZY= Received: from DB7PR02CA0033.eurprd02.prod.outlook.com (2603:10a6:10:52::46) by DBBPR02MB10752.eurprd02.prod.outlook.com (2603:10a6:10:53c::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.25; Wed, 6 Dec 2023 19:22:35 +0000 Received: from DU6PEPF0000B621.eurprd02.prod.outlook.com (2603:10a6:10:52:cafe::2b) by DB7PR02CA0033.outlook.office365.com (2603:10a6:10:52::46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.25 via Frontend Transport; Wed, 6 Dec 2023 19:22:35 +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 DU6PEPF0000B621.mail.protection.outlook.com (10.167.8.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7068.20 via Frontend Transport; Wed, 6 Dec 2023 19:22:35 +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; Wed, 6 Dec 2023 20:22:33 +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; Wed, 6 Dec 2023 20:22:32 +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; Wed, 6 Dec 2023 20:22:32 +0100 Received: from saur (saur.se.axis.com [10.92.3.10]) by se-intmail01x.se.axis.com (Postfix) with ESMTP id E4BA5F676 for ; Wed, 6 Dec 2023 20:22:32 +0100 (CET) Received: from saur.se.axis.com (localhost [127.0.0.1]) by saur (8.17.1/8.15.2) with ESMTPS id 3B6JMWlm2838189 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Wed, 6 Dec 2023 20:22:32 +0100 Received: (from pkj@localhost) by saur.se.axis.com (8.17.1/8.17.1/Submit) id 3B6JMWvU2838188 for openembedded-core@lists.openembedded.org; Wed, 6 Dec 2023 20:22:32 +0100 From: Peter Kjellerstedt To: Subject: [PATCH 5/9] lib/oe/recipeutils: Avoid wrapping any SRC_URI[sha*sum] variables Date: Wed, 6 Dec 2023 20:22:03 +0100 Message-ID: <20231206192207.2838077-6-pkj@axis.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231206192207.2838077-1-pkj@axis.com> References: <20231206192207.2838077-1-pkj@axis.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU6PEPF0000B621:EE_|DBBPR02MB10752:EE_ X-MS-Office365-Filtering-Correlation-Id: 2843d193-cce6-418b-c4a7-08dbf690b3c0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: c+XdWs+L4mGJBV7Ax9wMrpuYbE6mWVxhoPrrDG8BWJIQsh8FRMX6rRwTMGB8GJslOWdK8++r5BirRGRRZql72KIxQ/jPxAHzPKHB3iIMnQvZInZnJrX+JSt902D9bn61IXLLkQyI8ckarQevxFdouS3N949cmAwk99fcqY4FHE3FduuJ80QxWkQRC61S/DBviBWHOa0K4ocneiIYFKnGpHnC4EDux4K0Un9kNfZvLMn93SRKZU3RdNYMceipIqGJaU5eCUei+RmSPvrgNPrT6KO6nP6d8F99SvxpBQ6jHozkdyUVdWGem403sI9E4TnkrWlpDvD5dY2fUgEp7BDW8zJDjdq+U1znhs8rwEpwtbTqhLg1OQqe7hKYk565gV6k3tby3Zzu0wlo27YxmiwIRPnQV+WFao9UnKA+Uvw92S5TxLJtZJTTCr9qACt6c3lmYGooqryBx1Hrk63IPELi/q5F28u7Mle2TsGiP/l8VDf9EoPhxP9T2sO5X9xDbAVNll0fDsBOGXv54+fgn0cpAPiwRYxwVzNQqoTvwk+cC3nxA6bMm9ztWrpKrkaHq9EtzmRYMTiDtOzEnsu1Gna4YT1KV/Jo5AEGhfhBEtMpAWPAVT0WYyYi+IJL1az0iCH2sTr/DeOMA48YgK2g24Pto1pNVwuYyi11dr2B0uMuwkbgepj4JgAB7ij6hZlxa1Ck9sSMpYiVQtdAlsthBnTj63YXwcKxkfXl9E+kMfp4mOKf0wEzHgMqnXCdzz6cmHcL9iFsN2+QYNxKWyKbGhLaKA== 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)(396003)(39860400002)(376002)(346002)(136003)(230922051799003)(186009)(82310400011)(1800799012)(451199024)(64100799003)(40470700004)(46966006)(36840700001)(40460700003)(8676002)(8936002)(426003)(316002)(6916009)(336012)(83380400001)(42186006)(70586007)(70206006)(5660300002)(2906002)(47076005)(36860700001)(6666004)(478600001)(26005)(2616005)(1076003)(356005)(41300700001)(40480700001)(81166007)(82740400003)(36756003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: axis.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Dec 2023 19:22:35.3910 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2843d193-cce6-418b-c4a7-08dbf690b3c0 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: DU6PEPF0000B621.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR02MB10752 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 ; Wed, 06 Dec 2023 19:22:40 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/191912 Before, a variable such as SRC_URI[sha512sum] would end up as: SRC_URI[sha512sum] = "45ff3abce4dab24a8090409e6d7bb26afa7fa7812a51e067 \ 28c2aa47d5b4de610d97ba4609cf13d9173087bd909fdf377235eee988a6fdcf52abb7 \ 0341c40b5b" when updated by patch_recipe_lines(). Signed-off-by: Peter Kjellerstedt --- meta/lib/oe/recipeutils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/lib/oe/recipeutils.py b/meta/lib/oe/recipeutils.py index 25b159bc1b..5fb73e65d7 100644 --- a/meta/lib/oe/recipeutils.py +++ b/meta/lib/oe/recipeutils.py @@ -26,7 +26,7 @@ from bb.utils import vercmp_string # Help us to find places to insert values recipe_progression = ['SUMMARY', 'DESCRIPTION', 'HOMEPAGE', 'BUGTRACKER', 'SECTION', 'LICENSE', 'LICENSE_FLAGS', 'LIC_FILES_CHKSUM', 'PROVIDES', 'DEPENDS', 'PR', 'PV', 'SRCREV', 'SRC_URI', 'S', 'do_fetch()', 'do_unpack()', 'do_patch()', 'EXTRA_OECONF', 'EXTRA_OECMAKE', 'EXTRA_OESCONS', 'do_configure()', 'EXTRA_OEMAKE', 'do_compile()', 'do_install()', 'do_populate_sysroot()', 'INITSCRIPT', 'USERADD', 'GROUPADD', 'PACKAGES', 'FILES', 'RDEPENDS', 'RRECOMMENDS', 'RSUGGESTS', 'RPROVIDES', 'RREPLACES', 'RCONFLICTS', 'ALLOW_EMPTY', 'populate_packages()', 'do_package()', 'do_deploy()', 'BBCLASSEXTEND'] # Variables that sometimes are a bit long but shouldn't be wrapped -nowrap_vars = ['SUMMARY', 'HOMEPAGE', 'BUGTRACKER', r'SRC_URI\[(.+\.)?md5sum\]', r'SRC_URI\[(.+\.)?sha256sum\]'] +nowrap_vars = ['SUMMARY', 'HOMEPAGE', 'BUGTRACKER', r'SRC_URI\[(.+\.)?md5sum\]', r'SRC_URI\[(.+\.)?sha[0-9]+sum\]'] list_vars = ['SRC_URI', 'LIC_FILES_CHKSUM'] meta_vars = ['SUMMARY', 'DESCRIPTION', 'HOMEPAGE', 'BUGTRACKER', 'SECTION'] From patchwork Wed Dec 6 19:22:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Kjellerstedt X-Patchwork-Id: 35806 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 63CADC10F13 for ; Wed, 6 Dec 2023 19:22:40 +0000 (UTC) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (EUR05-AM6-obe.outbound.protection.outlook.com [40.107.22.61]) by mx.groups.io with SMTP id smtpd.web10.42350.1701890557773064591 for ; Wed, 06 Dec 2023 11:22:38 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@axis.com header.s=selector1 header.b=Zu2xE8HW; spf=pass (domain: axis.com, ip: 40.107.22.61, mailfrom: peter.kjellerstedt@axis.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JdqDXZR/lETYGEkFAiidwjUKOLq6vO3NPzZGY6hk7LqQHrqtutTRNAES244DUewlWcOOJef3KrE6Mho//yUByTxokU4HVcEdNtJcwy4Sarlhf6WR7SehbI4zTBpj6uu7b7BEatqYK7lcxwafMCStdZMjzAoJ/6NVempAJtDk545ohRvzGA6iYrJ7WAKDG1jvBL74Cw5Ksv4fQvStxBktrjeKXswJuEF7S5zTAardR1wjBs9PKKi/AdVtpq0BmHhN/cIGDAZn1XblbhuNBLr4WaEmP6Vm4Ip+dbnhzXqXAqZMkkQRQ43E/jgjMbOVfv2+8xXpV1h/6K7u8c8CXagglg== 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=N+KmaAhglqfZ9SeY7uzgEDpigOK+XbwEi76JV8HJEm0=; b=lCsb/dAMOqbY463zXJn/RweORHifrGSai7vTiKtdn5hMbdrSIGmxA0tPBk5t/+hCIyNx1fzoDq7nOibrnhnxTzOB90D9LJvVMacptkgfuPEUWvpzoD2sE7PtZxXfxrGWtxIsdP3VYpR6JkWanAY1Tzd+WZZrtODgou3pm1+0vkGoowZdspY8fPMdqk/cQyK5KnQcR6E88n+BZ/iF/gBkC3Bqx8v/DuvdYfQYtD2Sz42hgcePRsym2ppKMwZrrPxC7mrnB9csBUZ6LlQ21afPOZbuDbHLd7/yTiXzo+Nwkv55V5FIUthUL6iznDnOcSifMyNVnjMYfqxgBoUjoC8kpQ== 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=N+KmaAhglqfZ9SeY7uzgEDpigOK+XbwEi76JV8HJEm0=; b=Zu2xE8HWOLXRZWzBZjxtcexS04I3J+gAnEzYD1jm1Ws7qGpHxQ0fTNbdnZqyhieZex/71cguoetmmTQJiwvveUFCynxMrAvLBWeZq02PO7QWGJ/K1QDCahhs1oND24EXPvNmXPOAZWDpK5U7t0XVWEmhg/aj0a5pbAoMb7AZPwM= Received: from DB7PR02CA0021.eurprd02.prod.outlook.com (2603:10a6:10:52::34) by AS4PR02MB7926.eurprd02.prod.outlook.com (2603:10a6:20b:4b5::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.25; Wed, 6 Dec 2023 19:22:35 +0000 Received: from DU6PEPF0000B621.eurprd02.prod.outlook.com (2603:10a6:10:52:cafe::e9) by DB7PR02CA0021.outlook.office365.com (2603:10a6:10:52::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.34 via Frontend Transport; Wed, 6 Dec 2023 19:22:35 +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 DU6PEPF0000B621.mail.protection.outlook.com (10.167.8.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7068.20 via Frontend Transport; Wed, 6 Dec 2023 19:22:35 +0000 Received: from se-mail01w.axis.com (10.20.40.7) 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; Wed, 6 Dec 2023 20:22:33 +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; Wed, 6 Dec 2023 20:22:33 +0100 Received: from saur (saur.se.axis.com [10.92.3.10]) by se-intmail01x.se.axis.com (Postfix) with ESMTP id 14F77F5C4 for ; Wed, 6 Dec 2023 20:22:33 +0100 (CET) Received: from saur.se.axis.com (localhost [127.0.0.1]) by saur (8.17.1/8.15.2) with ESMTPS id 3B6JMWBf2838193 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Wed, 6 Dec 2023 20:22:33 +0100 Received: (from pkj@localhost) by saur.se.axis.com (8.17.1/8.17.1/Submit) id 3B6JMWjh2838192 for openembedded-core@lists.openembedded.org; Wed, 6 Dec 2023 20:22:32 +0100 From: Peter Kjellerstedt To: Subject: [PATCH 6/9] recipetool: create: Improve identification of licenses Date: Wed, 6 Dec 2023 20:22:04 +0100 Message-ID: <20231206192207.2838077-7-pkj@axis.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231206192207.2838077-1-pkj@axis.com> References: <20231206192207.2838077-1-pkj@axis.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU6PEPF0000B621:EE_|AS4PR02MB7926:EE_ X-MS-Office365-Filtering-Correlation-Id: 0a7a54ca-c65e-464f-29d9-08dbf690b385 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 74FXmB+m6X3tyZbZxQX+JgDx+lzgopT29T2lzcltR/v6ysFu71Mmy5MhjC1pWA+BHVHVPgs3JDujWbXwo980Ldd9p9SXZZvxOcrDQD6jT30mdEX8QYcfBqdV+INM7E43Ctsy7QwOKj7pyQNJsbNJKE95u2rdOZMjzKTtNKiIYVb4G2BOdRNxJ3/e3V3DJnoK+BUHr6LX73FPAwyyikpb8aNed/k3t4v9HAwiuhMRekUTmDTefaNBXjJFwdf+qqjbggiaT8HuTcCKIUKv+mCOPlpDbOnQpX8RGPnMwSriR0l2o+SvxjRRmhl6qWTCFxwLAirhJKQsFnyeomYE6dtsjLFnB26hC1Gg20ip/9/JBVE3CbF7WGyjtg1Jt1EmyU9/XXC44KNopJtSBBoZ81BhIIrkZ0uJy0ryI+8w73xACOF/5ccW87Euh/GbgH+bxIsrQH6BxoiOn1jx1dwmYALUop579aaHOpNfMbGq4idP5sgtw1exAwauflGhqvebT9sel02PaPRb3J7v157x3ltY3Yr0yREcpVUTMKVTRHpCwKOED6x7d5+5TMgKVqzlzB6gso42R5k7mzXp/6oCtZEU6paf0OBpnUE2fFayF3mqYs9suQr9ExK67eCcdlNtnVTrbgeDLPmRfc+ucdNv3tqX+0Zjo3C6HJDRFw1NKyved2Hzeppkucg4mxH37q0eFFlgcG4gCEwZuuRKuiQPCIi/vvoe2zpaIFMnelnNDjDBbA6Peu2bi3n/X1lBxHlD5f2mGzurHMl+o2ouDGGykk2ltfeJ89/iod1Hpa5GU+yKdLLDoisFSX3zlnvMfQtnvmN6 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)(136003)(376002)(39860400002)(230373577357003)(230922051799003)(230473577357003)(451199024)(64100799003)(82310400011)(186009)(1800799012)(46966006)(40470700004)(36840700001)(83380400001)(426003)(40460700003)(6666004)(1076003)(2616005)(26005)(336012)(316002)(70206006)(42186006)(70586007)(6916009)(40480700001)(5660300002)(2906002)(8676002)(8936002)(36756003)(41300700001)(966005)(478600001)(81166007)(356005)(82740400003)(36860700001)(47076005)(2004002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: axis.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Dec 2023 19:22:35.0004 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0a7a54ca-c65e-464f-29d9-08dbf690b385 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: DU6PEPF0000B621.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR02MB7926 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 ; Wed, 06 Dec 2023 19:22:40 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/191911 Rather than having a static list of crunched MD5 checksums for some of the most common licenses, calculate it for all common licenses. This should improve the identification of license text variantions. Signed-off-by: Peter Kjellerstedt --- scripts/lib/recipetool/create.py | 91 ++++++++++++++++---------------- 1 file changed, 45 insertions(+), 46 deletions(-) diff --git a/scripts/lib/recipetool/create.py b/scripts/lib/recipetool/create.py index 293198d1c8..66b985487a 100644 --- a/scripts/lib/recipetool/create.py +++ b/scripts/lib/recipetool/create.py @@ -1059,54 +1059,18 @@ def get_license_md5sums(d, static_only=False, linenumbers=False): return md5sums -def crunch_license(licfile): +def crunch_known_licenses(d): ''' - Remove non-material text from a license file and then check - its md5sum against a known list. This works well for licenses - which contain a copyright statement, but is also a useful way - to handle people's insistence upon reformatting the license text - slightly (with no material difference to the text of the - license). + Calculate the MD5 checksums for the crunched versions of all common + licenses. Also add additional known checksums. ''' - - import oe.utils - - # Note: these are carefully constructed! - license_title_re = re.compile(r'^#*\(? *(This is )?([Tt]he )?.{0,15} ?[Ll]icen[sc]e( \(.{1,10}\))?\)?[:\.]? ?#*$') - license_statement_re = re.compile(r'^((This (project|software)|.{1,10}) is( free software)? (released|licen[sc]ed)|(Released|Licen[cs]ed)) under the .{1,10} [Ll]icen[sc]e:?$') - copyright_re = re.compile('^ *[#\*]* *(Modified work |MIT LICENSED )?Copyright ?(\([cC]\))? .*$') - disclaimer_re = re.compile('^ *\*? ?All [Rr]ights [Rr]eserved\.$') - email_re = re.compile('^.*<[\w\.-]*@[\w\.\-]*>$') - header_re = re.compile('^(\/\**!?)? ?[\-=\*]* ?(\*\/)?$') - tag_re = re.compile('^ *@?\(?([Ll]icense|MIT)\)?$') - url_re = re.compile('^ *[#\*]* *https?:\/\/[\w\.\/\-]+$') - + crunched_md5sums = {} # common licenses - crunched_md5sums['89f3bf322f30a1dcfe952e09945842f0'] = 'Apache-2.0' - crunched_md5sums['13b6fe3075f8f42f2270a748965bf3a1'] = '0BSD' - crunched_md5sums['ba87a7d7c20719c8df4b8beed9b78c43'] = 'BSD-2-Clause' - crunched_md5sums['7f8892c03b72de419c27be4ebfa253f8'] = 'BSD-3-Clause' - crunched_md5sums['21128c0790b23a8a9f9e260d5f6b3619'] = 'BSL-1.0' - crunched_md5sums['975742a59ae1b8abdea63a97121f49f4'] = 'EDL-1.0' - crunched_md5sums['5322cee4433d84fb3aafc9e253116447'] = 'EPL-1.0' - crunched_md5sums['6922352e87de080f42419bed93063754'] = 'EPL-2.0' - crunched_md5sums['793475baa22295cae1d3d4046a3a0ceb'] = 'GPL-2.0-only' - crunched_md5sums['ff9047f969b02c20f0559470df5cb433'] = 'GPL-2.0-or-later' - crunched_md5sums['ea6de5453fcadf534df246e6cdafadcd'] = 'GPL-3.0-only' - crunched_md5sums['b419257d4d153a6fde92ddf96acf5b67'] = 'GPL-3.0-or-later' - crunched_md5sums['228737f4c49d3ee75b8fb3706b090b84'] = 'ISC' - crunched_md5sums['c6a782e826ca4e85bf7f8b89435a677d'] = 'LGPL-2.0-only' - crunched_md5sums['32d8f758a066752f0db09bd7624b8090'] = 'LGPL-2.0-or-later' - crunched_md5sums['4820937eb198b4f84c52217ed230be33'] = 'LGPL-2.1-only' - crunched_md5sums['db13fe9f3a13af7adab2dc7a76f9e44a'] = 'LGPL-2.1-or-later' - crunched_md5sums['d7a0f2e4e0950e837ac3eabf5bd1d246'] = 'LGPL-3.0-only' - crunched_md5sums['abbf328e2b434f9153351f06b9f79d02'] = 'LGPL-3.0-or-later' - crunched_md5sums['eecf6429523cbc9693547cf2db790b5c'] = 'MIT' - crunched_md5sums['b218b0e94290b9b818c4be67c8e1cc82'] = 'MIT-0' - crunched_md5sums['ddc18131d6748374f0f35a621c245b49'] = 'Unlicense' - crunched_md5sums['51f9570ff32571fc0a443102285c5e33'] = 'WTFPL' + crunched_md5sums['ad4e9d34a2e966dfe9837f18de03266d'] = 'GFDL-1.1-only' + crunched_md5sums['d014fb11a34eb67dc717fdcfc97e60ed'] = 'GFDL-1.2-only' + crunched_md5sums['e020ca655b06c112def28e597ab844f1'] = 'GFDL-1.3-only' # The following two were gleaned from the "forever" npm package crunched_md5sums['0a97f8e4cbaf889d6fa51f84b89a79f6'] = 'ISC' @@ -1162,6 +1126,39 @@ def crunch_license(licfile): # https://raw.githubusercontent.com/stackgl/gl-mat3/v2.0.0/LICENSE.md crunched_md5sums['75512892d6f59dddb6d1c7e191957e9c'] = 'Zlib' + commonlicdir = d.getVar('COMMON_LICENSE_DIR') + for fn in sorted(os.listdir(commonlicdir)): + md5value, lictext = crunch_license(os.path.join(commonlicdir, fn)) + if md5value not in crunched_md5sums: + crunched_md5sums[md5value] = fn + elif fn != crunched_md5sums[md5value]: + bb.debug(2, "crunched_md5sums['%s'] is already set to '%s' rather than '%s'" % (md5value, crunched_md5sums[md5value], fn)) + else: + bb.debug(2, "crunched_md5sums['%s'] is already set to '%s'" % (md5value, crunched_md5sums[md5value])) + + return crunched_md5sums + +def crunch_license(licfile): + ''' + Remove non-material text from a license file and then calculate its + md5sum. This works well for licenses that contain a copyright statement, + but is also a useful way to handle people's insistence upon reformatting + the license text slightly (with no material difference to the text of the + license). + ''' + + import oe.utils + + # Note: these are carefully constructed! + license_title_re = re.compile(r'^#*\(? *(This is )?([Tt]he )?.{0,15} ?[Ll]icen[sc]e( \(.{1,10}\))?\)?[:\.]? ?#*$') + license_statement_re = re.compile(r'^((This (project|software)|.{1,10}) is( free software)? (released|licen[sc]ed)|(Released|Licen[cs]ed)) under the .{1,10} [Ll]icen[sc]e:?$') + copyright_re = re.compile('^ *[#\*]* *(Modified work |MIT LICENSED )?Copyright ?(\([cC]\))? .*$') + disclaimer_re = re.compile('^ *\*? ?All [Rr]ights [Rr]eserved\.$') + email_re = re.compile('^.*<[\w\.-]*@[\w\.\-]*>$') + header_re = re.compile('^(\/\**!?)? ?[\-=\*]* ?(\*\/)?$') + tag_re = re.compile('^ *@?\(?([Ll]icense|MIT)\)?$') + url_re = re.compile('^ *[#\*]* *https?:\/\/[\w\.\/\-]+$') + lictext = [] with open(licfile, 'r', errors='surrogateescape') as f: for line in f: @@ -1203,13 +1200,14 @@ def crunch_license(licfile): except UnicodeEncodeError: md5val = None lictext = '' - license = crunched_md5sums.get(md5val, None) - return license, md5val, lictext + return md5val, lictext def guess_license(srctree, d): import bb md5sums = get_license_md5sums(d) + crunched_md5sums = crunch_known_licenses(d) + licenses = [] licspecs = ['*LICEN[CS]E*', 'COPYING*', '*[Ll]icense*', 'LEGAL*', '[Ll]egal*', '*GPL*', 'README.lic*', 'COPYRIGHT*', '[Cc]opyright*', 'e[dp]l-v10'] skip_extensions = (".html", ".js", ".json", ".svg", ".ts", ".go") @@ -1227,7 +1225,8 @@ def guess_license(srctree, d): md5value = bb.utils.md5_file(licfile) license = md5sums.get(md5value, None) if not license: - license, crunched_md5, lictext = crunch_license(licfile) + crunched_md5, lictext = crunch_license(licfile) + license = crunched_md5sums.get(crunched_md5, None) if lictext and not license: license = 'Unknown' logger.info("Please add the following line for '%s' to a 'lib/recipetool/licenses.csv' " \ From patchwork Wed Dec 6 19:22:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Kjellerstedt X-Patchwork-Id: 35802 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 3AB66C10DC1 for ; Wed, 6 Dec 2023 19:22:40 +0000 (UTC) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (EUR05-AM6-obe.outbound.protection.outlook.com [40.107.22.83]) by mx.groups.io with SMTP id smtpd.web10.42353.1701890559460755660 for ; Wed, 06 Dec 2023 11:22:39 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@axis.com header.s=selector1 header.b=JeDtYWRm; spf=pass (domain: axis.com, ip: 40.107.22.83, mailfrom: peter.kjellerstedt@axis.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZRJOIofXMU/Zz20YPKYw7zCu6MUUTndw3h5GCpzyPh4gp3RuJlDLr1kuFfWtEwfPKrzlaPGv5f3V27yJuWWOQhq0TpNs3jxRVlbB/i5HdNIr4WjNMsuu4APVnM6009GvnowmK1kX8RL0ofah2E1uBDJkWS0p6EMd/8lwyC+R18YS2aNlTNMRls75UaSCmnFlP2WzofX4q3AQkCbO8gkePBeYiSUbOPKkSK4LjzjK/8M8YhjWgtzpGor6mJvlVpPHLbzQ0LAGb6E3AQj/aMgd1Y8TxT+7YoQDtvHApNdYq4OmcBT08ITpn5Oru0AJTqFH5pmXjkNmTE8T2bonc9I1Qg== 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=5YM3IA+Zl5JdvaVprgEwXLBJQIbWQjCC9PIJMpuutdM=; b=fnhdt1kGxfV/TrO5jyRnYxxmYdFn6x87+JeT4sZ0W4QVOa0i2d6YIJBUyDKEznzoSvNYyXZGnqOyU/67uHrBjaKp4HsKsVSeDy88C2ewbFuTGNxW8CRMjW84qzc8Z0RguNmkOB/lkTnTFpWExCyt9TC0e4SjsrN3ciAZmFDwDrlukpytMw8/4ishO/ofgwqhHDWe1YVQQe4RB/CigZC0F0TY8NdwfPtENUdQIlRA2eBoJ80nJixXltUa0w/zMS6liNLRinDgcuHz5qVd65bYkVb49UEata4tHG3ahM3Gc38JqOkgx2jrQ0s8LHyq4nalJVCz8a7soT+GmLl7piSlYA== 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=5YM3IA+Zl5JdvaVprgEwXLBJQIbWQjCC9PIJMpuutdM=; b=JeDtYWRmGCpffHRAH5vai647qckwLWoyy8to3EFDMb/jvL9G9/w9DBX9tvcySQwzTztERqOUlWlmWSqO4csqMGudejeEvOJcamMJShzImQ/Og0B6KASEemtQHzXnuXJ2btsTGncDfYspFY2m4UtPJ5QWBWvHj2HTi5qyPk3eufY= Received: from DB7PR02CA0031.eurprd02.prod.outlook.com (2603:10a6:10:52::44) by DU0PR02MB8412.eurprd02.prod.outlook.com (2603:10a6:10:3b4::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.34; Wed, 6 Dec 2023 19:22:35 +0000 Received: from DU6PEPF0000B621.eurprd02.prod.outlook.com (2603:10a6:10:52:cafe::ef) by DB7PR02CA0031.outlook.office365.com (2603:10a6:10:52::44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.34 via Frontend Transport; Wed, 6 Dec 2023 19:22:35 +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 DU6PEPF0000B621.mail.protection.outlook.com (10.167.8.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7068.20 via Frontend Transport; Wed, 6 Dec 2023 19:22:35 +0000 Received: from se-mail01w.axis.com (10.20.40.7) 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; Wed, 6 Dec 2023 20:22:33 +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; Wed, 6 Dec 2023 20:22:33 +0100 Received: from saur (saur.se.axis.com [10.92.3.10]) by se-intmail01x.se.axis.com (Postfix) with ESMTP id 3C456F5C4 for ; Wed, 6 Dec 2023 20:22:33 +0100 (CET) Received: from saur.se.axis.com (localhost [127.0.0.1]) by saur (8.17.1/8.15.2) with ESMTPS id 3B6JMXir2838197 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Wed, 6 Dec 2023 20:22:33 +0100 Received: (from pkj@localhost) by saur.se.axis.com (8.17.1/8.17.1/Submit) id 3B6JMXFl2838196 for openembedded-core@lists.openembedded.org; Wed, 6 Dec 2023 20:22:33 +0100 From: Peter Kjellerstedt To: Subject: [PATCH 7/9] recipetool: create: Only include the expected SRC_URI checksums Date: Wed, 6 Dec 2023 20:22:05 +0100 Message-ID: <20231206192207.2838077-8-pkj@axis.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231206192207.2838077-1-pkj@axis.com> References: <20231206192207.2838077-1-pkj@axis.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU6PEPF0000B621:EE_|DU0PR02MB8412:EE_ X-MS-Office365-Filtering-Correlation-Id: 064c75af-e8f8-4157-3832-08dbf690b3f5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rStA3AMFO7k34iPehmHV8AzC1Z5tsOwZHdLExI6UHxkdM4WWrNqBhdsTOAsE0OhYKCkTpaoK6q83tLvRLp/hTioiutsvN4d11JZGXa7GnjbDVoUpc6C7/EmI9Wz6TR7PV5v9WjkFaYpf3w6Bj7he42dZmrSgdO4Hyyw+xI42QBLwbbQtVh3jrTylqitfHGPvCp9W7HI5Jc8jPrwe2P40fEq06SvqYW5CgBfLfPkJADR4VlZ00npahUqaEV14V8VlG0m4uantfcYspkPBIEKynfWCR4ujlAR0Y7Gt+6Zj9p/evwXZajjSsvCAw0olR8bmgb3krpEbfh1mOmxY2Xa9igFm8hHcIrGijn7zYktBE6BdeMULpOmQq52tD7wN5pF7WsANHpQzAMioQLTE2h7B8l8LolBJxfHko6J7jzf1CxQ+qRhCwUDPw7rYEGftoYQyiAq3s6xijQTNpO7HjgQMnGDUFfbLr9Ypwps4pKRAlZMt2h5B8NsFFTlfDRHeSbHe3CY6uwqP8yuHladxymdQqCfQXVoHhzU4hK2mOORjqtyUIfUdDHXb8Clb9jeP/2wdKrLcXHkLXfbfYUDmAl3fv//dSrqU2ITsKn6HQvPwhDVW1LjK4+vbh0OkgdJumfAxSCoz9B4SqYkRmtIY5grzqd0/+svXBwYgN0DP2I5i9TxC5c+cB4rWgwZ0hA/5bcTLS8sax5DyvreiMTmLKsSnRJE45EfE5vJ3IyhkG0oLEtPQ448xdphgnKGy3x8/7QhgqUKDdVrr93qwUP783A6VU+dTXIQLCiKcbjhPkg3ieYs= 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)(396003)(346002)(376002)(39860400002)(230273577357003)(230922051799003)(230173577357003)(1800799012)(82310400011)(451199024)(186009)(64100799003)(46966006)(40470700004)(36840700001)(6916009)(70586007)(70206006)(8936002)(42186006)(316002)(8676002)(478600001)(40460700003)(6666004)(5660300002)(36756003)(41300700001)(2906002)(426003)(356005)(40480700001)(83380400001)(81166007)(336012)(26005)(1076003)(2616005)(47076005)(82740400003)(36860700001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: axis.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Dec 2023 19:22:35.7191 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 064c75af-e8f8-4157-3832-08dbf690b3f5 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: DU6PEPF0000B621.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR02MB8412 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 ; Wed, 06 Dec 2023 19:22:40 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/191916 Rather than including all SRC_URI checksums, include the ones that are expected. These are the same as are output if no checksums are included when building the recipe. Signed-off-by: Peter Kjellerstedt --- meta/lib/oeqa/selftest/cases/recipetool.py | 19 ------------------- scripts/lib/recipetool/create.py | 4 +++- 2 files changed, 3 insertions(+), 20 deletions(-) diff --git a/meta/lib/oeqa/selftest/cases/recipetool.py b/meta/lib/oeqa/selftest/cases/recipetool.py index 3a05343210..910bf0b4f6 100644 --- a/meta/lib/oeqa/selftest/cases/recipetool.py +++ b/meta/lib/oeqa/selftest/cases/recipetool.py @@ -349,7 +349,6 @@ class RecipetoolCreateTests(RecipetoolBase): checkvars['LICENSE'] = 'GPL-2.0-only' checkvars['LIC_FILES_CHKSUM'] = 'file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263' checkvars['SRC_URI'] = 'https://github.com/logrotate/logrotate/releases/download/${PV}/logrotate-${PV}.tar.xz' - checkvars['SRC_URI[md5sum]'] = 'a560c57fac87c45b2fc17406cdf79288' checkvars['SRC_URI[sha256sum]'] = '2e6a401cac9024db2288297e3be1a8ab60e7401ba8e91225218aaf4a27e82a07' self._test_recipe_contents(recipefile, checkvars, []) @@ -407,7 +406,6 @@ class RecipetoolCreateTests(RecipetoolBase): checkvars = {} checkvars['LICENSE'] = set(['LGPL-2.1-only', 'MPL-1.1-only']) checkvars['SRC_URI'] = 'http://taglib.github.io/releases/taglib-${PV}.tar.gz' - checkvars['SRC_URI[md5sum]'] = 'cee7be0ccfc892fa433d6c837df9522a' checkvars['SRC_URI[sha256sum]'] = 'b6d1a5a610aae6ff39d93de5efd0fdc787aa9e9dc1e7026fa4c961b26563526b' checkvars['DEPENDS'] = set(['boost', 'zlib']) inherits = ['cmake'] @@ -470,7 +468,6 @@ class RecipetoolCreateTests(RecipetoolBase): checkvars['LICENSE'] = set(['MIT']) checkvars['LIC_FILES_CHKSUM'] = 'file://LICENSE;md5=16a934f165e8c3245f241e77d401bb88' checkvars['SRC_URI'] = 'https://files.pythonhosted.org/packages/84/30/80932401906eaf787f2e9bd86dc458f1d2e75b064b4c187341f29516945c/python-magic-${PV}.tar.gz' - checkvars['SRC_URI[md5sum]'] = 'e384c95a47218f66c6501cd6dd45ff59' checkvars['SRC_URI[sha256sum]'] = 'f3765c0f582d2dfc72c15f3b5a82aecfae9498bd29ca840d72f37d7bd38bfcd5' inherits = ['setuptools3'] self._test_recipe_contents(recipefile, checkvars, inherits) @@ -500,11 +497,7 @@ class RecipetoolCreateTests(RecipetoolBase): checkvars['LICENSE'] = set(['BSD-3-Clause']) checkvars['LIC_FILES_CHKSUM'] = 'file://LICENSE;md5=702b1ef12cf66832a88f24c8f2ee9c19' checkvars['SRC_URI'] = 'https://files.pythonhosted.org/packages/a1/fb/f95560c6a5d4469d9c49e24cf1b5d4d21ffab5608251c6020a965fb7791c/webcolors-${PV}.tar.gz' - checkvars['SRC_URI[md5sum]'] = 'c9be30c5b0cf1cad32e4cbacbb2229e9' - checkvars['SRC_URI[sha1sum]'] = 'c90b84fb65eed9b4c9dea7f08c657bfac0e820a5' checkvars['SRC_URI[sha256sum]'] = 'c225b674c83fa923be93d235330ce0300373d02885cef23238813b0d5668304a' - checkvars['SRC_URI[sha384sum]'] = '45652af349660f19f68d01361dd5bda287789e5ea63608f52a8cea526ac04465614db2ea236103fb8456b1fcaea96ed7' - checkvars['SRC_URI[sha512sum]'] = '074aaf135ac6b0025b88b731d1d6dfa4c539b4fff7195658cc58a4326bb9f0449a231685d312b4a1ec48ca535a838bfa5c680787fe0e61473a2a092c448937d0' inherits = ['python_setuptools_build_meta'] self._test_recipe_contents(recipefile, checkvars, inherits) @@ -534,11 +527,7 @@ class RecipetoolCreateTests(RecipetoolBase): checkvars['LICENSE'] = set(['MIT']) checkvars['LIC_FILES_CHKSUM'] = 'file://LICENSE;md5=aab31f2ef7ba214a5a341eaa47a7f367' checkvars['SRC_URI'] = 'https://files.pythonhosted.org/packages/b9/f3/ef59cee614d5e0accf6fd0cbba025b93b272e626ca89fb70a3e9187c5d15/iso8601-${PV}.tar.gz' - checkvars['SRC_URI[md5sum]'] = '6e33910eba87066b3be7fcf3d59d16b5' - checkvars['SRC_URI[sha1sum]'] = 'efd225b2c9fa7d9e4a1ec6ad94f3295cee982e61' checkvars['SRC_URI[sha256sum]'] = '6b1d3829ee8921c4301998c909f7829fa9ed3cbdac0d3b16af2d743aed1ba8df' - checkvars['SRC_URI[sha384sum]'] = '255002433fe65c19adfd6b91494271b613cb25ef6a35ac77436de1e03d60cc07bf89fd716451b917f1435e4384860ef6' - checkvars['SRC_URI[sha512sum]'] = 'db57ab2a25ef91e3bc479c8539d27e853cf1fbf60986820b8999ae15d7e566425a1e0cfba47d0f3b23aa703db0576db368e6c110ba2a2f46c9a34e8ee3611fb7' inherits = ['python_poetry_core'] self._test_recipe_contents(recipefile, checkvars, inherits) @@ -568,11 +557,7 @@ class RecipetoolCreateTests(RecipetoolBase): checkvars['LICENSE'] = set(['PSF-2.0']) checkvars['LIC_FILES_CHKSUM'] = 'file://LICENSE;md5=fcf6b249c2641540219a727f35d8d2c2' checkvars['SRC_URI'] = 'https://files.pythonhosted.org/packages/1f/7a/8b94bb016069caa12fc9f587b28080ac33b4fbb8ca369b98bc0a4828543e/typing_extensions-${PV}.tar.gz' - checkvars['SRC_URI[md5sum]'] = '74bafe841fbd1c27324afdeb099babdf' - checkvars['SRC_URI[sha1sum]'] = 'f8bed69cbad4a57a1a67bf8a31b62b657b47f7a3' checkvars['SRC_URI[sha256sum]'] = 'df8e4339e9cb77357558cbdbceca33c303714cf861d1eef15e1070055ae8b7ef' - checkvars['SRC_URI[sha384sum]'] = '0bd0112234134d965c6884f3c1f95d27b6ae49cfb08108101158e31dff33c2dce729331628b69818850f1acb68f6c8d0' - checkvars['SRC_URI[sha512sum]'] = '5fbff10e085fbf3ac2e35d08d913608d8c8bca66903435ede91cdc7776d775689a53d64f5f0615fe687c6c228ac854c8651d99eb1cb96ec61c56b7ca01fdd440' inherits = ['python_flit_core'] self._test_recipe_contents(recipefile, checkvars, inherits) @@ -603,11 +588,7 @@ class RecipetoolCreateTests(RecipetoolBase): checkvars['LICENSE'] = set(['MIT']) checkvars['LIC_FILES_CHKSUM'] = 'file://COPYING;md5=7a60a81c146ec25599a3e1dabb8610a8 file://json/LICENSE;md5=9d4de43111d33570c8fe49b4cb0e01af' checkvars['SRC_URI'] = 'https://files.pythonhosted.org/packages/e4/43/087b24516db11722c8687e0caf0f66c7785c0b1c51b0ab951dfde924e3f5/jsonschema-${PV}.tar.gz' - checkvars['SRC_URI[md5sum]'] = '4d6667ce76f820c35082c2d60a4896ab' - checkvars['SRC_URI[sha1sum]'] = '9173714cb88964d07f3a3f4fcaaef638b8ceac0c' checkvars['SRC_URI[sha256sum]'] = 'ec84cc37cfa703ef7cd4928db24f9cb31428a5d0fa77747b8b51a847458e0bbf' - checkvars['SRC_URI[sha384sum]'] = '7a53181f0e679aa3dc3eb4d05a420877b7b9bff2d02e81f5c289a37ed1127d6c0cca1f5a5f9e4e166f089ab36bcc2be9' - checkvars['SRC_URI[sha512sum]'] = '60fa769faf6e3fc2c14eb9acd189c86e9d366b157230a5681d36552af0c159cb1ad33fd920668a36afdab98bc97253f91501704c5c07b5009fdaf9d29b52060d' inherits = ['python_hatchling'] self._test_recipe_contents(recipefile, checkvars, inherits) diff --git a/scripts/lib/recipetool/create.py b/scripts/lib/recipetool/create.py index 66b985487a..84a092ddb3 100644 --- a/scripts/lib/recipetool/create.py +++ b/scripts/lib/recipetool/create.py @@ -677,8 +677,10 @@ def create_recipe(args): if not srcuri: lines_before.append('# No information for SRC_URI yet (only an external source tree was specified)') lines_before.append('SRC_URI = "%s"' % srcuri) + shown_checksums = ["%ssum" % s for s in bb.fetch2.SHOWN_CHECKSUM_LIST] for key, value in sorted(checksums.items()): - lines_before.append('SRC_URI[%s] = "%s"' % (key, value)) + if key in shown_checksums: + lines_before.append('SRC_URI[%s] = "%s"' % (key, value)) if srcuri and supports_srcrev(srcuri): lines_before.append('') lines_before.append('# Modify these as desired') From patchwork Wed Dec 6 19:22:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Kjellerstedt X-Patchwork-Id: 35803 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 2C404C46CA0 for ; Wed, 6 Dec 2023 19:22:40 +0000 (UTC) Received: from EUR02-AM0-obe.outbound.protection.outlook.com (EUR02-AM0-obe.outbound.protection.outlook.com [40.107.247.59]) by mx.groups.io with SMTP id smtpd.web11.41994.1701890558007868423 for ; Wed, 06 Dec 2023 11:22:38 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@axis.com header.s=selector1 header.b=VFOgdXj5; spf=pass (domain: axis.com, ip: 40.107.247.59, mailfrom: peter.kjellerstedt@axis.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=D9nn5sCaq1Qm6rmJl2vKa6kQWG2qcclaPzmog6IowEEKi5vERq2ZY2mQ1JBCvmAQGhU3PDmhVGcsmLePvQmY5MZQKB55mjK2syGzWFLtilyt/qGNX1gtqGL1cMHh6kA5sa0K5TqqaNjZyg5RSrzyuq0KrpwpCUMgfr4Dg5G8d5X/T/UfbM8sPEMB0LFHrSEiKuSfTRXnLVqV7aIi9pkvTksacOORvXA08b4rPAaeXF4US79Y0TCR62fpVpPtD2Mv18NOKONAqlfWq2Pv5mZPyrhgZ3/FfcN3FsDPNS9vj/K+9mI58Rnu/xPYm2yb4ea3B3Cm9sYvrUe3xzvoj2O/jQ== 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=UPe6vh3o8xxAGkB/KAQy8UlpOH7qzzVw9KOyX8ixTV4=; b=EHLQGNzcKlJIaincnk4/CwbHDDTF96IIyhcEgrtSedGZNELB+FVzu6Yy+cEbFkEVpxVMse6IW/i3OjFVSciTtwBTYqMU0nZHOtIjhqLT4E7OSVMdt9dLBF9Lin5Q0HrdlX3UYAajgYHWFNaOAaVveFAbhl1dN8Gi95HXpE7kpi6W0NgKp3m1Mth+cjJyEC+/h3TPmivo2/Z0pBZJAIlJmrNVem379kNpmgP2hP5cYJBmvuAr4BOS6pE/1A/ShgMjyvOjw44j1O/Oy+B7b2mDCPuynLTXxwUbfZhiV4aiWfsSrjrihsuwDbg0tXWoYY/IthDbDRXmwj8Ed7XSfsCagQ== 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=UPe6vh3o8xxAGkB/KAQy8UlpOH7qzzVw9KOyX8ixTV4=; b=VFOgdXj5hsjJSkGQhL0joLbbuhU04wLYyDorjjguPo+1MiLNWADeVnwRgpUlQ+NCVUPQ8I1PNy0uBpvDg7/ju+o5RLOw/VdIiZ/ePNG5jUY5lpe8Nw6pwAaP7BFumihfDls7/YqIirYapHSQJqLbu6JyPS+nJAmJRhByiHEhvPg= Received: from AS9PR06CA0027.eurprd06.prod.outlook.com (2603:10a6:20b:462::15) by GV1PR02MB8729.eurprd02.prod.outlook.com (2603:10a6:150:92::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.34; Wed, 6 Dec 2023 19:22:34 +0000 Received: from AMS1EPF00000045.eurprd04.prod.outlook.com (2603:10a6:20b:462:cafe::5c) by AS9PR06CA0027.outlook.office365.com (2603:10a6:20b:462::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.34 via Frontend Transport; Wed, 6 Dec 2023 19:22:34 +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 AMS1EPF00000045.mail.protection.outlook.com (10.167.16.42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7068.20 via Frontend Transport; Wed, 6 Dec 2023 19:22:33 +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; Wed, 6 Dec 2023 20:22:33 +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; Wed, 6 Dec 2023 20:22:33 +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; Wed, 6 Dec 2023 20:22:33 +0100 Received: from saur (saur.se.axis.com [10.92.3.10]) by se-intmail01x.se.axis.com (Postfix) with ESMTP id 5B868F676 for ; Wed, 6 Dec 2023 20:22:33 +0100 (CET) Received: from saur.se.axis.com (localhost [127.0.0.1]) by saur (8.17.1/8.15.2) with ESMTPS id 3B6JMXCM2838207 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Wed, 6 Dec 2023 20:22:33 +0100 Received: (from pkj@localhost) by saur.se.axis.com (8.17.1/8.17.1/Submit) id 3B6JMXT72838206 for openembedded-core@lists.openembedded.org; Wed, 6 Dec 2023 20:22:33 +0100 From: Peter Kjellerstedt To: Subject: [PATCH 8/9] devtool: upgrade: Update all existing checksums for the SRC_URI Date: Wed, 6 Dec 2023 20:22:06 +0100 Message-ID: <20231206192207.2838077-9-pkj@axis.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231206192207.2838077-1-pkj@axis.com> References: <20231206192207.2838077-1-pkj@axis.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AMS1EPF00000045:EE_|GV1PR02MB8729:EE_ X-MS-Office365-Filtering-Correlation-Id: 372c0d40-02ea-4ca4-4390-08dbf690b2de X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NfQyWO2cP79cr8i2O2+FqEN88Z10/tag9fsxQDjC2WHPKVX9V0qVuxRqoDHXv35/pNOsrCS2CKJ5Ni3wA9fVeU0mD0FF5bRyhP6rRCYH+Ec4yZttHRiIOsYR2i1AcYUYAWbj9oKW5V7fQQrVIbmihUWy0xZOIlOTpvjX2tE82he+6mznmA74WDyG/qpjCLOZgtNi6fioj8irMFv9lHPXZHU/FMhfjq3UrJbZhAga+xErFkKnjuQSu+kfHWjIjygeGtyZ9qj1urWJpANGa3kezloXDwVZfdRdQsGlE8onX7X3mkx7iH/IOf+WBP9xE0LZ0uhShYmkNseMmMz6exZn2RvtqDoQHVbihZoPIEwGSc/Aw9rHdrF8c/sB5GZw9SusaBwQMJxTkvHlj5av0ZDqg8rPs2Cjr0O8lHrvhNSEbcNlyvDYUIEIit3h+6fSx0FdDUvd37Ek8KWd6/koOHhF8qAg3DCrunoFqFEEAqGJ+U04zqYY10TvByrH2mjIQsYpS775DNuTME3Cm4IALbBfDlUn22mnGIj9g5UaMDlikuT1KNXRFzrcNVt6/olCAD0eTJg/4QGkqSsnxXBM4/Q8cXSb6na9JWE7nyl2Mr+Mhxcauvc6pgcXYTvPywFV73rgUlwrHPZOnnv2RiijisFvkHIWTo3rUAMvuIaXCw/XI0rKeUd6z7IVHu3RIbsIfEVNBN+GuSpDCRiLzvObONYa/7SxMot1SSGixOxErG+o75XKWupULWFGiAzKhoUgcn7yFJvg8DSmbUayNsoq9ljdvDxiGv81XsnGw2pnjfPIfNbfvHF/lk1F+MuXtSeXcSeukQ4loMyi4rIAVRuGsbM2Ag== 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)(136003)(396003)(376002)(39860400002)(230922051799003)(451199024)(82310400011)(64100799003)(1800799012)(186009)(40470700004)(36840700001)(46966006)(36756003)(41300700001)(5660300002)(30864003)(15650500001)(2906002)(19273905006)(40460700003)(82740400003)(47076005)(81166007)(70206006)(356005)(70586007)(26005)(83380400001)(6666004)(478600001)(1076003)(426003)(336012)(2616005)(40480700001)(36860700001)(8936002)(8676002)(316002)(42186006)(6916009)(562404015)(36900700001)(473944003)(563064011);DIR:OUT;SFP:1101; X-OriginatorOrg: axis.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Dec 2023 19:22:33.9378 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 372c0d40-02ea-4ca4-4390-08dbf690b2de 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: AMS1EPF00000045.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR02MB8729 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 ; Wed, 06 Dec 2023 19:22:40 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/191913 Rather than only updating the sha256sum and removing the md5sum, update all existing checksums. If the only existing checksum is md5sum, then replace it with the default expected checksums. Signed-off-by: Peter Kjellerstedt --- .../devtool/devtool-upgrade-test3_1.5.3.bb | 16 ++++++ .../devtool-upgrade-test3_1.5.3.bb.upgraded | 15 ++++++ .../devtool/devtool-upgrade-test4_1.5.3.bb | 22 ++++++++ .../devtool-upgrade-test4_1.5.3.bb.upgraded | 19 +++++++ meta/lib/oeqa/selftest/cases/devtool.py | 48 +++++++++++++++++ scripts/lib/devtool/upgrade.py | 51 ++++++++++--------- 6 files changed, 148 insertions(+), 23 deletions(-) create mode 100644 meta-selftest/recipes-test/devtool/devtool-upgrade-test3_1.5.3.bb create mode 100644 meta-selftest/recipes-test/devtool/devtool-upgrade-test3_1.5.3.bb.upgraded create mode 100644 meta-selftest/recipes-test/devtool/devtool-upgrade-test4_1.5.3.bb create mode 100644 meta-selftest/recipes-test/devtool/devtool-upgrade-test4_1.5.3.bb.upgraded diff --git a/meta-selftest/recipes-test/devtool/devtool-upgrade-test3_1.5.3.bb b/meta-selftest/recipes-test/devtool/devtool-upgrade-test3_1.5.3.bb new file mode 100644 index 0000000000..69c0d351ec --- /dev/null +++ b/meta-selftest/recipes-test/devtool/devtool-upgrade-test3_1.5.3.bb @@ -0,0 +1,16 @@ +SUMMARY = "Pipe viewer test recipe for devtool upgrade test" +LICENSE = "Artistic-2.0" +LIC_FILES_CHKSUM = "file://doc/COPYING;md5=9c50db2589ee3ef10a9b7b2e50ce1d02" + +SRC_URI = "http://www.ivarch.com/programs/sources/pv-${PV}.tar.gz" +UPSTREAM_CHECK_URI = "http://www.ivarch.com/programs/pv.shtml" +RECIPE_NO_UPDATE_REASON = "This recipe is used to test devtool upgrade feature" + +SRC_URI[md5sum] = "9365d86bd884222b4bf1039b5a9ed1bd" + +S = "${WORKDIR}/pv-${PV}" + +EXCLUDE_FROM_WORLD = "1" + +inherit autotools + diff --git a/meta-selftest/recipes-test/devtool/devtool-upgrade-test3_1.5.3.bb.upgraded b/meta-selftest/recipes-test/devtool/devtool-upgrade-test3_1.5.3.bb.upgraded new file mode 100644 index 0000000000..3ce7e85e10 --- /dev/null +++ b/meta-selftest/recipes-test/devtool/devtool-upgrade-test3_1.5.3.bb.upgraded @@ -0,0 +1,15 @@ +SUMMARY = "Pipe viewer test recipe for devtool upgrade test" +LICENSE = "Artistic-2.0" +LIC_FILES_CHKSUM = "file://doc/COPYING;md5=9c50db2589ee3ef10a9b7b2e50ce1d02" + +SRC_URI[sha256sum] = "9dd45391806b0ed215abee4c5ac1597d018c386fe9c1f5afd2f6bc3b07fd82c3" +SRC_URI = "http://www.ivarch.com/programs/sources/pv-${PV}.tar.gz" +UPSTREAM_CHECK_URI = "http://www.ivarch.com/programs/pv.shtml" +RECIPE_NO_UPDATE_REASON = "This recipe is used to test devtool upgrade feature" + +S = "${WORKDIR}/pv-${PV}" + +EXCLUDE_FROM_WORLD = "1" + +inherit autotools + diff --git a/meta-selftest/recipes-test/devtool/devtool-upgrade-test4_1.5.3.bb b/meta-selftest/recipes-test/devtool/devtool-upgrade-test4_1.5.3.bb new file mode 100644 index 0000000000..9abf80e6ed --- /dev/null +++ b/meta-selftest/recipes-test/devtool/devtool-upgrade-test4_1.5.3.bb @@ -0,0 +1,22 @@ +SUMMARY = "Pipe viewer test recipe for devtool upgrade test" +LICENSE = "Artistic-2.0" +LIC_FILES_CHKSUM = "file://doc/COPYING;md5=9c50db2589ee3ef10a9b7b2e50ce1d02" + +SRC_URI = "http://www.ivarch.com/programs/sources/pv-${PV}.tar.gz" +UPSTREAM_CHECK_URI = "http://www.ivarch.com/programs/pv.shtml" +RECIPE_NO_UPDATE_REASON = "This recipe is used to test devtool upgrade feature" + +SRC_URI[md5sum] = "9365d86bd884222b4bf1039b5a9ed1bd" +SRC_URI[sha1sum] = "63a0801350e812541c7f8e9ad74e0d6b629d0b39" +SRC_URI[sha256sum] = "681bcca9784bf3cb2207e68236d1f68e2aa7b80f999b5750dc77dcd756e81fbc" +SRC_URI[sha384sum] = "5fff6390465ff23dbf573fcf39dfad3aed2f92074a35e6c02abe58b7678858d90fa6572ff4cb56df8b3e217c739cdbe3" +SRC_URI[sha512sum] = "32efe7071a363f547afc74e96774f711795edda1d2702823a347d0f9953e859b7d8c45b3e63e18ffb9e0d5ed5910be652d7d727c8676e81b6cb3aed0b13aec00" + +PR = "r5" + +S = "${WORKDIR}/pv-${PV}" + +EXCLUDE_FROM_WORLD = "1" + +inherit autotools + diff --git a/meta-selftest/recipes-test/devtool/devtool-upgrade-test4_1.5.3.bb.upgraded b/meta-selftest/recipes-test/devtool/devtool-upgrade-test4_1.5.3.bb.upgraded new file mode 100644 index 0000000000..cd2a0842f4 --- /dev/null +++ b/meta-selftest/recipes-test/devtool/devtool-upgrade-test4_1.5.3.bb.upgraded @@ -0,0 +1,19 @@ +SUMMARY = "Pipe viewer test recipe for devtool upgrade test" +LICENSE = "Artistic-2.0" +LIC_FILES_CHKSUM = "file://doc/COPYING;md5=9c50db2589ee3ef10a9b7b2e50ce1d02" + +SRC_URI = "http://www.ivarch.com/programs/sources/pv-${PV}.tar.gz" +UPSTREAM_CHECK_URI = "http://www.ivarch.com/programs/pv.shtml" +RECIPE_NO_UPDATE_REASON = "This recipe is used to test devtool upgrade feature" + +SRC_URI[sha1sum] = "395ce62f4f3e035b86c77038f04b96c5aa233595" +SRC_URI[sha256sum] = "9dd45391806b0ed215abee4c5ac1597d018c386fe9c1f5afd2f6bc3b07fd82c3" +SRC_URI[sha384sum] = "218c8d2d097aeba5310be759bc20573f18ffa0b11701eac6dd2e7e14ddf13c6e0e094ca7ca026eaa05ef92a056402e36" +SRC_URI[sha512sum] = "1cf9d7376fceefcd594d0a8b591afc8e11ce89f7210d10ad74438974ecebe9cc5d9ec4db9cc79e0566bfd2b0278c0cc263c07547803e7536432cd1ffd32d8a45" + +S = "${WORKDIR}/pv-${PV}" + +EXCLUDE_FROM_WORLD = "1" + +inherit autotools + diff --git a/meta/lib/oeqa/selftest/cases/devtool.py b/meta/lib/oeqa/selftest/cases/devtool.py index e01ab01869..4e65484d81 100644 --- a/meta/lib/oeqa/selftest/cases/devtool.py +++ b/meta/lib/oeqa/selftest/cases/devtool.py @@ -1883,6 +1883,54 @@ class DevtoolUpgradeTests(DevtoolBase): self.assertNotIn(recipe, result.output) self.assertNotExists(os.path.join(self.workspacedir, 'recipes', recipe), 'Recipe directory should not exist after resetting') + def test_devtool_upgrade_drop_md5sum(self): + # Check preconditions + self.assertTrue(not os.path.exists(self.workspacedir), 'This test cannot be run with a workspace directory under the build directory') + self.track_for_cleanup(self.workspacedir) + self.add_command_to_tearDown('bitbake-layers remove-layer */workspace') + # For the moment, we are using a real recipe. + recipe = 'devtool-upgrade-test3' + version = '1.6.0' + oldrecipefile = get_bb_var('FILE', recipe) + tempdir = tempfile.mkdtemp(prefix='devtoolqa') + self.track_for_cleanup(tempdir) + # Check upgrade. Code does not check if new PV is older or newer that current PV, so, it may be that + # we are downgrading instead of upgrading. + result = runCmd('devtool upgrade %s %s -V %s' % (recipe, tempdir, version)) + # Check new recipe file is present + newrecipefile = os.path.join(self.workspacedir, 'recipes', recipe, '%s_%s.bb' % (recipe, version)) + self.assertExists(newrecipefile, 'Recipe file should exist after upgrade') + # Check recipe got changed as expected + with open(oldrecipefile + '.upgraded', 'r') as f: + desiredlines = f.readlines() + with open(newrecipefile, 'r') as f: + newlines = f.readlines() + self.assertEqual(desiredlines, newlines) + + def test_devtool_upgrade_all_checksums(self): + # Check preconditions + self.assertTrue(not os.path.exists(self.workspacedir), 'This test cannot be run with a workspace directory under the build directory') + self.track_for_cleanup(self.workspacedir) + self.add_command_to_tearDown('bitbake-layers remove-layer */workspace') + # For the moment, we are using a real recipe. + recipe = 'devtool-upgrade-test4' + version = '1.6.0' + oldrecipefile = get_bb_var('FILE', recipe) + tempdir = tempfile.mkdtemp(prefix='devtoolqa') + self.track_for_cleanup(tempdir) + # Check upgrade. Code does not check if new PV is older or newer that current PV, so, it may be that + # we are downgrading instead of upgrading. + result = runCmd('devtool upgrade %s %s -V %s' % (recipe, tempdir, version)) + # Check new recipe file is present + newrecipefile = os.path.join(self.workspacedir, 'recipes', recipe, '%s_%s.bb' % (recipe, version)) + self.assertExists(newrecipefile, 'Recipe file should exist after upgrade') + # Check recipe got changed as expected + with open(oldrecipefile + '.upgraded', 'r') as f: + desiredlines = f.readlines() + with open(newrecipefile, 'r') as f: + newlines = f.readlines() + self.assertEqual(desiredlines, newlines) + def test_devtool_layer_plugins(self): """Test that devtool can use plugins from other layers. diff --git a/scripts/lib/devtool/upgrade.py b/scripts/lib/devtool/upgrade.py index 10827a762b..a98370bc10 100644 --- a/scripts/lib/devtool/upgrade.py +++ b/scripts/lib/devtool/upgrade.py @@ -192,8 +192,7 @@ def _extract_new_source(newpv, srctree, no_patch, srcrev, srcbranch, branch, kee __run('git submodule foreach \'git tag -f devtool-base-new\'') (stdout, _) = __run('git submodule --quiet foreach \'echo $sm_path\'') paths += [os.path.join(srctree, p) for p in stdout.splitlines()] - md5 = None - sha256 = None + checksums = {} _, _, _, _, _, params = bb.fetch2.decodeurl(uri) srcsubdir_rel = params.get('destsuffix', 'git') if not srcbranch: @@ -226,9 +225,6 @@ def _extract_new_source(newpv, srctree, no_patch, srcrev, srcbranch, branch, kee if ftmpdir and keep_temp: logger.info('Fetch temp directory is %s' % ftmpdir) - md5 = checksums['md5sum'] - sha256 = checksums['sha256sum'] - tmpsrctree = _get_srctree(tmpdir) srctree = os.path.abspath(srctree) srcsubdir_rel = os.path.relpath(tmpsrctree, tmpdir) @@ -297,7 +293,7 @@ def _extract_new_source(newpv, srctree, no_patch, srcrev, srcbranch, branch, kee if tmpdir != tmpsrctree: shutil.rmtree(tmpdir) - return (revs, md5, sha256, srcbranch, srcsubdir_rel) + return (revs, checksums, srcbranch, srcsubdir_rel) def _add_license_diff_to_recipe(path, diff): notice_text = """# FIXME: the LIC_FILES_CHKSUM values have been updated by 'devtool upgrade'. @@ -318,7 +314,7 @@ def _add_license_diff_to_recipe(path, diff): f.write("\n#\n\n".encode()) f.write(orig_content) -def _create_new_recipe(newpv, md5, sha256, srcrev, srcbranch, srcsubdir_old, srcsubdir_new, workspace, tinfoil, rd, license_diff, new_licenses, srctree, keep_failure): +def _create_new_recipe(newpv, checksums, srcrev, srcbranch, srcsubdir_old, srcsubdir_new, workspace, tinfoil, rd, license_diff, new_licenses, srctree, keep_failure): """Creates the new recipe under workspace""" bpn = rd.getVar('BPN') @@ -390,30 +386,39 @@ def _create_new_recipe(newpv, md5, sha256, srcrev, srcbranch, srcsubdir_old, src addnames.append(params['name']) # Find what's been set in the original recipe oldnames = [] + oldsums = [] noname = False for varflag in rd.getVarFlags('SRC_URI'): - if varflag.endswith(('.md5sum', '.sha256sum')): - name = varflag.rsplit('.', 1)[0] - if name not in oldnames: - oldnames.append(name) - elif varflag in ['md5sum', 'sha256sum']: - noname = True + for checksum in checksums: + if varflag.endswith('.' + checksum): + name = varflag.rsplit('.', 1)[0] + if name not in oldnames: + oldnames.append(name) + oldsums.append(checksum) + elif varflag == checksum: + noname = True + oldsums.append(checksum) # Even if SRC_URI has named entries it doesn't have to actually use the name if noname and addnames and addnames[0] not in oldnames: addnames = [] # Drop any old names (the name actually might include ${PV}) for name in oldnames: if name not in newnames: - newvalues['SRC_URI[%s.md5sum]' % name] = None - newvalues['SRC_URI[%s.sha256sum]' % name] = None + for checksum in oldsums: + newvalues['SRC_URI[%s.%s]' % (name, checksum)] = None - if sha256: - if addnames: - nameprefix = '%s.' % addnames[0] - else: - nameprefix = '' + nameprefix = '%s.' % addnames[0] if addnames else '' + + # md5sum is deprecated, remove any traces of it. If it was the only old + # checksum, then replace it with the default checksums. + if 'md5sum' in oldsums: newvalues['SRC_URI[%smd5sum]' % nameprefix] = None - newvalues['SRC_URI[%ssha256sum]' % nameprefix] = sha256 + oldsums.remove('md5sum') + if not oldsums: + oldsums = ["%ssum" % s for s in bb.fetch2.SHOWN_CHECKSUM_LIST] + + for checksum in oldsums: + newvalues['SRC_URI[%s%s]' % (nameprefix, checksum)] = checksums[checksum] if srcsubdir_new != srcsubdir_old: s_subdir_old = os.path.relpath(os.path.abspath(rd.getVar('S')), rd.getVar('WORKDIR')) @@ -571,12 +576,12 @@ def upgrade(args, config, basepath, workspace): rev1, srcsubdir1 = standard._extract_source(srctree, False, 'devtool-orig', False, config, basepath, workspace, args.fixed_setup, rd, tinfoil, no_overrides=args.no_overrides) old_licenses = _extract_licenses(srctree_s, (rd.getVar('LIC_FILES_CHKSUM') or "")) logger.info('Extracting upgraded version source...') - rev2, md5, sha256, srcbranch, srcsubdir2 = _extract_new_source(args.version, srctree, args.no_patch, + rev2, checksums, srcbranch, srcsubdir2 = _extract_new_source(args.version, srctree, args.no_patch, args.srcrev, args.srcbranch, args.branch, args.keep_temp, tinfoil, rd) new_licenses = _extract_licenses(srctree_s, (rd.getVar('LIC_FILES_CHKSUM') or "")) license_diff = _generate_license_diff(old_licenses, new_licenses) - rf, copied = _create_new_recipe(args.version, md5, sha256, args.srcrev, srcbranch, srcsubdir1, srcsubdir2, config.workspace_path, tinfoil, rd, license_diff, new_licenses, srctree, args.keep_failure) + rf, copied = _create_new_recipe(args.version, checksums, args.srcrev, srcbranch, srcsubdir1, srcsubdir2, config.workspace_path, tinfoil, rd, license_diff, new_licenses, srctree, args.keep_failure) except (bb.process.CmdError, DevtoolError) as e: recipedir = os.path.join(config.workspace_path, 'recipes', rd.getVar('BPN')) _upgrade_error(e, recipedir, srctree, args.keep_failure) From patchwork Wed Dec 6 19:22:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Kjellerstedt X-Patchwork-Id: 35799 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 26B97C10DCE for ; Wed, 6 Dec 2023 19:22:40 +0000 (UTC) Received: from EUR01-DB5-obe.outbound.protection.outlook.com (EUR01-DB5-obe.outbound.protection.outlook.com [40.107.15.79]) by mx.groups.io with SMTP id smtpd.web11.41996.1701890559233776191 for ; Wed, 06 Dec 2023 11:22:39 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@axis.com header.s=selector1 header.b=Z+WxvRZJ; spf=pass (domain: axis.com, ip: 40.107.15.79, mailfrom: peter.kjellerstedt@axis.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aBRpO6T7u+QDk/KzmLU6i0/lSt45/61sFehNUvu33zOoJTVdJw4dqzz7qv8yBD1WnizKTeexrsCyi4othuHBdCSkKuTVxhGcxt7qsD9BImzvK1Cey8mLVTAuB+ltVp4dE6CzjaLj2V5HROaZhLeF6joqNXrmYH/I/5jgkWu2+/SykGGzYpOeImW1nZZdVlbDwIonGrF7FiO4aER9W1PgdPKDAveQ8rOaNBOOgTBZURySy+21uUeLjkDF976IrX3v6PIAu9az8Tlu+iFbzqYK5zWsx7piDzqTtU9v+P0LTdV2HgPmwvTMOiFdc0DL82EMw8EtTfYAIxsMtlTrlxxK7w== 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=QjgM1auMgtGcX+tMjlp1yHFTVHmMVFipfVBFyzlQs00=; b=FdlJpAwC1jz1oA/8GHIZEM+RW0f6J0H9roN/uIaKGRGgeIxQPph0VbWUYULXHGqw+LHg0LP2L/Grex7gJ61NmvXf/Cv+UIoAVOs5kX0OzpQBd7FcbHAEA6LC9IySqF/4E7wm4hoR/TrJV6wlQWUXmp6GaGB69nYBhMDmLBWMNR/cPQzDk94FMAY0ZmQMZZwV1dEuXb/5oPQ8rDROG2so9cbv+IfGCIh5qXcngbQJkQaziSyFYc3tCbLP/Lw7/255qKiEmpen9VxtFXe3J0TyiEERLRCyXuqBPyGJdzAXazT1e4X0TpWwz1+S4E9w0fv0P9NQ0iObaUKjIk5C41q9cg== 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=QjgM1auMgtGcX+tMjlp1yHFTVHmMVFipfVBFyzlQs00=; b=Z+WxvRZJPOnWP9qdM8TyJg7SG/NrZ0m8ry2XcN4hCwnQas21S+VOAH2Z19hJYzHV5cmJGebOXpd37qD6PB33n6BRiEyezKzsoXpDL/5OfM9HYuNE1OFLTCfexCLGehAOMkL3givWWGrmfRsb4rBusuaQj5V25212NMcT9XrzZ+k= Received: from DB7PR02CA0003.eurprd02.prod.outlook.com (2603:10a6:10:52::16) by AM7PR02MB6161.eurprd02.prod.outlook.com (2603:10a6:20b:1af::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.25; Wed, 6 Dec 2023 19:22:36 +0000 Received: from DU6PEPF0000B621.eurprd02.prod.outlook.com (2603:10a6:10:52:cafe::3a) by DB7PR02CA0003.outlook.office365.com (2603:10a6:10:52::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.34 via Frontend Transport; Wed, 6 Dec 2023 19:22:36 +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 DU6PEPF0000B621.mail.protection.outlook.com (10.167.8.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7068.20 via Frontend Transport; Wed, 6 Dec 2023 19:22:36 +0000 Received: from se-mail01w.axis.com (10.20.40.7) 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; Wed, 6 Dec 2023 20:22:33 +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; Wed, 6 Dec 2023 20:22:33 +0100 Received: from saur (saur.se.axis.com [10.92.3.10]) by se-intmail01x.se.axis.com (Postfix) with ESMTP id 7B6A8F5C4 for ; Wed, 6 Dec 2023 20:22:33 +0100 (CET) Received: from saur.se.axis.com (localhost [127.0.0.1]) by saur (8.17.1/8.15.2) with ESMTPS id 3B6JMXI72838211 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Wed, 6 Dec 2023 20:22:33 +0100 Received: (from pkj@localhost) by saur.se.axis.com (8.17.1/8.17.1/Submit) id 3B6JMXmT2838210 for openembedded-core@lists.openembedded.org; Wed, 6 Dec 2023 20:22:33 +0100 From: Peter Kjellerstedt To: Subject: [PATCH 9/9] devtool: modify: Make --no-extract work again Date: Wed, 6 Dec 2023 20:22:07 +0100 Message-ID: <20231206192207.2838077-10-pkj@axis.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231206192207.2838077-1-pkj@axis.com> References: <20231206192207.2838077-1-pkj@axis.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU6PEPF0000B621:EE_|AM7PR02MB6161:EE_ X-MS-Office365-Filtering-Correlation-Id: 4e4a2a7a-d4df-4bd4-84d0-08dbf690b422 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gTcjICCaismAwRUAjifviSHo1ZyiG6YbEH0dLtpqgn8TuIcXsjnLiK5+QgviBLoMgImeX8z2K+/aAePi8QdJgoQKCjXC2sQp4rWqjow6O/yXgJtQugsM5QfR4/aHZw1U+380p6tubpNti+bpE6S8p/EVVbuPJIGy6ywcIQiGBag4nQgBrIhZJRt2FIuxi42RIBPJ6bVsOllJWtbtVN5TlfzO/UFnMH7ULlQSBx2QTKeJauqtr5t0admt1RANTcdDE4pKdJfXTZsotmqI9x+hQTpNRIA83AY1uvK1OTuxo+dKAXwpMj1u0RemcvBpiEFxZfp3IbsDIk1r4ybOSg5A43JKcWddef5HVOJJy+dg5ZEMU5/bW7Y7bgAfDfKyMaKrhfYqMwFfrYA1JVKyJLpcM0o6xh12BZy/Xv8qvGdT4rd9YFaOxlj3yQToyqhbS2vzG+Pd+P/LEwVotErkRjb0A5/SegMvV/rzaHVUEb0ySQQJlnOSkyujv+uuzfXOjD8yvqNWZUwafXD3hp2eqx5nlkydzzi2s3cq7EdWgh6MpHZM9aqEkVbr/7dhRiFL86x/q7F7LuGVQWp3pcPh8G1Cofk0m5KZIV9dfqBSRKWnnqlLMmOPtCG/9oCNrBzUGZ398uC1bXIYbxmT1gYapFqNorZGjo9Fw1NhgtZFuYEU8UJsm9CvZacDEGA9VeZp+okJfH/8RIMrEku3ObRoGn3MheNEAItf+6/cnakzyktwRi0b3tccTZVNhtO2jJ5HzSDxett3vwZA3f0iNTMjWRbl9Q== 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)(396003)(346002)(39850400004)(376002)(230922051799003)(1800799012)(64100799003)(451199024)(82310400011)(186009)(40470700004)(46966006)(36840700001)(36860700001)(2906002)(26005)(426003)(83380400001)(336012)(356005)(40460700003)(82740400003)(81166007)(47076005)(40480700001)(36756003)(6666004)(5660300002)(2616005)(1076003)(8676002)(8936002)(41300700001)(478600001)(42186006)(316002)(70586007)(70206006)(6916009)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: axis.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Dec 2023 19:22:36.0316 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4e4a2a7a-d4df-4bd4-84d0-08dbf690b422 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: DU6PEPF0000B621.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR02MB6161 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 ; Wed, 06 Dec 2023 19:22:40 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/191915 This avoids the following error when using --no-extract, introduced in commit 900129cbdf (devtool: add support for git submodules): Traceback (most recent call last): File ".../scripts/devtool", line 349, in ret = main() File ".../scripts/devtool", line 336, in main ret = args.func(args, config, basepath, workspace) File ".../scripts/lib/devtool/standard.py", line 995, in modify for commit in commits[name]: KeyError: '.' Signed-off-by: Peter Kjellerstedt --- scripts/lib/devtool/standard.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py index ad6e346279..5b7ea6b886 100644 --- a/scripts/lib/devtool/standard.py +++ b/scripts/lib/devtool/standard.py @@ -991,7 +991,8 @@ def modify(args, config, basepath, workspace): '}\n') if initial_revs: for name, rev in initial_revs.items(): - f.write('\n# initial_rev %s: %s\n' % (name, rev)) + f.write('\n# initial_rev %s: %s\n' % (name, rev)) + if name in commits: for commit in commits[name]: f.write('# commit %s: %s\n' % (name, commit)) if branch_patches: