summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-devtools/nodejs/nodejs-oe-cache-16.20
diff options
context:
space:
mode:
authorPolampalli, Archana <archana.polampalli@windriver.com>2023-07-11 13:39:05 +0000
committerArmin Kuster <akuster808@gmail.com>2023-07-16 15:30:53 -0400
commit8814f259022cca509b02f4703db2df53eeed70f3 (patch)
tree78051c1acb418ab914226a4d532041bed1e74fa1 /meta-oe/recipes-devtools/nodejs/nodejs-oe-cache-16.20
parent346753705e49a2486867dc150181a1c7f4d69377 (diff)
downloadmeta-openembedded-8814f259022cca509b02f4703db2df53eeed70f3.tar.gz
nodejs: upgrade 16.19.1 -> 16.20.1
Drop the gcc13.patch as it has been merged in 16.20.1 56cbc7fdda deps: V8: cherry-pick c2792e58035f The list of the CVEs are fixed in this relase: CVE-2023-30581 CVE-2023-30585 CVE-2023-30588 CVE-2023-30589 CVE-2023-30590 https://nodejs.org/en/blog/release/v16.20.0 https://nodejs.org/en/blog/release/v16.20.1 Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com> Signed-off-by: Armin Kuster <akuster808@gmail.com>
Diffstat (limited to 'meta-oe/recipes-devtools/nodejs/nodejs-oe-cache-16.20')
-rwxr-xr-xmeta-oe/recipes-devtools/nodejs/nodejs-oe-cache-16.20/oe-npm-cache77
1 files changed, 77 insertions, 0 deletions
diff --git a/meta-oe/recipes-devtools/nodejs/nodejs-oe-cache-16.20/oe-npm-cache b/meta-oe/recipes-devtools/nodejs/nodejs-oe-cache-16.20/oe-npm-cache
new file mode 100755
index 0000000000..f596207648
--- /dev/null
+++ b/meta-oe/recipes-devtools/nodejs/nodejs-oe-cache-16.20/oe-npm-cache
@@ -0,0 +1,77 @@
1#!/usr/bin/env node
2
3/// Usage: oe-npm-cache <cache-dir> <type> <key> <file-name>
4/// <type> ... meta - metainformation about package
5/// tgz - tarball
6
7const process = require("node:process");
8
9module.paths.unshift("@@libdir@@/node_modules/npm/node_modules");
10
11const cacache = require('cacache')
12const fs = require('fs')
13
14// argv[0] is 'node', argv[1] is this script
15const cache_dir = process.argv[2]
16const type = process.argv[3]
17const key = process.argv[4]
18const file = process.argv[5]
19
20const data = fs.readFileSync(file)
21
22// metadata content is highly nodejs dependent; when cache entries are not
23// found, place debug statements in 'make-fetch-happen/lib/cache/policy.js'
24// (CachePolicy::satisfies())
25const xlate = {
26 'meta': {
27 'key_prefix': 'make-fetch-happen:request-cache:',
28 'metadata': function() {
29 return {
30 time: Date.now(),
31 url: key,
32 reqHeaders: {
33 'accept': 'application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*',
34 },
35 resHeaders: {
36 "content-type": "application/json",
37 "status": 200,
38 },
39 options: {
40 compress: true,
41 }
42 };
43 },
44 },
45
46 'tgz': {
47 'key_prefix': 'make-fetch-happen:request-cache:',
48 'metadata': function() {
49 return {
50 time: Date.now(),
51 url: key,
52 reqHeaders: {
53 'accept': '*/*',
54 },
55 resHeaders: {
56 "content-type": "application/octet-stream",
57 "status": 200,
58 },
59 options: {
60 compress: true,
61 },
62 };
63 },
64 },
65};
66
67const info = xlate[type];
68let opts = {}
69
70if (info.metadata) {
71 opts['metadata'] = info.metadata();
72}
73
74cacache.put(cache_dir, info.key_prefix + key, data, opts)
75 .then(integrity => {
76 console.log(`Saved content of ${key} (${file}).`);
77})