From patchwork Tue Jan 7 09:17:53 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Herbrechtsmeier X-Patchwork-Id: 55103 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 D67FCE7719B for ; Tue, 7 Jan 2025 09:18:26 +0000 (UTC) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (EUR05-VI1-obe.outbound.protection.outlook.com [40.107.21.129]) by mx.groups.io with SMTP id smtpd.web11.16587.1736241499941436827 for ; Tue, 07 Jan 2025 01:18:20 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@weidmueller.com header.s=selector2 header.b=D6bn/0pD; spf=pass (domain: weidmueller.com, ip: 40.107.21.129, mailfrom: stefan.herbrechtsmeier-oss@weidmueller.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=MhtZ2nV1N8Sr6VvM5jq2YISHe5uoJHwiijqFsi+PJTr4g/4Q8babC5wAdHZ3JJ961emjDpaasRF/YWvilW6Ca68IMe/C5rm8Bjn7L08Dt40XzwJj6EvIuOu4dPPX96907CibCBoz/vzDaO60/2Mc0vOmzQsfML5SrQ0ilrJBBk69dS7OrcMvKsDsdnTzkcdTkykvq2alutdNXKlkUri9rPHVKXwq47Vr4iICcQflJlEfQneOWJd64aDSDCRP3DPk39x7LTvyASXJZ5LE8raOaIYUhLOLD989BKRLfJ6y4lxkL0WI3FP5HafR8HA/hG3NAy9Rv2TUyS7CiW+qotHkSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=eTPvKRjIRugd0DfnF+zHlcgXQw+aAS5AGA5VFuhyZQI=; b=sw473ajtTl0geQur+fDGeWkb4yfrC+uXHOvOJwHU8FSzSswNDiy+QRsga3RFKPWhA13wgNHxVzJnzvyI83L4ajtLzlu8upor25Yr30t7z464jskcyCeweFUXrxuT2XX/HKhEK0sDNqSSt9QfWMXRz18Kkt39pjezIZJMjICdicpLstbAwKMllC+8+rvY8wF7yIwGcSHk39p4jO77y6h1qjH4ttAHa8N/TGEs/3Lzh+OuB+CgU8Hd0huhc5ULzmZzvNBQfEN0RkT5m1Ukw8p1Z8JjeBHIpkGeDPqljGPYfM6k8ok/Qog2n+79PvDLnKjAy7v8SlzH2m4E7iPywzLcPw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=weidmueller.com; dmarc=pass action=none header.from=weidmueller.com; dkim=pass header.d=weidmueller.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=weidmueller.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eTPvKRjIRugd0DfnF+zHlcgXQw+aAS5AGA5VFuhyZQI=; b=D6bn/0pDy3XQgz7T6wBOP/TP2Fp0DlxXBd5lXxWxH0Et14BXBVsRxm2t+lQ0jFRWLVnt0i1ksJZhjVg/aCRzl2NVrw9U0akTvjAaCC25kBueml1dfT6Lpe7OaQAwBMQvvS4ZxS7v8MCOlmoWJXUz4CH7YsE+RktlQ+sTmqQ1c4Icae8fysd9HsEcTubB8dCwxq3lznGFSmEFXA55wo9VpQBygIdBoyWbnyn1iQmaea5sb1JDhSeqt+6uM2fbOficx3uQgDI+vakI1Y9qXR9JG31GEtq3QMF702HalvHWq4PSL7F4KtlqbLW0AR9UXM1YH5m5tHWcqq4AlbT5/0jmWg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=weidmueller.com; Received: from PAXPR08MB6969.eurprd08.prod.outlook.com (2603:10a6:102:1d8::23) by GV1PR08MB10607.eurprd08.prod.outlook.com (2603:10a6:150:16c::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8314.18; Tue, 7 Jan 2025 09:18:13 +0000 Received: from PAXPR08MB6969.eurprd08.prod.outlook.com ([fe80::3b1:b329:1ed9:dad4]) by PAXPR08MB6969.eurprd08.prod.outlook.com ([fe80::3b1:b329:1ed9:dad4%3]) with mapi id 15.20.8314.015; Tue, 7 Jan 2025 09:18:13 +0000 From: Stefan Herbrechtsmeier To: bitbake-devel@lists.openembedded.org CC: Stefan Herbrechtsmeier Subject: [PATCH 1/5] tests: fetch: update npmsw tests to new lockfile format Date: Tue, 7 Jan 2025 10:17:53 +0100 Message-ID: <20250107091757.886-2-stefan.herbrechtsmeier-oss@weidmueller.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250107091757.886-1-stefan.herbrechtsmeier-oss@weidmueller.com> References: <20250107091757.886-1-stefan.herbrechtsmeier-oss@weidmueller.com> X-ClientProxiedBy: FR4P281CA0015.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:c8::7) To PAXPR08MB6969.eurprd08.prod.outlook.com (2603:10a6:102:1d8::23) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR08MB6969:EE_|GV1PR08MB10607:EE_ X-MS-Office365-Filtering-Correlation-Id: 96b9c76a-e3a2-4fed-b65d-08dd2efc35ad X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|52116014|366016|38350700014; X-Microsoft-Antispam-Message-Info: 0H8czt4HNA9/0FDE99AJ/pYFMdo3AG7mTNJK6fVy5Iqck4sCyHn6So6XjN6LvfUEbfxPehoqyKjDpQ7ckX5AV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adIzDOXwx+Cj7xA1/gSN+uoKVY7aZ8ZH4isPwm0Mu8CqK8M1MRvpQInl0IK3bIGOzSfYqM63PxlwECleyuIwINy/BRoZO6j+GfQ74pUp6fmCaMBdBNFhg/I8JerTAV/hbxs6WuIjmjzsNXM/zjrAnTigH8g3aSrRheG/DWU4C9BfgWLP9PNsmu1fsVJb7MQpQL97d/0gPktpkH3WHvnpmsCJHK1sSvVY2b4OLyfnV+KIekfNsF3MkulcRt5NLbau0kcq5PA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR08MB6969.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(376014)(52116014)(366016)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: AL2hn/CKuKNNZ9ilG3tMVibLevDGXvc/wZA9Xyp5pS2//6VNoyTtLAK+zM8en18SZ3w9f6elGyOtlNg6uAJl00fCNxsF9Vkt3o2KIiuKwr5fwmQ4nS/LwUNmYpCecGetsRoyk7NRXruNrtm2+mTTHeUOfPjj+XDXFGTkWsN0jUBU8Va5RICw2iZj9N/E/FbZWsV9B0rO2/MzRPNPhTxzi921R8Srz8few2I4QHwPGx+vHyqhfLPp9TT3mBb5D4Xy0Q01t4d5Ont1Uwaf9cd4Utj5D6NfahsB7zGW070n815KOWnURQ+yBqoW/xHTDKTwWopxV6fvVLiHO9uih20vCf305JQO42WU25rhWXIexqIqy/jq2hYkfSlff88w59IMzW1IkA1cxyPQICNnS4H3v5/X079y/DM20xoRwJXR2VVn2czvhhSlSJwCplKs/o8Vj1TCyAFH8ZJOB46BbrfpN4CXhPklsFy3OKnkSWDlBp5Xr2nGV9oBV1k7F76BoZYAh1chFKfvP43mp/FVjAVGW106YtSzKkBXRmDp17PiSbCssi+aY4+qEf2t/zxhNl6hZHNhOy0LjS2KGeTe2k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96b9c76a-e3a2-4fed-b65d-08dd2efc35ad X-MS-Exchange-CrossTenant-AuthSource: PAXPR08MB6969.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jan 2025 09:18:12.6582 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: e4289438-1c5f-4c95-a51a-ee553b8b18ec X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: YTqhlgzj0zsGkKrmixJZx/HMc6zeubT4axwbr7GgQvMFS3sRSfzxjxnk2a4vnDdOEiSZzC8Ptb+8CGDpm83VFA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR08MB10607 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 ; Tue, 07 Jan 2025 09:18:26 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/16973 From: Stefan Herbrechtsmeier Update npmsw test cases to new lockfile format. The old lockfile format is required by npm 6 / Node.js 14 which is out of maintenance [2]. [1] https://docs.npmjs.com/cli/v6/configuring-npm/package-lock-json [2] https://nodejs.org/en/about/previous-releases Signed-off-by: Stefan Herbrechtsmeier --- lib/bb/tests/fetch.py | 135 +++++++++++++++++------------------------- 1 file changed, 54 insertions(+), 81 deletions(-) diff --git a/lib/bb/tests/fetch.py b/lib/bb/tests/fetch.py index 6dda0d381..b89348236 100644 --- a/lib/bb/tests/fetch.py +++ b/lib/bb/tests/fetch.py @@ -2843,23 +2843,25 @@ class NPMTest(FetcherTest): @skipIfNoNetwork() def test_npmsw(self): swfile = self.create_shrinkwrap_file({ - 'dependencies': { - 'array-flatten': { + 'packages': { + 'node_modules/array-flatten': { 'version': '1.1.1', 'resolved': 'https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz', 'integrity': 'sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=', 'dependencies': { - 'content-type': { - 'version': 'https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz', - 'integrity': 'sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==', - 'dependencies': { - 'cookie': { - 'version': 'git+https://github.com/jshttp/cookie.git#aec1177c7da67e3b3273df96cf476824dbc9ae09', - 'from': 'git+https://github.com/jshttp/cookie.git' - } - } - } + 'content-type': "1.0.4" } + }, + 'node_modules/array-flatten/node_modules/content-type': { + 'version': '1.0.4', + 'resolved': 'https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz', + 'integrity': 'sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==', + 'dependencies': { + 'cookie': 'git+https://github.com/jshttp/cookie.git#aec1177c7da67e3b3273df96cf476824dbc9ae09' + } + }, + 'node_modules/array-flatten/node_modules/content-type/node_modules/cookie': { + 'resolved': 'git+https://github.com/jshttp/cookie.git#aec1177c7da67e3b3273df96cf476824dbc9ae09' } } }) @@ -2877,10 +2879,9 @@ class NPMTest(FetcherTest): @skipIfNoNetwork() def test_npmsw_git(self): swfile = self.create_shrinkwrap_file({ - 'dependencies': { - 'cookie': { - 'version': 'github:jshttp/cookie.git#aec1177c7da67e3b3273df96cf476824dbc9ae09', - 'from': 'github:jshttp/cookie.git' + 'packages': { + 'node_modules/cookie': { + 'resolved': 'git+https://github.com/jshttp/cookie.git#aec1177c7da67e3b3273df96cf476824dbc9ae09' } } }) @@ -2888,40 +2889,16 @@ class NPMTest(FetcherTest): fetcher.download() self.assertTrue(os.path.exists(os.path.join(self.dldir, 'git2', 'github.com.jshttp.cookie.git'))) - swfile = self.create_shrinkwrap_file({ - 'dependencies': { - 'cookie': { - 'version': 'jshttp/cookie.git#aec1177c7da67e3b3273df96cf476824dbc9ae09', - 'from': 'jshttp/cookie.git' - } - } - }) - fetcher = bb.fetch.Fetch(['npmsw://' + swfile], self.d) - fetcher.download() - self.assertTrue(os.path.exists(os.path.join(self.dldir, 'git2', 'github.com.jshttp.cookie.git'))) - - swfile = self.create_shrinkwrap_file({ - 'dependencies': { - 'nodejs': { - 'version': 'gitlab:gitlab-examples/nodejs.git#892a1f16725e56cc3a2cb0d677be42935c8fc262', - 'from': 'gitlab:gitlab-examples/nodejs' - } - } - }) - fetcher = bb.fetch.Fetch(['npmsw://' + swfile], self.d) - fetcher.download() - self.assertTrue(os.path.exists(os.path.join(self.dldir, 'git2', 'gitlab.com.gitlab-examples.nodejs.git'))) - @skipIfNoNetwork() def test_npmsw_dev(self): swfile = self.create_shrinkwrap_file({ - 'dependencies': { - 'array-flatten': { + 'packages': { + 'node_modules/array-flatten': { 'version': '1.1.1', 'resolved': 'https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz', 'integrity': 'sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=' }, - 'content-type': { + 'node_modules/content-type': { 'version': '1.0.4', 'resolved': 'https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz', 'integrity': 'sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==', @@ -2943,8 +2920,8 @@ class NPMTest(FetcherTest): @skipIfNoNetwork() def test_npmsw_destsuffix(self): swfile = self.create_shrinkwrap_file({ - 'dependencies': { - 'array-flatten': { + 'packages': { + 'node_modules/array-flatten': { 'version': '1.1.1', 'resolved': 'https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz', 'integrity': 'sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=' @@ -2958,8 +2935,8 @@ class NPMTest(FetcherTest): def test_npmsw_no_network_no_tarball(self): swfile = self.create_shrinkwrap_file({ - 'dependencies': { - 'array-flatten': { + 'packages': { + 'node_modules/array-flatten': { 'version': '1.1.1', 'resolved': 'https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz', 'integrity': 'sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=' @@ -2981,8 +2958,8 @@ class NPMTest(FetcherTest): self.d.setVar('BB_NO_NETWORK', '1') # Fetch again swfile = self.create_shrinkwrap_file({ - 'dependencies': { - 'array-flatten': { + 'packages': { + 'node_modules/array-flatten': { 'version': '1.1.1', 'resolved': 'https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz', 'integrity': 'sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=' @@ -2998,8 +2975,8 @@ class NPMTest(FetcherTest): def test_npmsw_npm_reusability(self): # Fetch once with npmsw swfile = self.create_shrinkwrap_file({ - 'dependencies': { - 'array-flatten': { + 'packages': { + 'node_modules/array-flatten': { 'version': '1.1.1', 'resolved': 'https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz', 'integrity': 'sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=' @@ -3020,8 +2997,8 @@ class NPMTest(FetcherTest): def test_npmsw_bad_checksum(self): # Try to fetch with bad checksum swfile = self.create_shrinkwrap_file({ - 'dependencies': { - 'array-flatten': { + 'packages': { + 'node_modules/array-flatten': { 'version': '1.1.1', 'resolved': 'https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz', 'integrity': 'sha1-gfNEp2hqgLTFKT6P3AsBYMgsBqg=' @@ -3033,8 +3010,8 @@ class NPMTest(FetcherTest): fetcher.download() # Fetch correctly to get a tarball swfile = self.create_shrinkwrap_file({ - 'dependencies': { - 'array-flatten': { + 'packages': { + 'node_modules/array-flatten': { 'version': '1.1.1', 'resolved': 'https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz', 'integrity': 'sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=' @@ -3072,8 +3049,8 @@ class NPMTest(FetcherTest): # Fetch again self.assertFalse(os.path.exists(ud.localpath)) swfile = self.create_shrinkwrap_file({ - 'dependencies': { - 'array-flatten': { + 'packages': { + 'node_modules/array-flatten': { 'version': '1.1.1', 'resolved': 'https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz', 'integrity': 'sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=' @@ -3100,8 +3077,8 @@ class NPMTest(FetcherTest): # Fetch again with invalid url self.assertFalse(os.path.exists(ud.localpath)) swfile = self.create_shrinkwrap_file({ - 'dependencies': { - 'array-flatten': { + 'packages': { + 'node_modules/array-flatten': { 'version': '1.1.1', 'resolved': 'https://invalid', 'integrity': 'sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=' @@ -3114,29 +3091,25 @@ class NPMTest(FetcherTest): @skipIfNoNetwork() def test_npmsw_bundled(self): - for packages_key, package_prefix, bundled_key in [ - ('dependencies', '', 'bundled'), - ('packages', 'node_modules/', 'inBundle') - ]: - swfile = self.create_shrinkwrap_file({ - packages_key: { - package_prefix + 'array-flatten': { - 'version': '1.1.1', - 'resolved': 'https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz', - 'integrity': 'sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=' - }, - package_prefix + 'content-type': { - 'version': '1.0.4', - 'resolved': 'https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz', - 'integrity': 'sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==', - bundled_key: True - } + swfile = self.create_shrinkwrap_file({ + 'packages': { + 'node_modules/array-flatten': { + 'version': '1.1.1', + 'resolved': 'https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz', + 'integrity': 'sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=' + }, + 'node_modules/content-type': { + 'version': '1.0.4', + 'resolved': 'https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz', + 'integrity': 'sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==', + 'inBundle': True } - }) - fetcher = bb.fetch.Fetch(['npmsw://' + swfile], self.d) - fetcher.download() - self.assertTrue(os.path.exists(os.path.join(self.dldir, 'npm2', 'array-flatten-1.1.1.tgz'))) - self.assertFalse(os.path.exists(os.path.join(self.dldir, 'npm2', 'content-type-1.0.4.tgz'))) + } + }) + fetcher = bb.fetch.Fetch(['npmsw://' + swfile], self.d) + fetcher.download() + self.assertTrue(os.path.exists(os.path.join(self.dldir, 'npm2', 'array-flatten-1.1.1.tgz'))) + self.assertFalse(os.path.exists(os.path.join(self.dldir, 'npm2', 'content-type-1.0.4.tgz'))) class GitSharedTest(FetcherTest): def setUp(self): From patchwork Tue Jan 7 09:17:54 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Herbrechtsmeier X-Patchwork-Id: 55105 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 D76A4E7719C for ; Tue, 7 Jan 2025 09:18:26 +0000 (UTC) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (EUR05-VI1-obe.outbound.protection.outlook.com [40.107.21.132]) by mx.groups.io with SMTP id smtpd.web10.16695.1736241496534764322 for ; Tue, 07 Jan 2025 01:18:19 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@weidmueller.com header.s=selector2 header.b=ncD7T5DF; spf=pass (domain: weidmueller.com, ip: 40.107.21.132, mailfrom: stefan.herbrechtsmeier-oss@weidmueller.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=gp7rIWXBnuPEj9uLQ3qaZquEPS3IJ5tJT8Fzzag8H4HbuKnYAKA8rpZezMIS39Xze4ScBN75WgTROUpm+SNKDZWEEbrAfUyyP6t6zbSxrPibpe8eNWhi9jiyWGWgEgweJRbc9GZfmJm5X6FMTubKYmRVDpiYmbJ1SpX8gd1Sekc7Gv5mpgqH7lIa4yWbmxA5IKD3XOQTnlsmeXzt5R8/3tIVb0FyPXtzrhcF4QR+TPMzeLq1Ky6MqcZBaWGemOJmnVeZ8C4EjYKS27e4/sPHBJgSFsd+XYPwXca6KPxJ5QcNmiaKLaBCcC49lsZmP9yRXRyVMD5YuUP/jc9mXodx8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=aTPZuyQ3aOrnIzP3GZtpG3WFcmfRMw3Q23kRVyZCQTM=; b=pQOhC/emy1v5u2xx0vs+nGso1dQ9wQp1nxA/BVXoB7rOb9b8q9fOUE8zznZcalIq4QtDYyEb7HcLSkHEoq67FnN9BYJqcDuU6oQeKkuJfgTB/soc84IpmlQPheONo6rI7o4En6c36JhQuKsSQM+PXE4ZVgHQv1Kjt6j80jBf/et5HC1i7s8VpR4AvDzCFi9GlxN7BhMxj3mO1hDFUB0jICqgpSJ7ZHDMZ00vh7umIk/Fm/J328v7O1nKFtWeos4vpClwkX6yF+yZPUcKn0Tw60Y7q1P6092HZ/Vk9qiAdVCsYagck6f3zHsAIf6G/PZYkmo2p7Hl8ziQHFVKNMYmDw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=weidmueller.com; dmarc=pass action=none header.from=weidmueller.com; dkim=pass header.d=weidmueller.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=weidmueller.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=aTPZuyQ3aOrnIzP3GZtpG3WFcmfRMw3Q23kRVyZCQTM=; b=ncD7T5DF7bredU/tmm0FtNfkHlgJity5vgAs7zPR77wcHxLdcBl7HRIFDEkF2xOFAGFw6bA+YfYp2vGVxLPLC2w0jSIYXPgJCCJrbyAcCXezaLjIiXxYbCsjxqBsBbr9xuiKwGCE51wxWN0UgT0bfK8qekggREMd1NdQ70fl4g/6yLPXt04X+Tm8bZufEqLGCNNLixIlYLMGmRyNRupnY5X/MRFAyYdvj5y6aFDXlHVps4GvmluphKQenro/ygFOU3GEycfo4J7SrTDGpA7Nw4y2O7kdSvzky+448011e8iEma89XjxayYKLxCbnAm9uewEVbMWLhjKwzxkiUDl8tg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=weidmueller.com; Received: from PAXPR08MB6969.eurprd08.prod.outlook.com (2603:10a6:102:1d8::23) by GV1PR08MB10607.eurprd08.prod.outlook.com (2603:10a6:150:16c::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8314.18; Tue, 7 Jan 2025 09:18:13 +0000 Received: from PAXPR08MB6969.eurprd08.prod.outlook.com ([fe80::3b1:b329:1ed9:dad4]) by PAXPR08MB6969.eurprd08.prod.outlook.com ([fe80::3b1:b329:1ed9:dad4%3]) with mapi id 15.20.8314.015; Tue, 7 Jan 2025 09:18:13 +0000 From: Stefan Herbrechtsmeier To: bitbake-devel@lists.openembedded.org CC: Stefan Herbrechtsmeier Subject: [PATCH 2/5] fetch2: npmsw: remove old lockfile format support Date: Tue, 7 Jan 2025 10:17:54 +0100 Message-ID: <20250107091757.886-3-stefan.herbrechtsmeier-oss@weidmueller.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250107091757.886-1-stefan.herbrechtsmeier-oss@weidmueller.com> References: <20250107091757.886-1-stefan.herbrechtsmeier-oss@weidmueller.com> X-ClientProxiedBy: FR4P281CA0015.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:c8::7) To PAXPR08MB6969.eurprd08.prod.outlook.com (2603:10a6:102:1d8::23) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR08MB6969:EE_|GV1PR08MB10607:EE_ X-MS-Office365-Filtering-Correlation-Id: b9b0cd9d-d4ba-43d4-1b6a-08dd2efc35fa X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|52116014|366016|38350700014; X-Microsoft-Antispam-Message-Info: odFTDUcbZPAtAvfjmS/I5wBNVEiY8/xwvjHSBh+OVSni+0G4ax31btJyPTYoHH/v2W2CwKFodV+FbBxXLS9r8bIwi2sarHISHA/3qBvomjSoszjrn3OoHYFOCuFRHhWf0L46IgiPM7dBoEzrc2u/Ku3Qg4SRMAHnqFt0KoZ7ilHZoId8Q+wkcPUEDjGBfbEkEkz9URAZ9rwajKqo69dREnwqGsaTxIEnN1xN4ED+X7LkSDyaSaKOqXDukhZaiH4ezddc10jD0H8EQRNJp5tgYC789ohccZlaJq4zYwTER5wCXb9DEaL4k7VTv+TFMVCYmgdpt0hfjP2A72mzS1dgS3zGQv1MsIz52li2EaUklxvOoKPaHsfEI3CnDrMiB/m9+Mc1VnjNbgVfXW/TB9Gwkd9KAs+TCULWwIpwarVcHHWr+g2fBkQRvvZfQC+30a5TiLkWFnGElWDRE+6l+0AL9uN6uIJa/Oio+EcbFUP4FOgJ+7SARoLdP9oyd4pRMaKfngBz+2Qns69xNka75QxIyhXashMh0oL13UkMucFmqWsjO0nYDJf1PNgL01K4NmL5pReci96toBOvHPDcfuhQvW1r5Rl9PfKl6neADTVuJ9qwhT1sY0xIt7/YcMMrRe69t6GQGyPLNSak2KQy1mOhn8mM5rzpeK55XEM+8VuMMRFUj5BgxuL3x0zTGIAXFE4+xPmaKFX1TSwPE8p2icn/xw2DLBC0P80uEPc1sy3wVx95hH/CxG8wwRD10xsYENiHCcCjqdgQOw4j2wNvPoyj+x0q1qP5+wyBLPqbUkWlS9HlleL9iOCeDWvAEfZEkkzUyHsJ5bpjzm5Fl3G+kEB/KZeaNth3NqBQkb7M4p7NHzVLserGSaBzD3GGlsmFeC4E4EGuqkpsN+4EEZp78Ini2LICpqcnmYmOICvyNxlarqNUwmXI7TPzg6t8lb+hKe53k+HpfURmtmPR6qlN1WlXmOohxOvKNz+yQA5vSSzBxsaQGzosFcwPxIlHEquBOGqlhDiw0bLgQ4to6RXggRiQbJNl9lNsyM8D6PASl062/3b/sLzRo/ZUkvARVV8EOhmiYtCywiPhdTTm+qAJeAKDSlwf8BK6fM8PWV7Bt6VY3yGzd75BQ+WM0wuE1DoHCiKDUK4UsRG0b/OTP7CF/zjhVgzxgWSJyKjaJeJXegqHiXSEmZ7C3mdFqJQM3pw7cJQYr5Zn4wz+EantBI3YAIdozZm4Iwi4uEhFADxK7sAHngHM+qKLFaWqRyefF3x0fpV74PmGK+MfCasbVDu3m8AsbEj+dFINEfNx2PsV3lYqk4lyYVHlf9bSrSvVYjTOZdsBdzCmom06DNnfMLTNUDHtYMCrhPNQalvOutnP3Gb8BmZfWin7PIioH1grZxA4gg8W X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR08MB6969.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(376014)(52116014)(366016)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: dyLR+cr53RCmbd1CkrHzSW95EtnTxG+TD1H+2Dl0UrebZMtBxjz3BCvKctel2BHA/D6e4cCcE0i5grdHQU8DzTbDd8D+xWmHgN63bqWKBNY05OQ56lIGncYT/JdL3Zc7K9IJoRShYsRENWrB8qQyVHDYM8QYxR51NcDgFijhM0JBnxSj9ZOjArHgxW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wJdoQL9WNZ4VgEHQfPWnLrPR/2L29vBjFpY1zvzxrsTVwikawY9QjY0VdVm14rnwLduYCH/hhTZZsSMtS/+n2OBjFDvRkZnSf9kVj2Y3CzA3AArs/jBTelRypP56OncPkiLI3YVLInt3YFciKu/eg31MqJ0LYB9xvRv5GHVe4h/dMLwZasNIWY7kuukfNySxM4k3iQvDGNQQIpKNF3XXzuvVqBJL+o1oVNaHZ8pSxE3FM21LhoxGWApujx7vmQOC7SE9uLFiroFxUr0esEzNItNInIJ6uUDVyICt20ab2AEadY8K3aL+5S0X7xXE59hJ1VddSF3sqYiyQetJlvtLh8Wou8ggQf+A== X-OriginatorOrg: weidmueller.com X-MS-Exchange-CrossTenant-Network-Message-Id: b9b0cd9d-d4ba-43d4-1b6a-08dd2efc35fa X-MS-Exchange-CrossTenant-AuthSource: PAXPR08MB6969.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jan 2025 09:18:13.1068 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: e4289438-1c5f-4c95-a51a-ee553b8b18ec X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: HFKjLIUNxXK44PZBZj7svIwFV9rzfzt6ykusaDGhawAluRf/bAKLYM+qwaLdK08CnzDr2Aw7AjD5bQ1fx7u9tA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR08MB10607 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 ; Tue, 07 Jan 2025 09:18:26 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/16971 From: Stefan Herbrechtsmeier Remove support for the old lockfile format. The old lockfile format is required by npm 6 / Node.js 14 which is out of maintenance [2]. [1] https://docs.npmjs.com/cli/v6/configuring-npm/package-lock-json [2] https://nodejs.org/en/about/previous-releases Signed-off-by: Stefan Herbrechtsmeier --- lib/bb/fetch2/npmsw.py | 97 ++++++++++++++++-------------------------- 1 file changed, 36 insertions(+), 61 deletions(-) diff --git a/lib/bb/fetch2/npmsw.py b/lib/bb/fetch2/npmsw.py index 558c9a2b0..2f9599ee9 100644 --- a/lib/bb/fetch2/npmsw.py +++ b/lib/bb/fetch2/npmsw.py @@ -37,40 +37,26 @@ def foreach_dependencies(shrinkwrap, callback=None, dev=False): """ Run a callback for each dependencies of a shrinkwrap file. The callback is using the format: - callback(name, params, deptree) + callback(name, data, location) with: name = the package name (string) - params = the package parameters (dictionary) - destdir = the destination of the package (string) + data = the package data (dictionary) + location = the location of the package (string) """ - # For handling old style dependencies entries in shinkwrap files - def _walk_deps(deps, deptree): - for name in deps: - subtree = [*deptree, name] - _walk_deps(deps[name].get("dependencies", {}), subtree) - if callback is not None: - if deps[name].get("dev", False) and not dev: - continue - elif deps[name].get("bundled", False): - continue - destsubdirs = [os.path.join("node_modules", dep) for dep in subtree] - destsuffix = os.path.join(*destsubdirs) - callback(name, deps[name], destsuffix) - - # packages entry means new style shrinkwrap file, else use dependencies - packages = shrinkwrap.get("packages", None) - if packages is not None: - for package in packages: - if package != "": - name = package.split('node_modules/')[-1] - package_infos = packages.get(package, {}) - if dev == False and package_infos.get("dev", False): - continue - elif package_infos.get("inBundle", False): - continue - callback(name, package_infos, package) - else: - _walk_deps(shrinkwrap.get("dependencies", {}), []) + packages = shrinkwrap.get("packages") + if not packages: + raise FetchError("Invalid shrinkwrap file format") + + for location, data in packages.items(): + # Skip empty main and local link target packages + if not location.startswith('node_modules/'): + continue + elif not dev and data.get("dev", False): + continue + elif data.get("inBundle", False): + continue + name = location.split('node_modules/')[-1] + callback(name, data, location) class NpmShrinkWrap(FetchMethod): """Class to fetch all package from a shrinkwrap file""" @@ -97,12 +83,18 @@ class NpmShrinkWrap(FetchMethod): extrapaths = [] unpack = True - integrity = params.get("integrity", None) - resolved = params.get("resolved", None) - version = params.get("version", resolved) + integrity = params.get("integrity") + resolved = params.get("resolved") + version = params.get("version") + link = params.get("link", False) + + # Handle link sources + if link: + localpath = resolved + unpack = False # Handle registry sources - if is_semver(version) and integrity: + elif version and is_semver(version) and integrity: # Handle duplicate dependencies without url if not resolved: return @@ -130,10 +122,10 @@ class NpmShrinkWrap(FetchMethod): extrapaths.append(resolvefile) # Handle http tarball sources - elif version.startswith("http") and integrity: - localfile = npm_localfile(os.path.basename(version)) + elif resolved.startswith("http") and integrity: + localfile = npm_localfile(os.path.basename(resolved)) - uri = URI(version) + uri = URI(resolved) uri.params["downloadfilename"] = localfile checksum_name, checksum_expected = npm_integrity(integrity) @@ -143,28 +135,12 @@ class NpmShrinkWrap(FetchMethod): localpath = os.path.join(d.getVar("DL_DIR"), localfile) - # Handle local tarball and link sources - elif version.startswith("file"): - localpath = version[5:] - if not version.endswith(".tgz"): - unpack = False + # Handle local tarball sources + elif resolved.startswith("file"): + localpath = resolved[5:] # Handle git sources - elif version.startswith(("git", "bitbucket","gist")) or ( - not version.endswith((".tgz", ".tar", ".tar.gz")) - and not version.startswith((".", "@", "/")) - and "/" in version - ): - if version.startswith("github:"): - version = "git+https://github.com/" + version[len("github:"):] - elif version.startswith("gist:"): - version = "git+https://gist.github.com/" + version[len("gist:"):] - elif version.startswith("bitbucket:"): - version = "git+https://bitbucket.org/" + version[len("bitbucket:"):] - elif version.startswith("gitlab:"): - version = "git+https://gitlab.com/" + version[len("gitlab:"):] - elif not version.startswith(("git+","git:")): - version = "git+https://github.com/" + version + elif resolved.startswith("git"): regex = re.compile(r""" ^ git\+ @@ -176,10 +152,9 @@ class NpmShrinkWrap(FetchMethod): $ """, re.VERBOSE) - match = regex.match(version) - + match = regex.match(resolved) if not match: - raise ParameterError("Invalid git url: %s" % version, ud.url) + raise ParameterError("Invalid git url: %s" % resolved, ud.url) groups = match.groupdict() From patchwork Tue Jan 7 09:17:55 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Herbrechtsmeier X-Patchwork-Id: 55102 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 C4E66C3DA4A for ; Tue, 7 Jan 2025 09:18:26 +0000 (UTC) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (EUR05-VI1-obe.outbound.protection.outlook.com [40.107.21.132]) by mx.groups.io with SMTP id smtpd.web10.16695.1736241496534764322 for ; Tue, 07 Jan 2025 01:18:19 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@weidmueller.com header.s=selector2 header.b=1XSAwyOG; spf=pass (domain: weidmueller.com, ip: 40.107.21.132, mailfrom: stefan.herbrechtsmeier-oss@weidmueller.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=DJEdMLbMHvOtBTO9y0th42lZKuYSp80tuAUkfmENErBHzNjVn34aVzptK28Oxq55ncd0qCUg9DjQjgbw5CwAw7aSHt0fCRIzBXJLLuNJAVBbXN8n0taOsU6yKHWq1R0nNIfeplbgkI0T645YQT3dSUVYAjNdhG/R4V9tnyElL9eiebPTt2IaPyk377GzDGt7i06i0zv3TfSrrt4zHc1qfH4AULCfgEWSD/6B7n5lOhYxgJkLGgd/tCXJ597fLgkivx6kyMpZWC5Q2bLh61+9A3w2G2K78O02oRU7RdQmf4A0EG9op8roDBvvCB5qaRExSrk4F+WkBE0K4148dwFh2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=tECYzinVbDQxMsSSm81qc/TD7t7q7X2mvyztaVAu010=; b=wIvUUygOT7r0obdzXIiZZlHDWTnugif2gvPUmyLeUwKovQ4s4Np2DchaAVOAD44AolVZUJh8dRmzx0+y1d98zRM2CE9hMt1MTgcFZRu350E9xpAarF7KAliZdg/9Hb3gFWpsHTVjRX7jVoJJGFnwCp0TXvQOCl5Bw2wEm/DjiygBpdfnnV5KFRAktcM1Tef8Gt+VAT4ZS/4OJSCBjEHVr17NAbxZGN4ms7o/llNwy/wrA6V3x3nvzdCzUOna7ARq6L41gCMRNntkGXGpsJ5ZrY/6jZlDZq2dt6MdoY8f6Y+2/gr9AfCCR46n1w46sIppXa9/xuBWD8GuT25nirWoLA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=weidmueller.com; dmarc=pass action=none header.from=weidmueller.com; dkim=pass header.d=weidmueller.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=weidmueller.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tECYzinVbDQxMsSSm81qc/TD7t7q7X2mvyztaVAu010=; b=1XSAwyOGP8xkIIOy33TzSQHeOHKnfUPd8Ba6rH0/jlDkmYcBM9GrEOr1bP3QzidLNhPMI3s67+7m/PT9/jzs4h/Mkijo1XFYKGvmTIXkrM4Rh6FwVZJu7HE2cK/cseV7Qlf8EXRO78+9c+wsFHjL+hVXrk5lSdcBgjFMu5azfRiO8rAgOsKAZTvTCzT+eB/L7yUV9ZVKR176OnLJpQWdZkrVREBbm6/25FajaWiIvZfgEc3ztH7tBeKKhLL8ZFBAMVa9nIZ1RMqIbr25rnvKfb7SUL3Kh7XLBVl3eoNYC28Y/eHd9RY3tExF95iuee6vV3yHP5WoMULuufzztzN1qA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=weidmueller.com; Received: from PAXPR08MB6969.eurprd08.prod.outlook.com (2603:10a6:102:1d8::23) by GV1PR08MB10607.eurprd08.prod.outlook.com (2603:10a6:150:16c::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8314.18; Tue, 7 Jan 2025 09:18:14 +0000 Received: from PAXPR08MB6969.eurprd08.prod.outlook.com ([fe80::3b1:b329:1ed9:dad4]) by PAXPR08MB6969.eurprd08.prod.outlook.com ([fe80::3b1:b329:1ed9:dad4%3]) with mapi id 15.20.8314.015; Tue, 7 Jan 2025 09:18:14 +0000 From: Stefan Herbrechtsmeier To: bitbake-devel@lists.openembedded.org CC: Stefan Herbrechtsmeier Subject: [PATCH 3/5] tests: fetch: replace [url] with urls for npm Date: Tue, 7 Jan 2025 10:17:55 +0100 Message-ID: <20250107091757.886-4-stefan.herbrechtsmeier-oss@weidmueller.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250107091757.886-1-stefan.herbrechtsmeier-oss@weidmueller.com> References: <20250107091757.886-1-stefan.herbrechtsmeier-oss@weidmueller.com> X-ClientProxiedBy: FR4P281CA0015.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:c8::7) To PAXPR08MB6969.eurprd08.prod.outlook.com (2603:10a6:102:1d8::23) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR08MB6969:EE_|GV1PR08MB10607:EE_ X-MS-Office365-Filtering-Correlation-Id: f14058fc-44e3-4e4b-351a-08dd2efc366a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|52116014|366016|38350700014; X-Microsoft-Antispam-Message-Info: q1i3hT5+P/zA8Lv8EJDKnoxCGq9KIxLdrzme7AKUo5cERbdC/oIKsgNly/tG+Ex7TLoAFEI8eTR8nlh3OuFsKQR1Zpj1m3KJAMvo10dCnXkoO+lyHnrVBaYKWCQwf3E0PrdRpLWt8Vk2N6HZApFW99yz4NHk/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oNNGZSkkWL0fXKevuvhBk/kl/ChN3Nh8bz53nGZo3pOU8s60vlSXvBP6vKTbTEhEsU7VzuekhID2qacTAaRzxVXEqUzmpyX3PfD9iRQABVJVsVvR72OeAAW8vSJEvz9qrJ78c0aBjaknk+uAkYObtNuy5i5wB5jza3HT5IgTVxbhPVvGdsI1SOEfddFDy6s7osjTwOjsrk9KHDT75rpFLsow3z+gxc+qYE9ajQBZub X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR08MB6969.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(376014)(52116014)(366016)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: xj5dm8cW6Hen0eqOOPGb/oMSigeKJuLSWP6ZIa2i4lICef6hFIwiBqxS9CqCvNgWTZoD5MiuInXnkkZeObjpENH6ZiiTRKfhq4bmIjsYeJU4H1SE9uN1Il5IDuL6PXsEW0VX9XqoBIRaNe6AIJ4nSLG4A6Qbp7JxOlBVbR+7lABFb7fw8TnKQ3eZxz6gqqMpuxD+ZsrfCktdLiVNj1J+rtXqUCf1Hcq88z4kKYje9Q0BbMR5Ex6o7TTJ80B5wvTy8QUouGZ/CzSkZW62dHtbMVuIOKfFyYkeRRQiwJ1PpHm5qRtqKZXN4HOfG6iRfmkI7k41RXFTZxf5pohMHR2ffDF2JxWK7RhXZcMz1t94PeBaxlveqqOyPQY2ptN30/Eiey/vdLKfqiY4AQmN1/2hbtkNPD5oYD3yGMNd404BZbwG7bHTn4gk9XDUvUsLWC6DfmIg6dxBSgYhHPNeXgvDSFy/Q5lbiUoN+tC8Glklnum1jdDAt2nKzxf+M6hU/PQ6mwHTZOlsa8JW5YRTgJHtD300oY3Q9tKZJhBMXg32P7Q35YQvAoDj4ADJUN0dWtjAIoTJRxYDc4SFMb5YDyTbWHBzuL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e3-4e4b-351a-08dd2efc366a X-MS-Exchange-CrossTenant-AuthSource: PAXPR08MB6969.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jan 2025 09:18:13.7327 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: e4289438-1c5f-4c95-a51a-ee553b8b18ec X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: BCsyBUj1kxoCzmf/M7MiPBn4+WZq/Ob4NUvdokQx8mRK8+yazuxAcjF9UJ3FDR2hWuWlgqIHnMQBl+Kfw9fE5Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR08MB10607 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 ; Tue, 07 Jan 2025 09:18:26 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/16972 From: Stefan Herbrechtsmeier Replace [url] with urls to simplify future modifications. Signed-off-by: Stefan Herbrechtsmeier --- lib/bb/tests/fetch.py | 66 +++++++++++++++++++++---------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/lib/bb/tests/fetch.py b/lib/bb/tests/fetch.py index b89348236..c5ec84dc5 100644 --- a/lib/bb/tests/fetch.py +++ b/lib/bb/tests/fetch.py @@ -2627,8 +2627,8 @@ class NPMTest(FetcherTest): @skipIfNoNpm() @skipIfNoNetwork() def test_npm(self): - url = 'npm://registry.npmjs.org;package=@savoirfairelinux/node-server-example;version=1.0.0' - fetcher = bb.fetch.Fetch([url], self.d) + urls = ['npm://registry.npmjs.org;package=@savoirfairelinux/node-server-example;version=1.0.0'] + fetcher = bb.fetch.Fetch(urls, self.d) ud = fetcher.ud[fetcher.urls[0]] fetcher.download() self.assertTrue(os.path.exists(ud.localpath)) @@ -2641,9 +2641,9 @@ class NPMTest(FetcherTest): @skipIfNoNpm() @skipIfNoNetwork() def test_npm_bad_checksum(self): - url = 'npm://registry.npmjs.org;package=@savoirfairelinux/node-server-example;version=1.0.0' + urls = ['npm://registry.npmjs.org;package=@savoirfairelinux/node-server-example;version=1.0.0'] # Fetch once to get a tarball - fetcher = bb.fetch.Fetch([url], self.d) + fetcher = bb.fetch.Fetch(urls, self.d) ud = fetcher.ud[fetcher.urls[0]] fetcher.download() self.assertTrue(os.path.exists(ud.localpath)) @@ -2660,9 +2660,9 @@ class NPMTest(FetcherTest): @skipIfNoNpm() @skipIfNoNetwork() def test_npm_premirrors(self): - url = 'npm://registry.npmjs.org;package=@savoirfairelinux/node-server-example;version=1.0.0' + urls = ['npm://registry.npmjs.org;package=@savoirfairelinux/node-server-example;version=1.0.0'] # Fetch once to get a tarball - fetcher = bb.fetch.Fetch([url], self.d) + fetcher = bb.fetch.Fetch(urls, self.d) ud = fetcher.ud[fetcher.urls[0]] fetcher.download() self.assertTrue(os.path.exists(ud.localpath)) @@ -2682,7 +2682,7 @@ class NPMTest(FetcherTest): # while the fetcher object exists, which it does when we rename the # download directory to "mirror" above. Thus we need a new fetcher to go # with the now empty download directory. - fetcher = bb.fetch.Fetch([url], self.d) + fetcher = bb.fetch.Fetch(urls, self.d) ud = fetcher.ud[fetcher.urls[0]] fetcher.download() self.assertTrue(os.path.exists(ud.localpath)) @@ -2690,9 +2690,9 @@ class NPMTest(FetcherTest): @skipIfNoNpm() @skipIfNoNetwork() def test_npm_premirrors_with_specified_filename(self): - url = 'npm://registry.npmjs.org;package=@savoirfairelinux/node-server-example;version=1.0.0' + urls = ['npm://registry.npmjs.org;package=@savoirfairelinux/node-server-example;version=1.0.0'] # Fetch once to get a tarball - fetcher = bb.fetch.Fetch([url], self.d) + fetcher = bb.fetch.Fetch(urls, self.d) ud = fetcher.ud[fetcher.urls[0]] fetcher.download() self.assertTrue(os.path.exists(ud.localpath)) @@ -2712,8 +2712,8 @@ class NPMTest(FetcherTest): @skipIfNoNetwork() def test_npm_mirrors(self): # Fetch once to get a tarball - url = 'npm://registry.npmjs.org;package=@savoirfairelinux/node-server-example;version=1.0.0' - fetcher = bb.fetch.Fetch([url], self.d) + urls = ['npm://registry.npmjs.org;package=@savoirfairelinux/node-server-example;version=1.0.0'] + fetcher = bb.fetch.Fetch(urls, self.d) ud = fetcher.ud[fetcher.urls[0]] fetcher.download() self.assertTrue(os.path.exists(ud.localpath)) @@ -2737,8 +2737,8 @@ class NPMTest(FetcherTest): @skipIfNoNpm() @skipIfNoNetwork() def test_npm_destsuffix_downloadfilename(self): - url = 'npm://registry.npmjs.org;package=@savoirfairelinux/node-server-example;version=1.0.0;destsuffix=foo/bar;downloadfilename=foo-bar.tgz' - fetcher = bb.fetch.Fetch([url], self.d) + urls = ['npm://registry.npmjs.org;package=@savoirfairelinux/node-server-example;version=1.0.0;destsuffix=foo/bar;downloadfilename=foo-bar.tgz'] + fetcher = bb.fetch.Fetch(urls, self.d) fetcher.download() self.assertTrue(os.path.exists(os.path.join(self.dldir, 'npm2', 'foo-bar.tgz'))) fetcher.unpack(self.unpackdir) @@ -2746,18 +2746,18 @@ class NPMTest(FetcherTest): self.assertTrue(os.path.exists(os.path.join(unpackdir, 'package.json'))) def test_npm_no_network_no_tarball(self): - url = 'npm://registry.npmjs.org;package=@savoirfairelinux/node-server-example;version=1.0.0' + urls = ['npm://registry.npmjs.org;package=@savoirfairelinux/node-server-example;version=1.0.0'] self.d.setVar('BB_NO_NETWORK', '1') - fetcher = bb.fetch.Fetch([url], self.d) + fetcher = bb.fetch.Fetch(urls, self.d) with self.assertRaises(bb.fetch2.NetworkAccess): fetcher.download() @skipIfNoNpm() @skipIfNoNetwork() def test_npm_no_network_with_tarball(self): - url = 'npm://registry.npmjs.org;package=@savoirfairelinux/node-server-example;version=1.0.0' + urls = ['npm://registry.npmjs.org;package=@savoirfairelinux/node-server-example;version=1.0.0'] # Fetch once to get a tarball - fetcher = bb.fetch.Fetch([url], self.d) + fetcher = bb.fetch.Fetch(urls, self.d) fetcher.download() # Disable network access self.d.setVar('BB_NO_NETWORK', '1') @@ -2770,8 +2770,8 @@ class NPMTest(FetcherTest): @skipIfNoNpm() @skipIfNoNetwork() def test_npm_registry_alternate(self): - url = 'npm://skimdb.npmjs.com;package=@savoirfairelinux/node-server-example;version=1.0.0' - fetcher = bb.fetch.Fetch([url], self.d) + urls = ['npm://skimdb.npmjs.com;package=@savoirfairelinux/node-server-example;version=1.0.0'] + fetcher = bb.fetch.Fetch(urls, self.d) fetcher.download() fetcher.unpack(self.unpackdir) unpackdir = os.path.join(self.unpackdir, 'npm') @@ -2780,8 +2780,8 @@ class NPMTest(FetcherTest): @skipIfNoNpm() @skipIfNoNetwork() def test_npm_version_latest(self): - url = 'npm://registry.npmjs.org;package=@savoirfairelinux/node-server-example;version=latest' - fetcher = bb.fetch.Fetch([url], self.d) + url = ['npm://registry.npmjs.org;package=@savoirfairelinux/node-server-example;version=latest'] + fetcher = bb.fetch.Fetch(urls, self.d) fetcher.download() fetcher.unpack(self.unpackdir) unpackdir = os.path.join(self.unpackdir, 'npm') @@ -2790,46 +2790,46 @@ class NPMTest(FetcherTest): @skipIfNoNpm() @skipIfNoNetwork() def test_npm_registry_invalid(self): - url = 'npm://registry.invalid.org;package=@savoirfairelinux/node-server-example;version=1.0.0' - fetcher = bb.fetch.Fetch([url], self.d) + urls = ['npm://registry.invalid.org;package=@savoirfairelinux/node-server-example;version=1.0.0'] + fetcher = bb.fetch.Fetch(urls, self.d) with self.assertRaises(bb.fetch2.FetchError): fetcher.download() @skipIfNoNpm() @skipIfNoNetwork() def test_npm_package_invalid(self): - url = 'npm://registry.npmjs.org;package=@savoirfairelinux/invalid;version=1.0.0' - fetcher = bb.fetch.Fetch([url], self.d) + urls = ['npm://registry.npmjs.org;package=@savoirfairelinux/invalid;version=1.0.0'] + fetcher = bb.fetch.Fetch(urls, self.d) with self.assertRaises(bb.fetch2.FetchError): fetcher.download() @skipIfNoNpm() @skipIfNoNetwork() def test_npm_version_invalid(self): - url = 'npm://registry.npmjs.org;package=@savoirfairelinux/node-server-example;version=invalid' + urls = ['npm://registry.npmjs.org;package=@savoirfairelinux/node-server-example;version=invalid'] with self.assertRaises(bb.fetch2.ParameterError): - fetcher = bb.fetch.Fetch([url], self.d) + fetcher = bb.fetch.Fetch(urls, self.d) @skipIfNoNpm() @skipIfNoNetwork() def test_npm_registry_none(self): - url = 'npm://;package=@savoirfairelinux/node-server-example;version=1.0.0' + urls = ['npm://;package=@savoirfairelinux/node-server-example;version=1.0.0'] with self.assertRaises(bb.fetch2.MalformedUrl): - fetcher = bb.fetch.Fetch([url], self.d) + fetcher = bb.fetch.Fetch(urls, self.d) @skipIfNoNpm() @skipIfNoNetwork() def test_npm_package_none(self): - url = 'npm://registry.npmjs.org;version=1.0.0' + urls = ['npm://registry.npmjs.org;version=1.0.0'] with self.assertRaises(bb.fetch2.MissingParameterError): - fetcher = bb.fetch.Fetch([url], self.d) + fetcher = bb.fetch.Fetch(urls, self.d) @skipIfNoNpm() @skipIfNoNetwork() def test_npm_version_none(self): - url = 'npm://registry.npmjs.org;package=@savoirfairelinux/node-server-example' + urls = ['npm://registry.npmjs.org;package=@savoirfairelinux/node-server-example'] with self.assertRaises(bb.fetch2.MissingParameterError): - fetcher = bb.fetch.Fetch([url], self.d) + fetcher = bb.fetch.Fetch(urls, self.d) def create_shrinkwrap_file(self, data): import json From patchwork Tue Jan 7 09:17:56 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Herbrechtsmeier X-Patchwork-Id: 55104 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 B486EE77198 for ; Tue, 7 Jan 2025 09:18:26 +0000 (UTC) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (EUR05-VI1-obe.outbound.protection.outlook.com [40.107.21.132]) by mx.groups.io with SMTP id smtpd.web10.16695.1736241496534764322 for ; Tue, 07 Jan 2025 01:18:20 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@weidmueller.com header.s=selector2 header.b=je3SrEpL; spf=pass (domain: weidmueller.com, ip: 40.107.21.132, mailfrom: stefan.herbrechtsmeier-oss@weidmueller.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=hpoAgpUhUNuEi+nZgxuJwl/vyWHmH426scs7QV8pt6nmsdXEKNh0e/egitwyFqlfZKCu2KxWrhZ2qnKVoi14FU/oSQz8dRImWW+Q2J6wLWh9bVlh4wrkUuGsT/mNpICGNVsgWhoVeBdOyyMo3P+wcpprrOEBHJmLqWqMQEfoU4LmIUc1QsA4grZOsaF9Ui6MAfc0VwP5tkVb3xMC/Me0AH7uYrsQgVgGEpMZtjmeJx3YwwXIjmQavyJnohxg68t+hBz90+O5d3nkxQnKT66S8jeif/+7JkxAqaN1UyRdIxHxvzylAxac5DEjbrLY2JluXzCg/m2EmSoCV9HyiJGW1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=YAH8aLxGBZMJvoHCM9F/eJsCXT6U6VjnD0ZS3FSViBI=; b=MeR0tTj2KZ+tg8/HrFqcXyaD/26AhEN9In8d7NpkPAn3suH6iJ2AzEFpezOWxBcRpNlmjGVdVuPUbHtF06XowvFP0KZ7NXXniaUxPAT0q2lSeBfswEYRzp7wvLM+ObgdMAShFNbYxzsEH/TiXNOaOBTZz8eWhYhEFrTU3xTlxixo+jXpusPbgXfW28Fsol5X8oRY20eAWwYCc2KxuZ7GckeZtZrPeSGNMmkbxXyzvYAdPttBmlxZwgaBLGAWf46zuaa/LSDzGTQPlLLyPgAFQvNa2yvZjZi6qbPoJQqvDtJRmuqC3R+xEI4z6e4LZ5NhcFGz1iTqwYgwvOzjhWaePA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=weidmueller.com; dmarc=pass action=none header.from=weidmueller.com; dkim=pass header.d=weidmueller.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=weidmueller.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YAH8aLxGBZMJvoHCM9F/eJsCXT6U6VjnD0ZS3FSViBI=; b=je3SrEpLk3kmhKJ038/DRnvJVEkXpXbOu0NYzpzOqqtNAwfIENAof6IfJFq6/AiXXuaXf5U1QpZ0GNUF9EFKbTHQcNjJ1q+jEqBSbwU3EHbb4ToRhJH/IVVQctDt3D3BPLeljQ5bYfitldL3UCSfwG6zHfC7CelZQHVORXr4VQbl00vr9jjTfm76Sw9VOtA5ewNuskP5RFwv1IaMFFbzewmPWk7xR2LCTCGt7fr7KmyQkgNPYXXSJ/+mC/S4XbWg8FbY7092otea4RWSoHAEfMeDFSkC8JK4gJk+fV6aUPivjPZPvjX4AlgT1DnXg4KBtBTCHx1bLdaVItvHQS8PhQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=weidmueller.com; Received: from PAXPR08MB6969.eurprd08.prod.outlook.com (2603:10a6:102:1d8::23) by GV1PR08MB10607.eurprd08.prod.outlook.com (2603:10a6:150:16c::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8314.18; Tue, 7 Jan 2025 09:18:14 +0000 Received: from PAXPR08MB6969.eurprd08.prod.outlook.com ([fe80::3b1:b329:1ed9:dad4]) by PAXPR08MB6969.eurprd08.prod.outlook.com ([fe80::3b1:b329:1ed9:dad4%3]) with mapi id 15.20.8314.015; Tue, 7 Jan 2025 09:18:14 +0000 From: Stefan Herbrechtsmeier To: bitbake-devel@lists.openembedded.org CC: Stefan Herbrechtsmeier Subject: [PATCH 4/5] fetch2: do not prefix embedded checksums Date: Tue, 7 Jan 2025 10:17:56 +0100 Message-ID: <20250107091757.886-5-stefan.herbrechtsmeier-oss@weidmueller.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250107091757.886-1-stefan.herbrechtsmeier-oss@weidmueller.com> References: <20250107091757.886-1-stefan.herbrechtsmeier-oss@weidmueller.com> X-ClientProxiedBy: FR4P281CA0015.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:c8::7) To PAXPR08MB6969.eurprd08.prod.outlook.com (2603:10a6:102:1d8::23) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR08MB6969:EE_|GV1PR08MB10607:EE_ X-MS-Office365-Filtering-Correlation-Id: 75a35ef8-813e-4d6a-d1e9-08dd2efc369e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|52116014|366016|38350700014; X-Microsoft-Antispam-Message-Info: eDpakb+ps2xEgjnScX0rzKFeCQEXkBLH0FThAc4nfeQ3qQvHhRBsHLablmkYC4Ourz68z6+h0DxdZpt5qPsxyy9U+9YlqUhHxfjAipHLSs5fFlCe5gORN7xvjM5kHPDabJUbEbtOWpKmUx7qQpnonbmfH9jZJy8IxKoLEfZC8K5SlfPqPW4kBZbY/iXiKK7+0OQnxfE6ELFuJiHBD8Ru65pVTrMqIM0q/QXCta0bh3D3D3hNq7U4b4I/9SiIuxy0A0yaoXPNRenF/5BRAXAj1xRzFamAv8MV1AP82qJJ5OWJevbBzyz9/74042uJAO+ub3XJ67UiTey26uZvgjFvoXwSDknDolwrm41PQSAkI8xHsSGp6N/CgW1YRgyC8x3PvUckfXbIZB9p/H0nV0cktW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RV:;IPV:NLI;SFV:NSPM;H:PAXPR08MB6969.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(376014)(52116014)(366016)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: AuOX61G5vcA0UmVnRis3WMs6xMSXtZIrhMMtxogSlhUxk8/IXKkQzdjLK4CPpcVwbkBTSmUOU4VGdSvueNsRjioE7NpRp4fiu82CQNWE+flCee9ugNi3neUyt8gVGoBNSf7cS5IAFJGxB8SSq9jq+4eJ/xDLONP3fUREx/wZqFG9fOSL/v+b9JpD7Knxry3SVYJDYZadoExL3mg18TwbbHz5xrWlBb8QzW3fKlTS/m7HZlcZGDw/x9xAhN5J4jLlFSPu+hoDSeuJT38PmQQ6nUMQwL0gdmayxG+0SBgAe/qr+mkaXAgglnD3BUjTA5h72oVWrSleyshQdcY4KmUeTfOXrRq4bpIdo5DL7xFwGBdL79qKjKL8ddHNuqMJQc6Ob7H7b2QM1NwgvXqForN5YruNQ6kLS75e3ZdDNaW81fvzvwZ2+raMCW90hcC79JblTh5p3Bf2aNj4MH/JUTjwAzXJDyRze3f5k6abRnmjqG/6NqKrLP6K0o4mSTj3Nf5QpuINZvStkfyNsLBt1Xa9VwvGZvzm74Yh/1GUSLBoFG7sNRS5OgQy3eciYxW8y7KgYZdEKdh65kP77cZ4KE8kYMaPXdLDoQSH5IhgY11kjoWrYfi7WSTa+ydQ/7Fg2Y+gmTX7hPFdOlkQEd5ljURWUaSse7RmbUXcM7icY7c2qrBLONS105CUREI/EgWV8kYRhJFfk/VC4pXWnG2lJHXoCTODRhsf8KUSkc1efS7i74gKViCKiufmGUKw16L12fj7ANoXhBUimS24Z6mgSIiiaBNlXjIcYo2XXfVVEzz5zBKMgALPYUYyHiXmN0jNett6BilXD+1WzTb15/gZ+FLGQtZq2+k946IhtLarQ4DxURlYMonQ2mGCCobx1Bt1Y2uP0KQtZtKq3VycHB8YiACETQQ/9hkNM4V45ovyyA+vLj+8C8sRZP9VO7QKO3OHm/Rt/txJRKRbn+mE4vSx50qDYAhLwbj1f/VZb+jl0xlVXziH3q2raKsJO8bINfm7PtWIsRUIPLEINfOfqBRRf4vOBBZDIVZsLlpcUGACvHua0mm4rzczSQDQF7BxNlEP8eqAFwz1DIHO/mvhPraxVVL2dCNnW8Cz4mr+lnj9+/348aM4ca5GGqFTmMeaZVcIplTArm++e069dkFizm7pDuJ6eB/p8/fCisCF2MkQoGugBC4xoHlb8exyVqF5sHB7zJ2jL+ixqEfyz6H4sRW+8RWHdWjOV172rrdem5Hv3Zo0LWyCm8vrb5eNbVd4wnqIo5hUYe6Aa5MiF1uZU9HsmCpBPKqwNEVPzLNbe1QuhrV/NHNOyVp46QXklVK5EnkhWQDhwIe+z5oDFDcRg+UFKOF28Sewns9XvYC6JgTFg5OTemT2SlaWZPkBotWymD7BGnYt+RUrhKMQNsh66WYpT0Cxzil6lxLMgjYAH/Xijrj/v3VyCtIQpfr60Nyp33CXhGahxW6j2RIj+OkfhAd+ZeOtIdizvBaanWmA7w1/VZ9Jsq/Ttu9+hwvqFQBTeuk+zeqbu6f4GC3mFHQF091020UZLEMtAS5BkZ6YB22zl9aiYkHaGZgeoV+oj5p+SaxnC4M7pkOETGVr6vrxHNRE5UxlCQ== X-OriginatorOrg: weidmueller.com X-MS-Exchange-CrossTenant-Network-Message-Id: 75a35ef8-813e-4d6a-d1e9-08dd2efc369e X-MS-Exchange-CrossTenant-AuthSource: PAXPR08MB6969.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jan 2025 09:18:14.0778 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: e4289438-1c5f-4c95-a51a-ee553b8b18ec X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: X4UirkoPVV67aqtDHQOTD9SfIrLBW7MbfvOyOT5ct3ep+KLXXBAbs0tUpyG3vCMIVMY3XVI1UlQsedr2W/yrTg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR08MB10607 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 ; Tue, 07 Jan 2025 09:18:26 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/16974 From: Stefan Herbrechtsmeier The fetcher support entries with an embedded checksum like 'sha256sum' in the SRC_URI. It adds the parameter 'name' as prefix to the checksums if the parameter is set. This behavior is unexpected and leads to hacks in fetchers. Fallback to the checksum without the useless prefix and set the parameter 'name' in the gomod fetcher unconditional. Signed-off-by: Stefan Herbrechtsmeier --- lib/bb/fetch2/__init__.py | 9 ++++++--- lib/bb/fetch2/gomod.py | 5 +---- lib/bb/tests/fetch.py | 4 ---- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/lib/bb/fetch2/__init__.py b/lib/bb/fetch2/__init__.py index f79e278b1..3d31a8d4a 100644 --- a/lib/bb/fetch2/__init__.py +++ b/lib/bb/fetch2/__init__.py @@ -1316,20 +1316,23 @@ class FetchData(object): self.setup = False def configure_checksum(checksum_id): + checksum_plain_name = "%ssum" % checksum_id if "name" in self.parm: checksum_name = "%s.%ssum" % (self.parm["name"], checksum_id) else: - checksum_name = "%ssum" % checksum_id - - setattr(self, "%s_name" % checksum_id, checksum_name) + checksum_name = checksum_plain_name if checksum_name in self.parm: checksum_expected = self.parm[checksum_name] + elif checksum_plain_name in self.parm: + checksum_expected = self.parm[checksum_plain_name] + checksum_name = checksum_plain_name elif self.type not in ["http", "https", "ftp", "ftps", "sftp", "s3", "az", "crate", "gs", "gomod"]: checksum_expected = None else: checksum_expected = d.getVarFlag("SRC_URI", checksum_name) + setattr(self, "%s_name" % checksum_id, checksum_name) setattr(self, "%s_expected" % checksum_id, checksum_expected) self.names = self.parm.get("name",'default').split(',') diff --git a/lib/bb/fetch2/gomod.py b/lib/bb/fetch2/gomod.py index 21fbe80f5..6c999e8ba 100644 --- a/lib/bb/fetch2/gomod.py +++ b/lib/bb/fetch2/gomod.py @@ -119,10 +119,7 @@ class GoMod(Wget): ('https', proxy, '/' + path, None, None, None)) ud.parm['downloadfilename'] = path - # Set name parameter if sha256sum is set in recipe - name = f"{module}@{ud.parm['version']}" - if d.getVarFlag('SRC_URI', name + '.sha256sum'): - ud.parm['name'] = name + ud.parm['name'] = f"{module}@{ud.parm['version']}" # Set subdir for unpack ud.parm['subdir'] = os.path.join(moddir, 'cache/download', diff --git a/lib/bb/tests/fetch.py b/lib/bb/tests/fetch.py index c5ec84dc5..6b8e3e060 100644 --- a/lib/bb/tests/fetch.py +++ b/lib/bb/tests/fetch.py @@ -3391,7 +3391,6 @@ class GoModTest(FetcherTest): fetcher = bb.fetch2.Fetch(urls, self.d) ud = fetcher.ud[urls[0]] self.assertEqual(ud.url, 'https://proxy.golang.org/github.com/%21azure/azure-sdk-for-go/sdk/storage/azblob/%40v/v1.0.0.zip') - self.assertNotIn('name', ud.parm) fetcher.download() fetcher.unpack(self.unpackdir) @@ -3409,7 +3408,6 @@ class GoModTest(FetcherTest): fetcher = bb.fetch2.Fetch(urls, self.d) ud = fetcher.ud[urls[0]] self.assertEqual(ud.url, 'https://proxy.golang.org/github.com/%21azure/azure-sdk-for-go/sdk/storage/azblob/%40v/v1.0.0.mod') - self.assertNotIn('name', ud.parm) fetcher.download() fetcher.unpack(self.unpackdir) @@ -3442,7 +3440,6 @@ class GoModTest(FetcherTest): fetcher = bb.fetch2.Fetch(urls, self.d) ud = fetcher.ud[urls[0]] self.assertEqual(ud.url, 'https://proxy.golang.org/gopkg.in/ini.v1/%40v/v1.67.0.zip') - self.assertNotIn('name', ud.parm) fetcher.download() fetcher.unpack(self.unpackdir) @@ -3460,7 +3457,6 @@ class GoModTest(FetcherTest): fetcher = bb.fetch2.Fetch(urls, self.d) ud = fetcher.ud[urls[0]] self.assertEqual(ud.url, 'https://proxy.golang.org/go.opencensus.io/%40v/v0.24.0.zip') - self.assertNotIn('name', ud.parm) fetcher.download() fetcher.unpack(self.unpackdir) From patchwork Tue Jan 7 09:17:57 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Herbrechtsmeier X-Patchwork-Id: 55101 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 BAB67E7719A for ; Tue, 7 Jan 2025 09:18:26 +0000 (UTC) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (EUR05-VI1-obe.outbound.protection.outlook.com [40.107.21.129]) by mx.groups.io with SMTP id smtpd.web11.16587.1736241499941436827 for ; Tue, 07 Jan 2025 01:18:21 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@weidmueller.com header.s=selector2 header.b=ydQLbZMc; spf=pass (domain: weidmueller.com, ip: 40.107.21.129, mailfrom: stefan.herbrechtsmeier-oss@weidmueller.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=tbOni7XNXB3eOXlaNzRl1uz9vFLzEvCXwIM81Q+vvkl3NnhicT/n2E5i5LuWA08UWyXj36q1a7tYf6Pr4JaHxWooionKfq0qGJiC4Z+FwFST0S50ufTOeWcqmgS5/Z+Y8kjXrZR4YmdPAWykJIUNZuFfYAyFekU20AjSrdZAJeSt5s1uTYaqvrVGk6lNdj9afZcp3FTO+0emSsdyU5LTFxAACCJn8ig15eLOapHHPGtnNRPMYZ89KPMychtnxKa0zTXDlOaAsEbC+lkvHxurk/l3BujPGRbVGPxrBAJ156OA6m6qMOpq5krW1B3krddnR1MLneezPknmrlqpInJGHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Tit6rmzEZRai1FkdRp8QgPPUeB/0AyLmW9ayX20M9nk=; b=LQgS5sBydgRgbqVw61xycjThBuNQgWFQ76FxGPAPw/Xj9riBrVV+GJe67yVqcXqcXYYBdw6PrrNUjYHr6Xl7IP2Y2rFkG7wZoNZY2tS4COALFCb8D3zK6Mfz7cOnuomWjMvplHRBM6ml4pSNYVBsCNWI19vf1c5UBJqfGLSElvtV4a1lOFJbX5yJ7kEVKmNaSpJ8oKMNODJj7W6VP/WtX40hb6kctJ8+jZ0UOJvaxVvUZnN9aq1Rn7OhO/ckUHI/D1MwkRtIdzRid7l+mRPwRFoB/bZLVCCnhCriee3M8x3kgcwjPiEjLAILOvaQkmxMIdAFkmkVqcX89VigaB6dRg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=weidmueller.com; dmarc=pass action=none header.from=weidmueller.com; dkim=pass header.d=weidmueller.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=weidmueller.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Tit6rmzEZRai1FkdRp8QgPPUeB/0AyLmW9ayX20M9nk=; b=ydQLbZMccyb064341jWLobqzJePtj0Mr81P627x5knLyZ+fH2DwFFAHvT7pVPwc4vGDxDC/LeN1Tu6q9rfWXUjTTAeUnsyq84ReaPplzet3HovknlaPdwke1ShnMMZMaJ9vCvHi5ThAJ/+eZ5IVyhyFcYONy2VLFfquT08VjuI43CO8EwrWc24iFpriVr6UiwtKBaaWcW4LLd6qS8YFBomeDUp27MpchFMKhw7Lq64sDFFAA09MiC6GW00Yq5c51vGusa59WKm5Kc8k3CuAqymqumCQmwOGpS8TEkRf8ELlFY1hxRa5drURV/ziSBxbjC2HrYP9Nuj2M8COwGxRiuA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=weidmueller.com; Received: from PAXPR08MB6969.eurprd08.prod.outlook.com (2603:10a6:102:1d8::23) by GV1PR08MB10607.eurprd08.prod.outlook.com (2603:10a6:150:16c::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8314.18; Tue, 7 Jan 2025 09:18:15 +0000 Received: from PAXPR08MB6969.eurprd08.prod.outlook.com ([fe80::3b1:b329:1ed9:dad4]) by PAXPR08MB6969.eurprd08.prod.outlook.com ([fe80::3b1:b329:1ed9:dad4%3]) with mapi id 15.20.8314.015; Tue, 7 Jan 2025 09:18:14 +0000 From: Stefan Herbrechtsmeier To: bitbake-devel@lists.openembedded.org CC: Stefan Herbrechtsmeier Subject: [PATCH 5/5] fetch2: read checksum from SRC_URI flag for npm Date: Tue, 7 Jan 2025 10:17:57 +0100 Message-ID: <20250107091757.886-6-stefan.herbrechtsmeier-oss@weidmueller.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250107091757.886-1-stefan.herbrechtsmeier-oss@weidmueller.com> References: <20250107091757.886-1-stefan.herbrechtsmeier-oss@weidmueller.com> X-ClientProxiedBy: FR4P281CA0015.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:c8::7) To PAXPR08MB6969.eurprd08.prod.outlook.com (2603:10a6:102:1d8::23) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR08MB6969:EE_|GV1PR08MB10607:EE_ X-MS-Office365-Filtering-Correlation-Id: 0c080724-20d7-4f6e-9149-08dd2efc36d2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|52116014|366016|38350700014; X-Microsoft-Antispam-Message-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yD9v7DZV32D6m94GwMR99iS8e5pftydOOZktx9GDg2R4VTAcG0OvNeKv2SxnF4KM2pPVEe6gVaKQE52x53q0KIbgrkY06Zpkr2SbgbyU0aXc3KhQPfaG2uWdfuP/zZfxsN4UEnEa/WodbWR3F++XaV2F4oCjgA+B+0o0wIc5ZjE3PePTFKBG+btJXohqkxTnSp35jbwcAjs32Wct64r9tpQSkiOma0Kfcncwwi/8kdLDNbKg+mWekn5/GIYe/35sMyIhwTW21Qb7QVvH3aCEqkiarRBF2rcIobP7TnmWYb6uPJTMoP0o/uoeQhamoCWwGPOzmd8IagGEKv38nhlYLH7aA3S4HuUpHilf3jaqmBGVzvfrMk2wiXyya8eZUVKYKWrV X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR08MB6969.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(376014)(52116014)(366016)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: puuyelePUqF0eByo+5erAzMqdRnz8l32xdt0b0T2+NswCBDCRc7pE99CP9qkq3EN0dbsiB30Vjc/vBC9pVwoGetIAR/gLD9SGOZ6SCED9pPoqZyTRh4Ig7lLZImMaYAxsCk8uBY4+GxZmMb47QKrrZ1smD6eaO+8EuR0TkSbkXTeLhZ3Lo5ObYietIHGr6/BqKQCjdkmFp0UKJBH0MLAxOgwov2hUoG8EIjy98Q5nF0ar5kfsLaHG7QbW5N3W9/L39qXmIJERtsxFAfZka83kaTAXmbO/SAc4UijU4xJZ4IPB5BcojhjrhdJ0q4zghmhxJcp7l9kNIfh5RlSuDCwr/JwV6cVwN0KYREV1L7kJOgZKCSCZTtE8dfhFxi30ZPgMjtuVW1uUMdfOWMzKO69B9MF5KTnT8ruDsHhUBO200jZcfGEBYMsSYrPwdAEIkbmG7oHTyNaEMmSIN2jwbxq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OUXJTg1Ig6FUK3s8B5z9Xwanbk2E8DRzj8w/lIDDWiAzEn13Yc8TCTVorFGEY4Ne/DtqMiDku6hYOQXg== X-OriginatorOrg: weidmueller.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0c080724-20d7-4f6e-9149-08dd2efc36d2 X-MS-Exchange-CrossTenant-AuthSource: PAXPR08MB6969.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jan 2025 09:18:14.5193 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: e4289438-1c5f-4c95-a51a-ee553b8b18ec X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: v/yK4hvL+msWXIvdKsYfvKyEeziGQfYPN0b/zAlK2aL98Ic2QqW6AVw1I+nzLwnciVWYBRmAnuV2upEjoUCEZA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR08MB10607 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 ; Tue, 07 Jan 2025 09:18:26 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/16975 From: Stefan Herbrechtsmeier Signed-off-by: Stefan Herbrechtsmeier --- lib/bb/fetch2/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/bb/fetch2/__init__.py b/lib/bb/fetch2/__init__.py index 3d31a8d4a..d2a30c18f 100644 --- a/lib/bb/fetch2/__init__.py +++ b/lib/bb/fetch2/__init__.py @@ -1327,7 +1327,7 @@ class FetchData(object): elif checksum_plain_name in self.parm: checksum_expected = self.parm[checksum_plain_name] checksum_name = checksum_plain_name - elif self.type not in ["http", "https", "ftp", "ftps", "sftp", "s3", "az", "crate", "gs", "gomod"]: + elif self.type not in ["http", "https", "ftp", "ftps", "sftp", "s3", "az", "crate", "gs", "gomod", "npm"]: checksum_expected = None else: checksum_expected = d.getVarFlag("SRC_URI", checksum_name)