Files
Gyorgy Sarvari 3f9623aaef nodejs: upgrade 20.18.2 -> 20.20.0
Part of nodejs LTS release, contains many security- and bugfixes.

Ptests passed successfully.

Full changelog:
https://github.com/nodejs/node/blob/v20.x/doc/changelogs/CHANGELOG_V20.md

Dropped patches that are included in this release.

Added 0001-Revert-stop-using-deprecated-ares_query.patch:
Nodejs has changed a deprecated c-ares call to a newer version,
however this newer method is not available in the c-ares shipped
in meta-oe, and it failed to compile (the new call was added to c-ares
in v1.28.0, but Scarthgap comes with v1.27.0). This patch reverts this
failing commit completely. Based on the PR/issue discussions, the
only goal was to eliminate deprecation warnings. There seem to be
no logic change from this change.

License-Update:
- The license file was regenerated, to ensure it is up to date.
  It contains all licenses from all vendored dependecies. This
  resulted in adding nlohmann-json license to the file, which
  is MIT. There were already other MIT dependencies, so this
  didn't change the overall license declaration.
- base64 related license was removed, because base64 code was
  simplified, so it doesn't depend on this library anymore.
  (It was BSD-2-Clause, but there ar other dependencies using
  this license, so the overall license didn't change)

Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
Signed-off-by: Anuj Mittal <anuj.mittal@oss.qualcomm.com>
2026-02-12 15:58:49 +05:30

78 lines
1.6 KiB
JavaScript
Executable File

#!/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/json',
},
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}).`);
})