mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2026-10-22 08:28:21 +00:00
nodejs: upgrade 16.18.1 -> 16.19.0
* 16.18.0 (npm 8.19.2) introduced a regression in git+ssh urls - https://github.com/nodejs/node/issues/44992 - https://github.com/npm/cli/pull/5761 https://nodejs.org/ko/blog/release/v16.19.0/ License-Update: Clarify vendored OpenSSL Toolkit is OpenSSL and SSLeay License-Update: JS Foundation -> OpenJS Foundation https://github.com/nodejs/node/commit/e7ed56f501389978e4619ab697a812631c4061ff Signed-off-by: Tim Orling <tim.orling@konsulko.com> Signed-off-by: Armin Kuster <akuster808@gmail.com>
This commit is contained in:
1 parent
f8cb46d803
commit
e7c754778e
3 files changed
+3
-3
No files matched your search
@@ -0,0 +1,77 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
/// Usage: oe-npm-cache <cache-dir> <type> <key> <file-name>
|
||||
/// <type> ... meta - metainformation about package
|
||||
/// tgz - tarball
|
||||
|
||||
const process = require("node:process");
|
||||
|
||||
module.paths.unshift("@@libdir@@/node_modules/npm/node_modules");
|
||||
|
||||
const cacache = require('cacache')
|
||||
const fs = require('fs')
|
||||
|
||||
// argv[0] is 'node', argv[1] is this script
|
||||
const cache_dir = process.argv[2]
|
||||
const type = process.argv[3]
|
||||
const key = process.argv[4]
|
||||
const file = process.argv[5]
|
||||
|
||||
const data = fs.readFileSync(file)
|
||||
|
||||
// metadata content is highly nodejs dependent; when cache entries are not
|
||||
// found, place debug statements in 'make-fetch-happen/lib/cache/policy.js'
|
||||
// (CachePolicy::satisfies())
|
||||
const xlate = {
|
||||
'meta': {
|
||||
'key_prefix': 'make-fetch-happen:request-cache:',
|
||||
'metadata': function() {
|
||||
return {
|
||||
time: Date.now(),
|
||||
url: key,
|
||||
reqHeaders: {
|
||||
'accept': 'application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*',
|
||||
},
|
||||
resHeaders: {
|
||||
"content-type": "application/json",
|
||||
"status": 200,
|
||||
},
|
||||
options: {
|
||||
compress: true,
|
||||
}
|
||||
};
|
||||
},
|
||||
},
|
||||
|
||||
'tgz': {
|
||||
'key_prefix': 'make-fetch-happen:request-cache:',
|
||||
'metadata': function() {
|
||||
return {
|
||||
time: Date.now(),
|
||||
url: key,
|
||||
reqHeaders: {
|
||||
'accept': '*/*',
|
||||
},
|
||||
resHeaders: {
|
||||
"content-type": "application/octet-stream",
|
||||
"status": 200,
|
||||
},
|
||||
options: {
|
||||
compress: true,
|
||||
},
|
||||
};
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
const info = xlate[type];
|
||||
let opts = {}
|
||||
|
||||
if (info.metadata) {
|
||||
opts['metadata'] = info.metadata();
|
||||
}
|
||||
|
||||
cacache.put(cache_dir, info.key_prefix + key, data, opts)
|
||||
.then(integrity => {
|
||||
console.log(`Saved content of ${key} (${file}).`);
|
||||
})
|
||||
Reference in new issue
Block a user