From patchwork Wed Dec 6 20:55:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Kjellerstedt X-Patchwork-Id: 35811 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 F0DE3C4167B for ; Wed, 6 Dec 2023 20:55:50 +0000 (UTC) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (EUR05-AM6-obe.outbound.protection.outlook.com [40.107.22.52]) by mx.groups.io with SMTP id smtpd.web10.45018.1701896147962766295 for ; Wed, 06 Dec 2023 12:55:48 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@axis.com header.s=selector1 header.b=oP74SnNT; spf=pass (domain: axis.com, ip: 40.107.22.52, mailfrom: peter.kjellerstedt@axis.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hLoYxuCxMDxxwuqNhC/abVHMLHCb/Ub7XJrf4CgbBEKh9zOa0oPOJWm5dnQk4XzqZXJ4ZkDsOGqMowDkFw/nNajYJC6N+GtRFQjxRi/fqCa8BgJMGBGsy1XOkvIWZjIZQ3Zu55blk/IuwC0327zX3Nto4HtN1MLJ8gZK94zjfCGZ1mPqUpxedxbn8w/OSXdAP0W5bblYf9SromyIFT1OZm/X3NGfnESbn7QMrgHSkhSwUXuZw1gSesdX5woVASFC4l37VYLtHiQWFI6fOlDlLP8elv3N7GPTc6PpLcR71YsjsPJxj6uuoSuSIUcnUAHeE6lAmIDdCuf+hwcuyf8mHQ== 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=TOsKwlXowKzIF48Qw9CqCYRd5zVw9ynAq1GdRJn2jM0GxWQCczTAo4mzOXz9MNPLHRTuopa+kgLbrDUdV9HU54IdFf43BxOHTRqbaZrutaeIYfejhqum2fVLlcuzfi/ZpjuRyYD+R0R/MEjbYFjsl4xSEb+qFHlQjqY2aNX/yUxy8vK+5XghLxP6CCewo2fKm/mTNY2o2D2BIKTloy12nGUWG3rmrGXnGR2nrkQmYSGe/8Cd14bR1sceBNBGqqfGJVjNzgpVpD3ZzwoaV7/frVUurALTPgOQVeFWE39KfYKgMJ373w95PWTWXUc5BeMKva+i3zv0cogtz7ILJwnQ5w== 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=oP74SnNTjLUbCq/7K/3gGP0++dBKB53leUeH3hLLWGeiVuX7g6an3OEIJUgbyaRbPuwguP124NHXK+IX3Heu+XaQyfZuPk2EpRM9gJ/35SdZsLPTng3xj3EzV3rEKGIma/hktF1Awq6uAV+tDXOEkleLn8Ul+/AvNL9psNHk/hM= Received: from AM0PR02CA0120.eurprd02.prod.outlook.com (2603:10a6:20b:28c::17) by AM0PR02MB5923.eurprd02.prod.outlook.com (2603:10a6:208:187::17) 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 20:55:45 +0000 Received: from AMS1EPF00000041.eurprd04.prod.outlook.com (2603:10a6:20b:28c:cafe::79) by AM0PR02CA0120.outlook.office365.com (2603:10a6:20b:28c::17) 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 20:55:45 +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 AMS1EPF00000041.mail.protection.outlook.com (10.167.16.38) 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 20:55:44 +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 21:55:44 +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 21:55:44 +0100 Received: from saur (saur.se.axis.com [10.92.3.10]) by se-intmail01x.se.axis.com (Postfix) with ESMTP id F3489F689 for ; Wed, 6 Dec 2023 21:55:43 +0100 (CET) Received: from saur.se.axis.com (localhost [127.0.0.1]) by saur (8.17.1/8.15.2) with ESMTPS id 3B6Kthwn4037589 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Wed, 6 Dec 2023 21:55:44 +0100 Received: (from pkj@localhost) by saur.se.axis.com (8.17.1/8.17.1/Submit) id 3B6KthUc4037588 for openembedded-core@lists.openembedded.org; Wed, 6 Dec 2023 21:55:43 +0100 From: Peter Kjellerstedt To: Subject: [PATCHv2 1/9] oeqa/selftest/devtool: Correct git clone of local repository Date: Wed, 6 Dec 2023 21:55:23 +0100 Message-ID: <20231206205531.4037549-2-pkj@axis.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231206205531.4037549-1-pkj@axis.com> References: <20231206205531.4037549-1-pkj@axis.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AMS1EPF00000041:EE_|AM0PR02MB5923:EE_ X-MS-Office365-Filtering-Correlation-Id: 28f33c4a-c860-4a78-e4d8-08dbf69db70f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fuXHWPohccGHgKCaVailiEhqspBsY4sTEYQw3eUOl4bdXjk3RmgVDG2UpAekwzDytmsS5bWKAF8plOBGYAueLdqk6WqsZd3m8HLh52neGv8a0hRl2W9lufmL087PB++hPsSNIpPpl6buI8Yiiye1HTM928l/Zh7xHM1eS6bq4MBECqLJjR+J5yMHZueODWmt2zJQSian7QiouCWT1C8SUEk80TEaJvjWL0SL/R5RIKlj+HE53fmFYWbYyvXJPLlGpGYld/NPDKBFg8ZvDo6JjcxKCaZPKEnYtKpRdkkH6eX2i775z7misP6YuOEoJAClkqZ/uhqiGl0C572VBl1zkWqW6EFvCN6KeCeql4GNohnGmTn2G2llP1hEMGJT/PVUdIicTOLhtmQZfdET586Ecje5RMOE6xzB1QNqu16c2KVmBJmsFcV4X3KK79SgrrTDrwONv0brasH5YDWDbog0O0YPIP7Zj0oQP0aZ/QDnETTwKP4w9y6m8XPkhN9YGo7cV6yeh9Q17jAYiLRXeyR4jgLa5ghCzHKpTDRZy8Eix4vY+tU6BQ4NSOnvWEzWc9LqHqtVnR3Wr1X6nEQXudp3HAg/ejQNHjbxxPE2yAYU/fbfOuYDAkKJw23neYxeY7VUg6tFq+EncJ6RDokDolO2zOkUnsfrH7ON11QtK0ucG5ecv1teUdmyEwgvo/ehfzRpcjDDnRvjuzs+cTqWa1uPfO4zaJ0VkkJx6oW7eM2ip2H6yvPHCBrRDQxT1JQHhaNdXl2WCgy/XFENU0L790sB7w== X-Forefront-Antispam-Report: CIP:195.60.68.100;CTRY:SE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.axis.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(4636009)(39860400002)(376002)(346002)(396003)(136003)(230922051799003)(451199024)(186009)(82310400011)(1800799012)(64100799003)(40470700004)(36840700001)(46966006)(478600001)(5660300002)(40460700003)(6666004)(6916009)(316002)(8676002)(8936002)(42186006)(70206006)(70586007)(82740400003)(47076005)(36860700001)(356005)(81166007)(426003)(40480700001)(83380400001)(41300700001)(36756003)(1076003)(2616005)(2906002)(336012)(26005)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: axis.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Dec 2023 20:55:44.4315 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 28f33c4a-c860-4a78-e4d8-08dbf69db70f 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: AMS1EPF00000041.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR02MB5923 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 20:55:50 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/191923 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 20:55:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Kjellerstedt X-Patchwork-Id: 35813 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 F22AEC10DCE for ; Wed, 6 Dec 2023 20:55:50 +0000 (UTC) Received: from EUR04-VI1-obe.outbound.protection.outlook.com (EUR04-VI1-obe.outbound.protection.outlook.com [40.107.8.43]) by mx.groups.io with SMTP id smtpd.web10.45019.1701896148265155970 for ; Wed, 06 Dec 2023 12:55:48 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@axis.com header.s=selector1 header.b=oav28foX; spf=pass (domain: axis.com, ip: 40.107.8.43, mailfrom: peter.kjellerstedt@axis.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=b31uL4aHwrxHuJjNzMTUi0cBp9YX6FcAhnCZ8+F5brVkxivmxq8OzBZFMt7cly5FmAYD9sdI4YqKFLmSZZCXLH0Mn6neMlU9AxjNgzvRXy23EZDiPFM3ayiaKHv3y70DdFKBJBmg5qoB376hgI7rIMtFuKoxujJx1ImxrGGSaE60mvdy625/saxAGNaYjiLUjBeFMEe0FhQla9bPlSQtjqB/AEjFovKZAFgZnbbmgt+7w4y3Y+G9+oWn/h2SHT73MVPe2M4sd3V4uu4nh8NOFzD1t4jfGZYPbjeR99W5LqPu3GBWwXam4GAymqQg2YZUU0+kgC5hSPZLZYNxysQ7hg== 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=bK75FWnBlc6cLUNiatNQec95ah7xDE8PRlWmmvqTebwUbvQsZyJWeXrwkruauNfLWEEAJ55GIMy0WaKDCS39Y7vNnfBMxMTIZpXnIKmyjplLfhYeDbUy3nI1SRkj5gSwhJYpkom7DOt0dqwL3GOdw/E2nXDiXceDgQdn4n4nuMC/cdJDrKD3ld4/5B7GJYSUKXx7hIF8DCd+P03xEpuW6h7789yhh/a1+sZ5hwZcdJXCh2FnVoPxtRSvKSefEgg7jzD5stSApKrN52/4xnJhS95c44aqajb7KhFUVtgo7SiCKaMxB4tKuAMimHlQVfI+idV9Ud9B/ncwds+ZAP0ELg== 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=oav28foXycYxrzdXdUGZ9FXyiaz0ewQ82jtUc2xO3jwfn/+24i2BqJyBmXpStkVqqOQbp98rTzqZgydmHXCKKt13wGw54MQGarwg1XjPLEOzMvDauC2J2Q8sZLKWQ2hiuzWuaBAGGo5H+4mcfD5EtKoRgRsLByTv4yrSvkWYGHU= Received: from DB8P191CA0015.EURP191.PROD.OUTLOOK.COM (2603:10a6:10:130::25) by DBBPR02MB10824.eurprd02.prod.outlook.com (2603:10a6:10:52e::17) 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 20:55:45 +0000 Received: from DB5PEPF00014B97.eurprd02.prod.outlook.com (2603:10a6:10:130:cafe::97) by DB8P191CA0015.outlook.office365.com (2603:10a6:10:130::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.33 via Frontend Transport; Wed, 6 Dec 2023 20:55:45 +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 DB5PEPF00014B97.mail.protection.outlook.com (10.167.8.235) 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 20:55:44 +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 21:55:44 +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 21:55:44 +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 21:55:44 +0100 Received: from saur (saur.se.axis.com [10.92.3.10]) by se-intmail01x.se.axis.com (Postfix) with ESMTP id 1CC62F686 for ; Wed, 6 Dec 2023 21:55:44 +0100 (CET) Received: from saur.se.axis.com (localhost [127.0.0.1]) by saur (8.17.1/8.15.2) with ESMTPS id 3B6Ktijd4037593 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Wed, 6 Dec 2023 21:55:44 +0100 Received: (from pkj@localhost) by saur.se.axis.com (8.17.1/8.17.1/Submit) id 3B6Kti5n4037592 for openembedded-core@lists.openembedded.org; Wed, 6 Dec 2023 21:55:44 +0100 From: Peter Kjellerstedt To: Subject: [PATCHv2 2/9] oeqa/selftest/devtool: Avoid global Git hooks when amending a patch Date: Wed, 6 Dec 2023 21:55:24 +0100 Message-ID: <20231206205531.4037549-3-pkj@axis.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231206205531.4037549-1-pkj@axis.com> References: <20231206205531.4037549-1-pkj@axis.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB5PEPF00014B97:EE_|DBBPR02MB10824:EE_ X-MS-Office365-Filtering-Correlation-Id: ee579bd0-a37e-41c6-d6ef-08dbf69db750 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ie6exkfVFzyNfA0tXDmr+Pnzp1VC54mhP9aVx3LcT2XTPrhT01IG0ni0IyY8dcNxQlkJxeH6iuVWydzcrC/BQbYmHNA2+pDrKZPqs9rLFo/NUbS/p50xr/L5RX4B3h4Jg2ZWyiUWePA+Pxmc2nPUKnJLCNoC4p5xkE/5jo+dg+N6I2fmCKMS/SLpmdoIFuF7zJktO5NlZF++0VfUaCqT1Hn7omA0k9c/oWNqa+mKCsmci+6dIZMKoYdUdKG6Z8Vz8evW9MY++4eNHjaRLXxTmI4/wlhons5gJKGs0qQJMngi4CUWvWxy/h1ex2L6IVxa4hvDQaDpZ3bd0W8hzLvL3ZKIzLHrqNZqwqzXs2paSx+wdlgQ1M7FN2uWmkMh01lcOF9K9CaHf/WLfZY9CbOIyxx7XNVfkdLIRp3FEBjCGFDg5he6fzninTTUMwpUBpvb8kp1ZjplBpGM5mAgXK0dKyCFWqIkp/OrFkRGmFpu/5ZpfL45uLiiAjWsC6r441hSUE+EhDsN90wwmwl18OFiRMB4hNVj+LOaFPXkLobjqGn/AIUa6YN1JURtGo7Hg5t0XTHAZ3IPI7RE5Tqn0F+jKI+Cb47tmVBhWtWcefpLek7kPHI7QdF8VbMtlaDswxp30VLSnxX8KFDKlY+AZBA+LbT14Rs2JrogenzQSqG1+Lr9Pm98DBKNscr9oCDl/gbII8vEiZtBrxo+Sc6wQa4Xb4oEBVO3eA4w9p4SNNEv0T1gsJ2/CXwtSQ5BI6+/ushyjVcx/vF70z+tM9KRfYjkIQ== X-Forefront-Antispam-Report: CIP:195.60.68.100;CTRY:SE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.axis.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(4636009)(39860400002)(376002)(396003)(136003)(346002)(230922051799003)(186009)(64100799003)(82310400011)(451199024)(1800799012)(46966006)(36840700001)(40470700004)(356005)(81166007)(40480700001)(40460700003)(47076005)(82740400003)(8936002)(8676002)(316002)(6666004)(70586007)(6916009)(70206006)(42186006)(26005)(5660300002)(2616005)(478600001)(2906002)(1076003)(36860700001)(426003)(36756003)(336012)(41300700001)(83380400001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: axis.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Dec 2023 20:55:44.8258 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ee579bd0-a37e-41c6-d6ef-08dbf69db750 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: DB5PEPF00014B97.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR02MB10824 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 20:55:50 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/191924 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 20:55:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Kjellerstedt X-Patchwork-Id: 35816 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 1B6B2C10F09 for ; Wed, 6 Dec 2023 20:55:51 +0000 (UTC) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (EUR05-AM6-obe.outbound.protection.outlook.com [40.107.22.52]) by mx.groups.io with SMTP id smtpd.web11.44678.1701896149839993140 for ; Wed, 06 Dec 2023 12:55:50 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@axis.com header.s=selector1 header.b=VpraMSn0; spf=pass (domain: axis.com, ip: 40.107.22.52, mailfrom: peter.kjellerstedt@axis.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FVkS8OLWZ0+wyFF7vbhtbb3obq5bQHM4FU92AXOxW560BLFc5aMhaPMrgB+s37tODNIltLpEGmik2bWzxv9SJbnUZ1mYDtGZE+RKvKIL25Y2Hy+FwnBqHtVPiyprTqPc2U9ySfkeaYc+gGWgi3nyzjwznpvHqn72XCSaeR1/mu8nITAaIWrhdGr3CXtL4iteL2KgNyKAuvAivRQG9voWrQTsG9gXj4/q9/tltMjzXWX8z09QL0nNsz5WIW9buI7ULuCp/vltGF/Of1O6qG3a+RbYIh9/od1CZd1hcppw2ZrU8FPmJluzmYSeehJSPMKPTXThcXqUgJJxV0qtqCaufQ== 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=d/S3DtOVKDiDXYlMaeaIlVcujsbe5khV4ooLdRvRsIiPRt/kTPLqRC3Spn0b4zqdMsEAX8UYSjt+0SR4kHq8ho8AX+51JljbN78weqdF3t7Rt4U7W7tfhsyS9B0FSPZ8koGOF2cAIjGSMpG9qfwuA6Y4uipVO+O/XQe5CnUC2z5JKLpOs6ov90DA7MFdP2QnuKja/xYrrsFxPxT0ZNKU0yXfuTRvOoMaYWFcvUGpYA/zpKvMHNNGzPbh+xJzAu6A0ltxNKBvgnjEMLio3y2Jzy3UOsz4JiX4WnUXmcisMVmErgZDWptnMznfXYWx7r0pYruOtwQjKsMoCDbD24UrZQ== 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=VpraMSn0Y4vP6a1i7mRuUnRIZZv+Ra45Lgg3BC41PL9ddCyy++qZNo8T+QUTMKr/JX9QKmPbFPclHKTlbqzXjpRwim8M8dnuUioRd3rz44hK7bY4Doig1jP4/dSowCpzjHtxMBsSvE6xv2mXzjSlbIUD1qAtwydI8Vgvb2/w5D4= Received: from AM0PR02CA0124.eurprd02.prod.outlook.com (2603:10a6:20b:28c::21) by VI1PR02MB5902.eurprd02.prod.outlook.com (2603:10a6:803:12e::19) 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 20:55:46 +0000 Received: from AMS1EPF00000041.eurprd04.prod.outlook.com (2603:10a6:20b:28c:cafe::d4) by AM0PR02CA0124.outlook.office365.com (2603:10a6:20b:28c::21) 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 20:55:46 +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 AMS1EPF00000041.mail.protection.outlook.com (10.167.16.38) 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 20:55:46 +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 21:55:44 +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 21:55:44 +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 21:55:44 +0100 Received: from saur (saur.se.axis.com [10.92.3.10]) by se-intmail01x.se.axis.com (Postfix) with ESMTP id 3D2D0F689 for ; Wed, 6 Dec 2023 21:55:44 +0100 (CET) Received: from saur.se.axis.com (localhost [127.0.0.1]) by saur (8.17.1/8.15.2) with ESMTPS id 3B6Kti6I4037597 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Wed, 6 Dec 2023 21:55:44 +0100 Received: (from pkj@localhost) by saur.se.axis.com (8.17.1/8.17.1/Submit) id 3B6KtiGv4037596 for openembedded-core@lists.openembedded.org; Wed, 6 Dec 2023 21:55:44 +0100 From: Peter Kjellerstedt To: Subject: [PATCHv2 3/9] oeqa/selftest/devtool: Make test_devtool_load_plugin more resilient Date: Wed, 6 Dec 2023 21:55:25 +0100 Message-ID: <20231206205531.4037549-4-pkj@axis.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231206205531.4037549-1-pkj@axis.com> References: <20231206205531.4037549-1-pkj@axis.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AMS1EPF00000041:EE_|VI1PR02MB5902:EE_ X-MS-Office365-Filtering-Correlation-Id: 02db9c98-36b7-42f4-88cd-08dbf69db837 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JBzGH3WyAFq4K007dCArUbRxhLiisQiclE8KlPSGiyGKlEeFYKzpvbYEOyjCgXTu++T5bG78/zj/LyPNUt4LGG9mRgOGXsRWc0EXLf21pzdhoIWxo+6Iwf9/H+Z26FcuFxaPybzssbNarJwq03OM+o2MizCeQJ4QrbsHOJYO/YkpydzHViumcY5Rr2SU1soXvmK7U0rDEDaNEL+h7Tb3PcB8kxjI5kNkI45jydW6SJeQb4aXyJL2meOuKQmfCCDAEjAqNPZmMBxEcMXdVDawNUcXpy6wpFuRI/FSWfzC95OyD2/coF4AM+1CKLMpSXT5MNAqwpjUaHbxC00QMv9tQXXERFe3ZA/OHRuI1+QWiRxIUQnYU2xonh1TSTCV8PgHaZULusdYiekQiBAg25XJMGs91Dw7+Xy6tS79ysQL/0rY9/0f1cgwUhMhNNHDtDYobxgJvefoYFvBzWhBsebCpiSQmnTErNGVImWx40RmN7MsK1XwFWZxHrHTd+fEjpC29klwgFLbdnX/q+Vud983+4Bw83USD0Fu/n1lX8dw0Terk4j3ckF5TbgAu0E4bSmbSkYWVetzZ4ZurnIDWZvRFL5NHhiS4OfrgHfif+H/o0IbXNECW2KV3FfsmE0+Om9yo+nuw0xoLE4gj82mJF3++2V+2bB33ZAbk3pxrhpO5e/HdRO14l5aG3P4UCHPvDgngh4rLaOiJCnL/67aBBqwRAnDPqN6GxR8bN2Mk3oUcXURnmVtfgqm+hmFIF97DB00CB6zrh0rQOD62RrHj6MJLA== 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)(376002)(346002)(39850400004)(136003)(230922051799003)(186009)(82310400011)(1800799012)(451199024)(64100799003)(40470700004)(46966006)(36840700001)(40460700003)(8676002)(8936002)(426003)(6916009)(42186006)(336012)(83380400001)(316002)(70206006)(70586007)(1076003)(5660300002)(2906002)(47076005)(36860700001)(6666004)(478600001)(26005)(2616005)(356005)(41300700001)(40480700001)(81166007)(82740400003)(36756003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: axis.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Dec 2023 20:55:46.3690 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 02db9c98-36b7-42f4-88cd-08dbf69db837 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: AMS1EPF00000041.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR02MB5902 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 20:55:51 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/191927 * 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 20:55:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Kjellerstedt X-Patchwork-Id: 35814 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 0A4E2C10DC1 for ; Wed, 6 Dec 2023 20:55:51 +0000 (UTC) Received: from EUR01-DB5-obe.outbound.protection.outlook.com (EUR01-DB5-obe.outbound.protection.outlook.com [40.107.15.44]) by mx.groups.io with SMTP id smtpd.web11.44675.1701896148262301517 for ; Wed, 06 Dec 2023 12:55:49 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@axis.com header.s=selector1 header.b=lX6A3BjH; spf=pass (domain: axis.com, ip: 40.107.15.44, mailfrom: peter.kjellerstedt@axis.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nUrXOgOJQdQiPHQZBAERXO2IihftGn0S89WcqbP7pz5sWHfDg3xVN2JWl/8Zg7dyiehcHmMHKa9ZL/pPk/CDbX+QO+/GOdlOemy/RiRtQ6U2mLbqCROAyHSZ+xsoa68ZXD0lp05KpKYLhVJycBVlzEQOAajXIplmCbhpICmeE/LLxdnJhvX6wXJfZxeNTc8SaEfcyjJysBNAWqUee8AyxQsX2iQ5ftxDPSzhqvVpS0eHecKr8kHy1JOHh9SH42pEgYgAMUe1ubutwFSg2bGg49IpUEe4b6Pis63kfDwDXjtiJ7snOC1K48XBXxe7MVrBdCgZNfrv9PGOYnHSZPOTCg== 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=VclwHF2YTdLjteCXxsjO0t7xPsm2kc05Cr6vgstd3V2/NFpK2kfEs5Ppm99AqCkjmsHhfUCO19EdfcilUhBg2/TvIhxpEe0r7P418pahFwv3ro/qaGIc0GRrodkIHen0Vc5VQU/UMCNyPcToTpRMKwi01iKidmecM0E/FmkkLIBIbsEjVq9/UJJxW+8UtnFCtCO4YVR8hKLF0SQtVjZOO+A1V79gF6i1ftQxUNz4PxOLNOvYhZ6YedIMEias2zm9VbmpCJXnj2YpGhIFZ9wuGVr0uS9ob3uTM8qfjU5B6VU3BzdWkeYSqzSQz8yf5TwAZgiWZYPeNK6iPmChoUwSMA== 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=lX6A3BjHXo5Izpq8mlsk/7nZBwWBLfWPf9hTJF7WqaBfCH7+NM5AYEqwC3Opqtwk6GKXnHdXTN6I03Rim3nQs3z9eic2nstTBWVV4Eune4xiRm4nR5wDOCWiyFum4kIuU5xP+3/SnsqurbJsV8Lf6dFIs9Yo5MNXH61WrPVxtVA= Received: from DB8P191CA0005.EURP191.PROD.OUTLOOK.COM (2603:10a6:10:130::15) by DU0PR02MB9516.eurprd02.prod.outlook.com (2603:10a6:10:41f::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 20:55:45 +0000 Received: from DB5PEPF00014B97.eurprd02.prod.outlook.com (2603:10a6:10:130:cafe::56) by DB8P191CA0005.outlook.office365.com (2603:10a6:10:130::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 20:55:45 +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 DB5PEPF00014B97.mail.protection.outlook.com (10.167.8.235) 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 20:55:45 +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 21:55:44 +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 21:55:44 +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 21:55:44 +0100 Received: from saur (saur.se.axis.com [10.92.3.10]) by se-intmail01x.se.axis.com (Postfix) with ESMTP id 615BBF686 for ; Wed, 6 Dec 2023 21:55:44 +0100 (CET) Received: from saur.se.axis.com (localhost [127.0.0.1]) by saur (8.17.1/8.15.2) with ESMTPS id 3B6Ktict4037601 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Wed, 6 Dec 2023 21:55:44 +0100 Received: (from pkj@localhost) by saur.se.axis.com (8.17.1/8.17.1/Submit) id 3B6KtioA4037600 for openembedded-core@lists.openembedded.org; Wed, 6 Dec 2023 21:55:44 +0100 From: Peter Kjellerstedt To: Subject: [PATCHv2 4/9] oeqa/selftest/recipetool: Make test_recipetool_load_plugin more resilient Date: Wed, 6 Dec 2023 21:55:26 +0100 Message-ID: <20231206205531.4037549-5-pkj@axis.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231206205531.4037549-1-pkj@axis.com> References: <20231206205531.4037549-1-pkj@axis.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB5PEPF00014B97:EE_|DU0PR02MB9516:EE_ X-MS-Office365-Filtering-Correlation-Id: d717a7de-0e0d-461e-fca7-08dbf69db7b4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uHRrWQbjK/1W0/b1G1909+gdn8i30aBIdZfBfS/bo+xNy8K4xwdJKB6sHAo/A17JDcAHow11ucdxSqbQrNHvDlLmBU1GgAgZV1Pwfssaa8Z/budLWVG/92xLtYfE63CMvp0lvIr2g9OhPD/OyNAWjhuihPVByjCLeXjDiqlQE52bF8XCGos7kyX6NVU7VjMEX18nAIZpvA94hR3mpKWW11imYhDsNhT7Ay+CJBf48o3WOYLLnC5iy4K+idFc7qTKsQNawABHCDhZwxjUuddeJnXKiOAJ5Sft0S3XBZcVe+NnIvsgitYxVqvnrffip+WeOX9jMQ5CpzitPeCxQERQ6EytqnV0WnVwcCKoNnyidLA96PQdwbDFRrCaGBoVdNdLoBMtF9L18Sui+y/WkWdxvdQysHv7tgIP+uROUNoSpgyKDg/2WVmZcr3P0tpM3pwTZV2G8hdSIQhK5KpuG8F/HYXeBeRiW0Jz/A2hg26cIfv+bxUAHUtb5LoOe6RPCXIODnU2qY8tMMSNL1iXkDGI5pdLekAwI2Vhx5WnzLShLEPEJ3N92DSHuzoGUvkAvpQ3a3nklviiSWxd0LbZhel8fWb/Knm27TWi8+VDoY5e+YULkZOVLbpxudsS7Rqej4sDCD0b+VomSbwFNnMu3B1rFe474hICiKa+jJm8GHdCS4l8VgzwBeMG4fbZpZH8Gne9lZtNd25JsGE1Ef9Ftnev1RoPciNltxqupuhbgRWtyX4Xw6wv7vJVjAj3a27odeOtJ6HAaZg/U3WGi8SmjVb35g== 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)(376002)(396003)(346002)(230922051799003)(82310400011)(186009)(451199024)(64100799003)(1800799012)(40470700004)(36840700001)(46966006)(5660300002)(2906002)(6666004)(40460700003)(478600001)(8676002)(8936002)(6916009)(316002)(42186006)(70206006)(70586007)(83380400001)(82740400003)(36756003)(336012)(426003)(40480700001)(26005)(47076005)(81166007)(356005)(36860700001)(1076003)(41300700001)(2616005)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: axis.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Dec 2023 20:55:45.4821 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d717a7de-0e0d-461e-fca7-08dbf69db7b4 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: DB5PEPF00014B97.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR02MB9516 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 20:55:51 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/191925 * 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 20:55:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Kjellerstedt X-Patchwork-Id: 35815 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 24AB3C10F13 for ; Wed, 6 Dec 2023 20:55:51 +0000 (UTC) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (EUR05-DB8-obe.outbound.protection.outlook.com [40.107.20.74]) by mx.groups.io with SMTP id smtpd.web11.44681.1701896150322657068 for ; Wed, 06 Dec 2023 12:55:50 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@axis.com header.s=selector1 header.b=YIPMjLU1; spf=pass (domain: axis.com, ip: 40.107.20.74, mailfrom: peter.kjellerstedt@axis.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gxpuzUDdsRn4QN5aAj5glNHNiRRQzcHJiyO/nIcAV0hMo/S7GB5VIjUcGEtfqeb+YoTlqIoz051nOyndWpQ+9AfUKM3tYhB5hY9bzCEIyyLK3tLpukYGNGRwtL9WDTouam6F/9c325MJzILnBQ12ZRAJ0SYl5Fw1SVHCSbMqX/KXpMj6lT1q+WnjIIztUFkZSYKdl8CwiTkFbkXuvPXKfq7sDHmXXjobYYyDGUR96NIcB3y/mJDmBV2+iNOZl+n5C5ocOG/aYFKr8DGRpIFw+SQvf8XgCJPGcxaRDvsuLI3Be4y4cUnwwnVpSIFAkfr0eHBCU7x6mfb5KS/kjqPV3g== 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=Ahj44G9tsKS7NKookorwE6MHSsWYiQ7GBs/OUB5cXnrKO/4ldaTB2CYWNWLesGnqDbp/sBWk+qW/2rXFJOHo9fBNnxZSjYvFZFfh+HQDU1HvWxIVLOAkS0+99j4D7PtbV9mYi5Z20RLStHhJAG/d9/TJX3zh8giTK7TnMWH8YUrAvmxHZuhoOszG20kqCiww1mQC/44b6Xl7y8SOoSDRBPkqiCtZGoJnNKibBRPi81njwH3gUfQfzumDTY06R/ADY/FUywLcT3JPHkEdcuhcdV4LoZpTwsdOO+raBsj/I/J9cCvS+ZPdZ9Ra31andtyb6rEz/mJU6WT9WFBLeCDK+w== 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=YIPMjLU1EzL/7uc241sDYHOjSiCrzDARlHgTt/Q+51gIztgQexvxQD0XYWYzpARG9rDmIKcF6HCW2QP8/r/q9641O4Kzo8lc4hkgo6qm6KIM6OwONirTe5iZVRkzFTv7JPUk2efbO8TVLfvtKL3FJnAQ6SKhAp2WzJ2cN6JwNFE= Received: from DB8P191CA0023.EURP191.PROD.OUTLOOK.COM (2603:10a6:10:130::33) by GVXPR02MB10593.eurprd02.prod.outlook.com (2603:10a6:150:156::12) 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 20:55:46 +0000 Received: from DB5PEPF00014B97.eurprd02.prod.outlook.com (2603:10a6:10:130:cafe::55) by DB8P191CA0023.outlook.office365.com (2603:10a6:10:130::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.33 via Frontend Transport; Wed, 6 Dec 2023 20:55:45 +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 DB5PEPF00014B97.mail.protection.outlook.com (10.167.8.235) 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 20:55:45 +0000 Received: from SE-MAILARCH01W.axis.com (10.20.40.15) by se-mail01w.axis.com (10.20.40.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Wed, 6 Dec 2023 21:55:44 +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 21:55:44 +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 21:55:44 +0100 Received: from saur (saur.se.axis.com [10.92.3.10]) by se-intmail01x.se.axis.com (Postfix) with ESMTP id 82403F689 for ; Wed, 6 Dec 2023 21:55:44 +0100 (CET) Received: from saur.se.axis.com (localhost [127.0.0.1]) by saur (8.17.1/8.15.2) with ESMTPS id 3B6KtifK4037605 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Wed, 6 Dec 2023 21:55:44 +0100 Received: (from pkj@localhost) by saur.se.axis.com (8.17.1/8.17.1/Submit) id 3B6Kti7x4037604 for openembedded-core@lists.openembedded.org; Wed, 6 Dec 2023 21:55:44 +0100 From: Peter Kjellerstedt To: Subject: [PATCHv2 5/9] lib/oe/recipeutils: Avoid wrapping any SRC_URI[sha*sum] variables Date: Wed, 6 Dec 2023 21:55:27 +0100 Message-ID: <20231206205531.4037549-6-pkj@axis.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231206205531.4037549-1-pkj@axis.com> References: <20231206205531.4037549-1-pkj@axis.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB5PEPF00014B97:EE_|GVXPR02MB10593:EE_ X-MS-Office365-Filtering-Correlation-Id: 764d780f-dd79-4ad5-0b1f-08dbf69db7e7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TZltfN8kGfIQ1R+wsboFfEi8NsREF/jkb1l+tk8HjT0w+Gocgbgn+AV9NGP2z4lSwg1LjhJBmY9Bh4NuJ0qi7U9rGFXc9M92ojTji/GMBblHJHnysvMRfjQPZbAKHddqTa3auhWKdKSvMQQ/1lquLeJI5KCfAbl+rXXNkCzuAPkkU/4zck6tTt1cu0SIdaH0B9afniKxVra0PHBkj/1aXYjciVFzFcxPS/wkfmwyBKJ5EjI67Lj0jzQBt7727JHLDJTwOoCpmRU/IIfv2Etj18mh62yowJkzIMeDL/ysIF+APqeJGXJWZYlMZb7RyaR0AHRMYvvMQ8EM2PMF7gQHHhgLS+Lu/95cpqPpQN+zBcnJRPVZXfh1/AOmkXXEGRca1tlnWlxkMeugPGqAZe+434M0wheUCT4cnHNyyw5Pareu7H+O/cXj3pqo8TcxKhKtQhPgs3xFPl0sR1jv70dJEDbojl2Q3rlaej5kB/sR5suNOc03H2zUFtO3CqPotNhc+DOxz2ISnSZYGBd/wLP3SyDdQBybimNW+3jVIO3pm4njNXtZMDPClRWirOrTJS35ACbUWAovpN9d4MWROL72/zuEWt1+NoBYNAmmmR9jOOVF6L8+tVmGr0GDVu9M1yK4g8akolBnywugNDY9PzvHc2rt/jXC+NtQnbkj4V1lCPVme5087DgJf3ChgUUKK5tT1qUvv6SUfJsSNlMhMhLDGY1TsSyvDMJINB/8ndozcxZxOv6EMf8/plqFa2O2MSC2FmztCMN0YSK4QcQQH5fzeA== X-Forefront-Antispam-Report: CIP:195.60.68.100;CTRY:SE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.axis.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(4636009)(39860400002)(376002)(136003)(346002)(396003)(230922051799003)(451199024)(186009)(82310400011)(1800799012)(64100799003)(46966006)(36840700001)(40470700004)(41300700001)(36756003)(5660300002)(40460700003)(2906002)(426003)(36860700001)(6666004)(83380400001)(478600001)(47076005)(81166007)(82740400003)(356005)(8676002)(8936002)(1076003)(26005)(336012)(40480700001)(6916009)(42186006)(316002)(2616005)(70206006)(70586007)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: axis.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Dec 2023 20:55:45.8102 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 764d780f-dd79-4ad5-0b1f-08dbf69db7e7 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: DB5PEPF00014B97.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR02MB10593 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 20:55:51 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/191929 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 20:55:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Kjellerstedt X-Patchwork-Id: 35818 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 31B81C46CA3 for ; Wed, 6 Dec 2023 20:56:01 +0000 (UTC) Received: from EUR02-VI1-obe.outbound.protection.outlook.com (EUR02-VI1-obe.outbound.protection.outlook.com [40.107.241.54]) by mx.groups.io with SMTP id smtpd.web10.45022.1701896150782233908 for ; Wed, 06 Dec 2023 12:55:51 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@axis.com header.s=selector1 header.b=B8KVScBu; spf=pass (domain: axis.com, ip: 40.107.241.54, mailfrom: peter.kjellerstedt@axis.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Up35W8D9mQ9LrXzaVxPxavbumT1KuacFI489yc+jy6foGva9ZMHCZeqMm093lUcrouS46gQomo/ygjYi9N7a4zxtwNcbi60ngJq7J0stetJFQBfqWC5Ew/0dPYquvOA9lgIauwdrXt3Nt8HwbTainVW7livPnTGBMqp5fYz3w1ZlPyTUgy0zOC65A2SYxsj5jAW/zD3FmNMeXrJ4u6WCHYW+dwaCB9MGyCYE8xuooy0uDo7PZU2aAGO8iYWLv9wLAR0t15DPPKg72DVyS7NRGf1ExXrJrDe+wU6VTdz5ZrquwiA1RdVavmxikj1OQXpu3/vuyF/b0in+te7Gge0TRw== 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=e63No7L6Zc19HMf0bIimpHH6PZ+KDdcNgsO6glW9fpfKnRYOm/vsjiROaPnHO+8en7cKKQJN92NNPax1UpVZ9avpjexqGKNMBrtvq0zOO0L2BjcqCe3dAQb7eMvp9iNiYxGaRJrvGdYqBgcT+ECQWayqfdrDb/LJeA2HOQy/EWYPIXNCB2AfByFb3Wx+luU8AU6OtmQUS/wrdHjyqB9Xm+ESmLogmEGkha+qVl13F55ly35wFbdQh1D0oinl9A3RXjLQkaisf1PyIGPSgw94X7gxyawpXLc9b7ipHzyv8c3aaKqj9wqob2jK1jVrWkpaf/e3/aFQgyjqQ5AiJ+ivvA== 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=B8KVScBuH6X9g0CVYWLf9e/Zsl/SMnA9DZj8GiYCM8BTN2CmUJWa7MlAlvN2PUPvC/69QmPnSEMOLBdlES9Ua4tH5gNnV5bYEmLeobA/blLNYnOdnOsIaxxuInN5VKBAdi9USxisZW8veL+X/TIo6lQgWTip/4gKhss75MyI+UY= Received: from AM0PR02CA0125.eurprd02.prod.outlook.com (2603:10a6:20b:28c::22) by DB4PR02MB8536.eurprd02.prod.outlook.com (2603:10a6:10:388::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 20:55:47 +0000 Received: from AMS1EPF00000041.eurprd04.prod.outlook.com (2603:10a6:20b:28c:cafe::7) by AM0PR02CA0125.outlook.office365.com (2603:10a6:20b:28c::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 20:55:47 +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 AMS1EPF00000041.mail.protection.outlook.com (10.167.16.38) 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 20:55:47 +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 21:55:44 +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 21:55:44 +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 21:55:44 +0100 Received: from saur (saur.se.axis.com [10.92.3.10]) by se-intmail01x.se.axis.com (Postfix) with ESMTP id A5EF7F686 for ; Wed, 6 Dec 2023 21:55:44 +0100 (CET) Received: from saur.se.axis.com (localhost [127.0.0.1]) by saur (8.17.1/8.15.2) with ESMTPS id 3B6KtiT74037609 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Wed, 6 Dec 2023 21:55:44 +0100 Received: (from pkj@localhost) by saur.se.axis.com (8.17.1/8.17.1/Submit) id 3B6KtiK54037608 for openembedded-core@lists.openembedded.org; Wed, 6 Dec 2023 21:55:44 +0100 From: Peter Kjellerstedt To: Subject: [PATCHv2 6/9] recipetool: create: Improve identification of licenses Date: Wed, 6 Dec 2023 21:55:28 +0100 Message-ID: <20231206205531.4037549-7-pkj@axis.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231206205531.4037549-1-pkj@axis.com> References: <20231206205531.4037549-1-pkj@axis.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AMS1EPF00000041:EE_|DB4PR02MB8536:EE_ X-MS-Office365-Filtering-Correlation-Id: 3dcf12be-f093-4205-9632-08dbf69db8c6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: skZeWpS/l0ob/zQ86G3DaL7nMeD/DU0iOH5pWIj807iN7PQG5pxLEwYROo05akPnRU7sQhnAgBF9fp64fc49OEEMx9lCyX8OzqpDwG+aWwP8Wo1ZS3v2qc4PGIstLYSXxtN7gNiFp2Hbp0uT8zxNc+ONi1JFUyt4LR16C7UP7FjDaWN7K0cKx4rx/eBN8Hw/9VeRBqwvrQbIB/xUlp5hs5qwMLdMFSsaO+2DWPCw5UX5LsiQj9Z0q502+5sJUjRyJUBfktJpXCfYkSPFcccvO+Ybmkkja+GGp6UAJrP0zSw3hU8JnuSmgKaosxVrbAsvOUBgx+0W3psCzOIWvCQPYmCc2uZCYWDNnkY78RBZn3dOYGTnN66UfEWrmnVW2GcOfRCFbAT7D+mDurb+REfdxnTnlncxs/N2uRqusGVOxcB2uH1fwy6XVeExdYQ2wAvm4i237/Hm4uov2A5LD7H0S9nkPm63ILpzx9OmN1M25SolMgXPgjYHtTXRZ46exs/9WyEsWbpRrphCc7vcAvr6u3yxyFI3WNyX6sHMcuAJMWiD8kIZRDXdtWI3Yj4wnuZiKrP39CbptaDd5RtE8OBoemZpBzaFSfalrwnP2BEw/7kjqkfo0+UgZf9ipuKyC+qhYLkGUIVCIFKg2Z4n2y9h5a96fvOXo+Ix5IH2OCck/5QnIdMLC9O8/n5V2eNRE0nVTWfY4tygsAEent3y5v7O0e6kL0oEAZIgXdVbqxp6SWTHXKKhAwCuwlMv1qkMLODzTgc8DbbUbCYYuYxfkfgskXvUyQyxbnmB98i7BuDsezDGDakcegOEc3nE06EtwmSe X-Forefront-Antispam-Report: CIP:195.60.68.100;CTRY:SE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.axis.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(4636009)(376002)(39850400004)(396003)(136003)(346002)(230373577357003)(230473577357003)(230922051799003)(451199024)(64100799003)(82310400011)(186009)(1800799012)(40470700004)(46966006)(36840700001)(316002)(42186006)(336012)(83380400001)(426003)(70206006)(70586007)(26005)(6916009)(40460700003)(2906002)(356005)(82740400003)(41300700001)(8936002)(47076005)(81166007)(36756003)(5660300002)(36860700001)(8676002)(40480700001)(478600001)(2616005)(966005)(6666004)(1076003)(2004002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: axis.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Dec 2023 20:55:47.3065 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3dcf12be-f093-4205-9632-08dbf69db8c6 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: AMS1EPF00000041.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB4PR02MB8536 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 20:56:01 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/191931 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 20:55:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Kjellerstedt X-Patchwork-Id: 35812 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 02ACFC46CA0 for ; Wed, 6 Dec 2023 20:55:51 +0000 (UTC) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (EUR05-DB8-obe.outbound.protection.outlook.com [40.107.20.82]) by mx.groups.io with SMTP id smtpd.web11.44680.1701896150206406953 for ; Wed, 06 Dec 2023 12:55:50 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@axis.com header.s=selector1 header.b=i+r/kWS+; spf=pass (domain: axis.com, ip: 40.107.20.82, mailfrom: peter.kjellerstedt@axis.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MXW5g1GhvtiEztHko6a+HthLoyh6wvopxCI1rmLrSzCiPRj2NttA+8laakWCoHkdnOr5QNiuZLjMBMceswyP14ELqVdtMjRWfjwN7MaELewylTdzB34ks3c4WJ6H3mnpMjybxFCuNXrsHT3iyqZSkJEhbkGOmzkTdKKS7v1IBaVgZaj2Yht8t7lTHzcC7/KxhEHg3Fi+OfHYkgJOfzbuGGTje67J5cNJ1daNDamniDOxemz2Q4IKJKfcwEnLLc7rh+EekXD8XFF8s48U10uyy5A3BO3VE+yvaZFwlK2LfG83xAx+uX/0bu+87lMsZs7ltHpqto1LGRvXETRzLo6cbA== 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=nFe/KMZuuUcrIKoP6PFuafGYlJ15A2LEWdyBVekG7rNtMZzQXPdZDxajRrI0KwDPfTiDnMIZ2wqUWaTlafV2VYdXd8G+Nb2f6fMaIevBnnbLbk3misZ/6o8z5IBnp4i5iATii6x89DIER02YJwglw5Bo9UX+fWHQ1Wb5BnwF2eIU4gHI8IdBXFmxIDiaaB+/oTqXbstEQjdZ/D1ZZHv3Gaxc+SN0kqUSwkoQ1rmrHuUd0yivrRdA24PES1j4ljNAF5hDKABBbnKe4HTTZqLVPOnB/iTY/t+B1rmZC26FvOeD1PFm9qsMswbq5YOKEF2iIoov6UvBXAz9RiHCw+qjlQ== 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=i+r/kWS+kNd+uZ6mIL6IW7kmFNsFPbKtYw+vhgYPo3I6msUMYBNPKFL/wiRjN99864TVoAOA9dWdIp4h6kHJnZFXMnLVGJsJyo/ui491QBsB1P0M4FHCLBxY+o6nryGvt2AA9lpoFeg28wFgpAkP5GbIEJ7f8USUkr3wM+VW+1k= Received: from AM0PR02CA0113.eurprd02.prod.outlook.com (2603:10a6:20b:28c::10) by PR3PR02MB6442.eurprd02.prod.outlook.com (2603:10a6:102:7a::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.27; Wed, 6 Dec 2023 20:55:47 +0000 Received: from AMS1EPF00000041.eurprd04.prod.outlook.com (2603:10a6:20b:28c:cafe::c3) by AM0PR02CA0113.outlook.office365.com (2603:10a6:20b:28c::10) 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 20:55:46 +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 AMS1EPF00000041.mail.protection.outlook.com (10.167.16.38) 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 20:55:46 +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 21:55:44 +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 21:55:44 +0100 Received: from saur (saur.se.axis.com [10.92.3.10]) by se-intmail01x.se.axis.com (Postfix) with ESMTP id C50BFF689 for ; Wed, 6 Dec 2023 21:55:44 +0100 (CET) Received: from saur.se.axis.com (localhost [127.0.0.1]) by saur (8.17.1/8.15.2) with ESMTPS id 3B6Ktiqc4037613 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Wed, 6 Dec 2023 21:55:44 +0100 Received: (from pkj@localhost) by saur.se.axis.com (8.17.1/8.17.1/Submit) id 3B6KtiDP4037612 for openembedded-core@lists.openembedded.org; Wed, 6 Dec 2023 21:55:44 +0100 From: Peter Kjellerstedt To: Subject: [PATCHv2 7/9] recipetool: create: Only include the expected SRC_URI checksums Date: Wed, 6 Dec 2023 21:55:29 +0100 Message-ID: <20231206205531.4037549-8-pkj@axis.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231206205531.4037549-1-pkj@axis.com> References: <20231206205531.4037549-1-pkj@axis.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AMS1EPF00000041:EE_|PR3PR02MB6442:EE_ X-MS-Office365-Filtering-Correlation-Id: 6175190c-9a83-47b0-9902-08dbf69db888 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: yKxevsRslhUkp/3KgMHu1bzVxoQvFOywLpO/Kaw/bfkooRBuLh/ezEjExtLRWszPzWABUkvM5mpbJF02n4VVNezNPJOHXw34Sakr/aGCEDQc/qds1GArJ8VWaHj4du8iytASpV1r7J4tSmrkXN3EIOtJvFdwhKQKF2KRzEt0GoiURSqN21eNvgFeb4okaB/1oNzq19/XOnERv17zR0DC+BHx6jVv2XoXqvGXbByQ0XogujfBaVFKNqg5ijHiGEfhIz1dEubhcxr2AdFQEBUraVJvgUGVczIh0OWFZMGJ+EMO5IFJXby8z5Q9+mRkJ6OeVqn9gTocZZGNTIc+HRMQRaEXVVzLc9Czer1vibjnYZz/uC/BcB+9Dqj8sM+d9/XJVKeKBJWbFct8xhmw9/ujAF1qSylsVqIW3a1eBgRURcg+WC9dHDLYe5J1OFOdQdCil3a9kT/ntfTWcg5i6iZKzbAnfLdxGOfzq986PQ083PPRht3sfTb5QsAPV0c+kcaq8pMRh23iwPkPsuOesAKMI7I+FkiRX9KdhuLt+H9E1/sJrJqjl3wcrQuLpEM+RHl+jQFvJJNUwYlOPLD5Co+km1s6OEZ7P7rby1UHz3ohzgFEZKlvomucU7QFgnYDXL/7JooWzRmMNLEwBYKOYYCKnkbx8+7+6x0RlkU4ZWPralT52LGlr4CU31Q0yluHnA9Flj+3Lvcr/jOWoV1ruwyCwKSHJExA591h4LgteF85iMi41EYbqKR29jKnanP+nrupdYaaKDtaaLIONPgwbYX01Polj/1KOAe1i+aK2iqVjME= X-Forefront-Antispam-Report: CIP:195.60.68.100;CTRY:SE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.axis.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(4636009)(39860400002)(136003)(346002)(396003)(376002)(230173577357003)(230922051799003)(230273577357003)(1800799012)(82310400011)(186009)(451199024)(64100799003)(46966006)(36840700001)(40470700004)(42186006)(70206006)(6916009)(70586007)(316002)(8936002)(8676002)(5660300002)(478600001)(2906002)(6666004)(2616005)(1076003)(26005)(41300700001)(36756003)(426003)(336012)(40480700001)(83380400001)(82740400003)(81166007)(40460700003)(36860700001)(356005)(47076005)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: axis.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Dec 2023 20:55:46.8846 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6175190c-9a83-47b0-9902-08dbf69db888 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: AMS1EPF00000041.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR02MB6442 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 20:55:51 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/191928 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 20:55:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Kjellerstedt X-Patchwork-Id: 35819 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 2C750C4167B for ; Wed, 6 Dec 2023 20:56:01 +0000 (UTC) Received: from EUR04-HE1-obe.outbound.protection.outlook.com (EUR04-HE1-obe.outbound.protection.outlook.com [40.107.7.53]) by mx.groups.io with SMTP id smtpd.web11.44682.1701896151314454707 for ; Wed, 06 Dec 2023 12:55:51 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@axis.com header.s=selector1 header.b=LiMRiDf3; spf=pass (domain: axis.com, ip: 40.107.7.53, mailfrom: peter.kjellerstedt@axis.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HqtIzP43lxmwDsr3CLLbr7eQDIxrEZxH5mCKwJm8Nxin55YQxWVMkGeJ8BhFHDv6Wd5PK4tJUNnIY2BpO1JKgfN8aMolixGboNmmhoNu+yanJ4q4I6h9jHjYoF+k1htoZby+eH7Tciq9ufBOhq4BcwcE8ivMIWmXNQO8wcFNVLFmdML3ZeFb/QPsXTPZDJ2R03Eu3vnQ+Edu22pSoXujnEayh0hl6mRXLtFoiPQh2nc933ATYKW2OMCDDlr5EIpGdWpKTtxfQYjCaehGG/KVFJQLOleFQrUdjp9QvI0JMurPuCd6Waq5vfhytYTYUPglwg73hsTu6MB8m0Kc2R4VHA== 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=f9m60t0xDPQ+7cpPF3wXV5FJaCl9mjmGI89+EDgHg5g=; b=L9ngCOfXVCQvP963SEfPKUcqhp82Rgq/2GLPdQF4kKxzc5Qeix6DiQ8cukAuUHcXD6Qb8rdes6UvL6+SRTSN2C2zv/JoDK1aW7iIYLNGxs6GSzZ24mm7O2FExO2/OMl+BqaL8T0ICOig2IELdw++PM1bpIbIOWRGhzl50q88daRXjj6lgGpbjliaMI5lcsYmG+liBa8phD+/Pjti7fFE+HQXLvGfGvP/GmGlZWKbeABtHI+Quqplt45kV3zjUkE1diZMoSheLZMuPTImrVMmvAGTjYTcgJMR57FdsMX9ER9tTc12kBcgjXAVe51gfjVBRIzzQ+0dfj7bww6yggZDCw== 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=f9m60t0xDPQ+7cpPF3wXV5FJaCl9mjmGI89+EDgHg5g=; b=LiMRiDf3BVLwTlJYiZxyPAyAdFt6iVRBsxErC90554qLkAqfBpkegcDP5FEL7MEmw8Xadl+rf+MNL1dDb3bLGkjrMsCGb0onw71ixIWNPV6y49x9ceRyt3agxys3t6CD5Z5AbNwz5rYPjII+KbujXUS8gMiQy0mKNx1aUY5TiAg= Received: from AM0PR02CA0115.eurprd02.prod.outlook.com (2603:10a6:20b:28c::12) by AS8PR02MB7317.eurprd02.prod.outlook.com (2603:10a6:20b:3f8::21) 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 20:55:48 +0000 Received: from AMS1EPF00000041.eurprd04.prod.outlook.com (2603:10a6:20b:28c:cafe::9c) by AM0PR02CA0115.outlook.office365.com (2603:10a6:20b:28c::12) 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 20:55:48 +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 AMS1EPF00000041.mail.protection.outlook.com (10.167.16.38) 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 20:55:47 +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 21:55:45 +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 21:55:45 +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 21:55:45 +0100 Received: from saur (saur.se.axis.com [10.92.3.10]) by se-intmail01x.se.axis.com (Postfix) with ESMTP id F1A9BF686 for ; Wed, 6 Dec 2023 21:55:44 +0100 (CET) Received: from saur.se.axis.com (localhost [127.0.0.1]) by saur (8.17.1/8.15.2) with ESMTPS id 3B6Ktidm4037617 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Wed, 6 Dec 2023 21:55:44 +0100 Received: (from pkj@localhost) by saur.se.axis.com (8.17.1/8.17.1/Submit) id 3B6Kti3c4037616 for openembedded-core@lists.openembedded.org; Wed, 6 Dec 2023 21:55:44 +0100 From: Peter Kjellerstedt To: Subject: [PATCHv2 8/9] devtool: upgrade: Update all existing checksums for the SRC_URI Date: Wed, 6 Dec 2023 21:55:30 +0100 Message-ID: <20231206205531.4037549-9-pkj@axis.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231206205531.4037549-1-pkj@axis.com> References: <20231206205531.4037549-1-pkj@axis.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AMS1EPF00000041:EE_|AS8PR02MB7317:EE_ X-MS-Office365-Filtering-Correlation-Id: f170262f-e83e-48aa-b910-08dbf69db92a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: OwKWKWLKZoEWrkRcvwIQxZWKfaf/IUAhdRRAgFx4ecpUY+Vx9AuT+yxNX85qsZVj7XZZuudHq59pNojSOTB5Ozsb4EvkIRvvuH8InZ87DMEmCnHSqGrVqifPMwPvqVuzpjJ9WCd286lmHrY9kOhiEMmTFiyu7cn2tTmn9CcSkvODyHceiyxO2i0jPzTc+uLwmR1/YJDTzv7gyfDdWO503d9Oyd51E/scI68c/JILb3fI49iIK0SgWRdnQW/IfF/iCBZ234/zwN+hzLrZB/3Vj3nztbFCYeaHFjleniKx8ajyyecd7QdB+pJk8fUqTOiYoV1y9om2ddelSxdgoxN+F0v/wF76Y3X9ATV/bRWfq5SNmOlbfGlRg0rX+cyVEP5Olksphg22efAFNSKEXqv9z9BLeJf2k1YsTNeGPa6iUTLc8ZJEqUKI3cJX1CW5meNLA2CmMDtMMCmFKKgv+g87cJ5itsMctLKY4WLwE55wiI1rWQwBdzZAe882eC2l/HVivxCNFjqrWx2DJgKjEU3NYePuJY82Q1lKN0zs1jDZ4ytufQRyw0QOhae4yq5ZgPgLN48FBfdOHpnLm61vzEP4nPd8weZtkxZi46ZAmaj8iHN9yRobrnDNzSOicaAPONVmnkk7EDZ1c7fEN7IcLAFWc6XgAxSpxub7wo4NQ20xlG5XeD0SEkFD42Dg+rNqblO9BvOBodEj5Bde4VlqDLFtb4PUVrJ0VHSHwketv1lljqGjslisJStca+X+gQ+6nYv0ojv9kIytysZXiBulrcfboUiOIwYuEHwaTb30RGkOu2nc23VZM5JXjfwZTWivu7pfM3L1liJWjB7njixH9tcWfw== X-Forefront-Antispam-Report: CIP:195.60.68.100;CTRY:SE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.axis.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(4636009)(136003)(376002)(39860400002)(346002)(396003)(230922051799003)(451199024)(82310400011)(186009)(64100799003)(1800799012)(46966006)(40470700004)(36840700001)(8676002)(8936002)(5660300002)(36756003)(6666004)(2616005)(42186006)(6916009)(316002)(70586007)(478600001)(70206006)(41300700001)(2906002)(15650500001)(30864003)(40480700001)(82740400003)(81166007)(47076005)(40460700003)(36860700001)(26005)(19273905006)(1076003)(83380400001)(336012)(356005)(426003)(562404015)(36900700001)(473944003)(563064011);DIR:OUT;SFP:1101; X-OriginatorOrg: axis.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Dec 2023 20:55:47.9471 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f170262f-e83e-48aa-b910-08dbf69db92a 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: AMS1EPF00000041.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR02MB7317 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 20:56:01 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/191932 In addition to updating the sha256sum and removing the md5sum, update all other existing checksums. If the only existing checksum is md5sum, then replace it with the default expected checksums (currently only sha256sum). Signed-off-by: Peter Kjellerstedt --- [PATCHv2] Updated the commit message to make it clear(er) that md5sum is still being removed when updating recipes. .../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 20:55:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Kjellerstedt X-Patchwork-Id: 35817 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 28D03C46CA3 for ; Wed, 6 Dec 2023 20:55:51 +0000 (UTC) Received: from EUR04-HE1-obe.outbound.protection.outlook.com (EUR04-HE1-obe.outbound.protection.outlook.com [40.107.7.71]) by mx.groups.io with SMTP id smtpd.web10.45021.1701896150445737061 for ; Wed, 06 Dec 2023 12:55:50 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@axis.com header.s=selector1 header.b=C6S7++gB; spf=pass (domain: axis.com, ip: 40.107.7.71, mailfrom: peter.kjellerstedt@axis.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KKRDUM5DUXLkeDS5Saozcx44AN+BAls9u2LOvhrxnCue2MLKjb2Ga6Qdl04fqrXwreoLuj6CN21NupLU1bEtgi6/Cv4IUbKnTzNhUVoaHfNX2QSDa17exPDNLRjhtZO0AOjCBC9t5iFLUJYptShmxwr+WxtbBHG1Egwj3JBAMc2V7IoTXFTjCDH7canAQske27xDEKY4bkthkDDaiFaDBBAC8FynKHEs+OIhicf7LEBi7vjLPz6pHzktDp/yzKODBuJ3Ky9qiW/szkmrjcqgcOaJwwZ7Q0zYzT40erQHR+nK6MOLJ3vF5U7OLo9UfG5rRAMtvJDKgJ1RNw3tuISXhg== 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=C5aXi59oIjFNCKL/KQaTGfpk5KstR01WnJpSTzMQmothq/uZr61g0parUeUOYSiuaenqCmZM5tluF3A/YbD5U3twofjIeiybe0M6cq2NVppiuDqBzE97pJ+ZxvfawgAiAZKV3d5Xf4Tki5zM0KiPqq0FOKf7ZUkbO9pRh7sE6WaV+F7MuSsbtMuzbhkbJdWpxJZ1/yZpjntap9mv/qP7rnpG8tGh4KAMbvncLB6vpRycGzofD3xWN/ckkOAM6TH2Yr1yWpx5WjFbv7Cfs320PH7Uy9o8E+lvuax6OHx2qszzPeOzNWjQuRIHaMBxKNXbk4xttpfAzmjaPI4sz1NhKg== 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=C6S7++gBbvy6K5stu12Fo0hhTi4yH2KJFnoS+yK7y8i57THVTfAVYXwwL40Id5nyhYbNEoHnhmXPYnpjEEcQ10dDgPUQeVYainqOveeHENEuKlzJcg+I1btVi/XFpe72moAVqGDk5+PUcwcQeWWEGBLQwsnGpQvcx8mkDny3dPI= Received: from AM0PR02CA0127.eurprd02.prod.outlook.com (2603:10a6:20b:28c::24) by AS2PR02MB9320.eurprd02.prod.outlook.com (2603:10a6:20b:578::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 20:55:47 +0000 Received: from AMS1EPF00000041.eurprd04.prod.outlook.com (2603:10a6:20b:28c:cafe::b6) by AM0PR02CA0127.outlook.office365.com (2603:10a6:20b:28c::24) 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 20:55:47 +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 AMS1EPF00000041.mail.protection.outlook.com (10.167.16.38) 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 20:55:47 +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 21:55:45 +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 21:55:45 +0100 Received: from saur (saur.se.axis.com [10.92.3.10]) by se-intmail01x.se.axis.com (Postfix) with ESMTP id 2B846F686 for ; Wed, 6 Dec 2023 21:55:45 +0100 (CET) Received: from saur.se.axis.com (localhost [127.0.0.1]) by saur (8.17.1/8.15.2) with ESMTPS id 3B6KtjP04037621 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Wed, 6 Dec 2023 21:55:45 +0100 Received: (from pkj@localhost) by saur.se.axis.com (8.17.1/8.17.1/Submit) id 3B6KtjLT4037620 for openembedded-core@lists.openembedded.org; Wed, 6 Dec 2023 21:55:45 +0100 From: Peter Kjellerstedt To: Subject: [PATCHv2 9/9] devtool: modify: Make --no-extract work again Date: Wed, 6 Dec 2023 21:55:31 +0100 Message-ID: <20231206205531.4037549-10-pkj@axis.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231206205531.4037549-1-pkj@axis.com> References: <20231206205531.4037549-1-pkj@axis.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AMS1EPF00000041:EE_|AS2PR02MB9320:EE_ X-MS-Office365-Filtering-Correlation-Id: 3aa17ce9-9d70-4061-09ee-08dbf69db8fb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: SfZBPJgMCTsenE+tRQldtNheYwd8iEglt8tw34l4si0z/jHguH5kPSCQGL6EYUi9ohUzC5ytk7a0S3BjGNuIZwV+1wQw2K92iz8P3eHY8c4gWnI92A731I/pFvSBFzHzzQN7CFDZdpt2FtaDJfaMJNSIOtnYR969bOSjwiWlK27W/efh7nP/5tLRYGAbGlrToPI0/iwxDBEgAZfK0/mB9zS5v2DisUCa24nTMHQwZMgMabgNfP1biCozMIHC5yFEOYYvZRZWxtdNoqLTa5E/JMevOMGSnuPdXNtE96ITAFxE0Vvjv+pNbqltnCHGaHLqEu4twNgBrGcEV7ob0tTyQsMkSLkOer89N3+PpkAg0XVSKp2F4jg6fg0+1lxLheL/pfDrbVMxja1Igd7x3N61kKOxZstG82hbzC0jQ9nBxuBsFwUHgRd9YDSLfhdMGLdG2aEAcSTwBYB3BYeV4IHzE1K5US7IQ3sV47nqJ/Fk4iwhs46Td2x6ZcXphHxIZUES+k1LCK0k+PKLjtry21EkMYH60P1Kvaw9WS93xE+0zCph6uFa5oupiUbhjZXmmaWx8LY0grcgVU67v6ftu/zwKHInPJvI59dPuFOedqbLFy9SzM0OM4VMVLCkCM1zfqYxY48alslXOPCIN7oGDSciDel7CXeRCGVrtQue9Bdz6H68f9S841V8Z5K5hIPNF9+s4uyvbhWrA06uKOpQc5Zpd3jJ94nzcFVfsNx8BDjGbvs2ITd5DVfdl73yWDnPCoxorBPNgwvvac5E9EE+rIftyQ== 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)(346002)(376002)(39860400002)(136003)(230922051799003)(186009)(64100799003)(451199024)(1800799012)(82310400011)(46966006)(36840700001)(40470700004)(36860700001)(426003)(83380400001)(6666004)(82740400003)(40480700001)(6916009)(336012)(26005)(2616005)(70586007)(70206006)(42186006)(316002)(81166007)(1076003)(478600001)(356005)(47076005)(8936002)(8676002)(5660300002)(40460700003)(36756003)(41300700001)(2906002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: axis.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Dec 2023 20:55:47.6502 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3aa17ce9-9d70-4061-09ee-08dbf69db8fb 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: AMS1EPF00000041.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR02MB9320 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 20:55:51 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/191930 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: