@yao-pkg/pkg-fetch 3.5.30 → 3.5.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/lib-es5/apply-patches.js +19 -78
- package/lib-es5/bin.js +40 -89
- package/lib-es5/build.js +198 -394
- package/lib-es5/expected-shas.json +32 -32
- package/lib-es5/expected.js +1 -1
- package/lib-es5/generate-expected-shas.js +31 -72
- package/lib-es5/index.js +125 -210
- package/lib-es5/log.js +39 -63
- package/lib-es5/parse-update-shas.js +32 -36
- package/lib-es5/places.js +13 -15
- package/lib-es5/print-hashes.js +4 -5
- package/lib-es5/system.js +17 -19
- package/lib-es5/utils.js +82 -150
- package/lib-es5/verify.js +118 -53
- package/package.json +1 -1
- package/patches/{node.v20.19.5.cpp.patch → node.v20.20.0.cpp.patch} +7 -7
- package/patches/{node.v22.21.1.cpp.patch → node.v22.22.0.cpp.patch} +5 -5
- package/patches/{node.v24.11.0.cpp.patch → node.v24.13.0.cpp.patch} +10 -10
- package/patches/patches.json +3 -3
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@ A utility to fetch or build patched Node binaries used by [pkg](https://github.c
|
|
|
8
8
|
| 8<sup>[1](#fn1)</sup>, 10<sup>[1](#fn1)</sup>, 12<sup>[1](#fn1)</sup>, 14<sup>[1](#fn1)</sup>, 16<sup>[1](#fn1)</sup> | linux | x64 | Enterprise Linux 7, Ubuntu 14.04, Debian jessie, other distros with glibc >= 2.17 |
|
|
9
9
|
| 18, 20, 22 | linux | x64 | Enterprise Linux 8, Ubuntu 20.04, Debian buster, other distros with glibc >= 2.28 |
|
|
10
10
|
| 8<sup>[1](#fn1)</sup>, 10<sup>[1](#fn1)</sup>, 12<sup>[1](#fn1)</sup>, 14<sup>[1](#fn1)</sup>, 16<sup>[1](#fn1)</sup> | linux | arm64 | Enterprise Linux 8, Ubuntu 18.04, Debian buster, other distros with glibc >= 2.27 |
|
|
11
|
-
| 18, 20, 22 | linux | arm64 | Enterprise Linux 9, Ubuntu
|
|
11
|
+
| 18, 20, 22 | linux | arm64 | Enterprise Linux 9, Ubuntu 22.04, Debian bookworm, other distros with glibc >= 2.35 |
|
|
12
12
|
| 8<sup>[1](#fn1)</sup>, 10<sup>[1](#fn1)</sup>, 12<sup>[1](#fn1)</sup>, 14<sup>[1](#fn1)</sup>, 16<sup>[1](#fn1)</sup>, 18, 20, 22 | linuxstatic | x64, arm64 | Any distro with Linux Kernel >= 2.6.32 (>= 3.10 strongly recommended) |
|
|
13
13
|
| 16<sup>[1](#fn1)</sup>, 18, 20, 22 | linuxstatic | armv7<sup>[2](#fn2)</sup> | Any distro with Linux Kernel >= 2.6.32 (>= 3.10 strongly recommended) |
|
|
14
14
|
| 8<sup>[1](#fn1)</sup>, 10<sup>[1](#fn1)</sup>, 12<sup>[1](#fn1)</sup>, 14<sup>[1](#fn1)</sup>, 16<sup>[1](#fn1)</sup>, 18, 20, 22 | macos | x64 | 10.13 |
|
package/lib-es5/apply-patches.js
CHANGED
|
@@ -1,89 +1,30 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
4
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
5
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
6
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
7
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
8
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
9
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
10
|
-
});
|
|
11
|
-
};
|
|
12
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
13
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
14
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
15
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
16
|
-
function step(op) {
|
|
17
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
18
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
19
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
20
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
21
|
-
switch (op[0]) {
|
|
22
|
-
case 0: case 1: t = op; break;
|
|
23
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
24
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
25
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
26
|
-
default:
|
|
27
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
28
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
29
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
30
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
31
|
-
if (t[2]) _.ops.pop();
|
|
32
|
-
_.trys.pop(); continue;
|
|
33
|
-
}
|
|
34
|
-
op = body.call(thisArg, _);
|
|
35
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
36
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
3
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
40
4
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
41
5
|
};
|
|
42
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
function applyPatchesOnVersion(nodeRange, quietExtraction) {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
return __generator(this, function (_a) {
|
|
52
|
-
switch (_a.label) {
|
|
53
|
-
case 0: return [4 /*yield*/, (0, build_1.prepBuildPath)()];
|
|
54
|
-
case 1:
|
|
55
|
-
_a.sent();
|
|
56
|
-
return [4 /*yield*/, (0, build_1.fetchExtractApply)((0, index_1.getNodeVersion)(nodeRange), quietExtraction)];
|
|
57
|
-
case 2:
|
|
58
|
-
_a.sent();
|
|
59
|
-
return [2 /*return*/];
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
});
|
|
7
|
+
const yargs_1 = __importDefault(require("yargs"));
|
|
8
|
+
const log_1 = require("./log");
|
|
9
|
+
const index_1 = require("./index");
|
|
10
|
+
const package_json_1 = require("../package.json");
|
|
11
|
+
const build_1 = require("./build");
|
|
12
|
+
async function applyPatchesOnVersion(nodeRange, quietExtraction = false) {
|
|
13
|
+
await (0, build_1.prepBuildPath)();
|
|
14
|
+
await (0, build_1.fetchExtractApply)((0, index_1.getNodeVersion)(nodeRange), quietExtraction);
|
|
63
15
|
}
|
|
64
|
-
function main() {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
.alias('v', 'version')
|
|
75
|
-
.help()
|
|
76
|
-
.alias('h', 'help').argv;
|
|
77
|
-
nodeRange = argv["node-range"], quietExtraction = argv["quiet-extraction"];
|
|
78
|
-
return [4 /*yield*/, applyPatchesOnVersion(nodeRange, quietExtraction)];
|
|
79
|
-
case 1:
|
|
80
|
-
_a.sent();
|
|
81
|
-
return [2 /*return*/];
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
});
|
|
16
|
+
async function main() {
|
|
17
|
+
const { argv } = yargs_1.default
|
|
18
|
+
.option('node-range', { alias: 'n', default: 'latest', type: 'string' })
|
|
19
|
+
.option('quiet-extraction', { alias: 'q', type: 'boolean' })
|
|
20
|
+
.version(package_json_1.version)
|
|
21
|
+
.alias('v', 'version')
|
|
22
|
+
.help()
|
|
23
|
+
.alias('h', 'help');
|
|
24
|
+
const { 'node-range': nodeRange, 'quiet-extraction': quietExtraction, } = argv;
|
|
25
|
+
await applyPatchesOnVersion(nodeRange, quietExtraction);
|
|
85
26
|
}
|
|
86
|
-
main().catch(
|
|
27
|
+
main().catch((error) => {
|
|
87
28
|
if (!error.wasReported)
|
|
88
29
|
log_1.log.error(error);
|
|
89
30
|
process.exit(2);
|
package/lib-es5/bin.js
CHANGED
|
@@ -1,100 +1,51 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
4
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
5
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
6
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
7
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
8
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
9
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
10
|
-
});
|
|
11
|
-
};
|
|
12
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
13
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
14
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
15
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
16
|
-
function step(op) {
|
|
17
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
18
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
19
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
20
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
21
|
-
switch (op[0]) {
|
|
22
|
-
case 0: case 1: t = op; break;
|
|
23
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
24
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
25
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
26
|
-
default:
|
|
27
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
28
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
29
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
30
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
31
|
-
if (t[2]) _.ops.pop();
|
|
32
|
-
_.trys.pop(); continue;
|
|
33
|
-
}
|
|
34
|
-
op = body.call(thisArg, _);
|
|
35
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
36
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
3
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
40
4
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
41
5
|
};
|
|
42
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
function main() {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
platform: platform,
|
|
79
|
-
arch: arch,
|
|
80
|
-
forceFetch: forceFetch,
|
|
81
|
-
forceBuild: forceBuild,
|
|
82
|
-
output: output,
|
|
83
|
-
})];
|
|
84
|
-
case 1:
|
|
85
|
-
local = _a.sent();
|
|
86
|
-
log_1.log.info(local);
|
|
87
|
-
if (!test) return [3 /*break*/, 3];
|
|
88
|
-
return [4 /*yield*/, (0, verify_1.verify)(local)];
|
|
89
|
-
case 2:
|
|
90
|
-
_a.sent();
|
|
91
|
-
_a.label = 3;
|
|
92
|
-
case 3: return [2 /*return*/];
|
|
93
|
-
}
|
|
94
|
-
});
|
|
7
|
+
const yargs_1 = __importDefault(require("yargs"));
|
|
8
|
+
const system_1 = require("./system");
|
|
9
|
+
const log_1 = require("./log");
|
|
10
|
+
const index_1 = require("./index");
|
|
11
|
+
const verify_1 = require("./verify");
|
|
12
|
+
const package_json_1 = require("../package.json");
|
|
13
|
+
async function main() {
|
|
14
|
+
const { argv } = yargs_1.default
|
|
15
|
+
.env('PKG_FETCH_OPTION_')
|
|
16
|
+
.option('node-range', { alias: 'n', default: 'latest', type: 'string' })
|
|
17
|
+
.option('platform', { alias: 'p', default: system_1.hostPlatform, type: 'string' })
|
|
18
|
+
.option('arch', { alias: 'a', default: system_1.hostArch, type: 'string' })
|
|
19
|
+
.option('test', { alias: 't', type: 'boolean' })
|
|
20
|
+
.option('force-fetch', {
|
|
21
|
+
alias: 'f',
|
|
22
|
+
type: 'boolean',
|
|
23
|
+
})
|
|
24
|
+
.option('force-build', {
|
|
25
|
+
alias: 'b',
|
|
26
|
+
type: 'boolean',
|
|
27
|
+
})
|
|
28
|
+
.conflicts('force-fetch', 'force-build')
|
|
29
|
+
.option('output', { alias: 'o', type: 'string' })
|
|
30
|
+
.version(package_json_1.version)
|
|
31
|
+
.alias('v', 'version')
|
|
32
|
+
.help()
|
|
33
|
+
.alias('h', 'help');
|
|
34
|
+
const { 'node-range': nodeRange, platform, arch, test, 'force-fetch': forceFetch, 'force-build': forceBuild, output, } = argv;
|
|
35
|
+
const local = await (0, index_1.need)({
|
|
36
|
+
nodeRange,
|
|
37
|
+
platform,
|
|
38
|
+
arch,
|
|
39
|
+
forceFetch,
|
|
40
|
+
forceBuild,
|
|
41
|
+
output,
|
|
95
42
|
});
|
|
43
|
+
log_1.log.info(local);
|
|
44
|
+
if (test) {
|
|
45
|
+
await (0, verify_1.verify)(local);
|
|
46
|
+
}
|
|
96
47
|
}
|
|
97
|
-
main().catch(
|
|
48
|
+
main().catch((error) => {
|
|
98
49
|
if (!error.wasReported)
|
|
99
50
|
log_1.log.error(error);
|
|
100
51
|
process.exit(2);
|