pnpm 11.6.0 → 11.8.0
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 +32 -21
- package/dist/node_modules/node-gyp/.release-please-manifest.json +1 -1
- package/dist/node_modules/node-gyp/gyp/.release-please-manifest.json +1 -1
- package/dist/node_modules/node-gyp/gyp/pyproject.toml +4 -4
- package/dist/node_modules/node-gyp/lib/download.js +3 -3
- package/dist/node_modules/node-gyp/package.json +1 -1
- package/dist/node_modules/semver/classes/range.js +11 -2
- package/dist/node_modules/semver/classes/semver.js +19 -2
- package/dist/node_modules/semver/package.json +2 -2
- package/dist/node_modules/tar/dist/commonjs/header.js +51 -16
- package/dist/node_modules/tar/dist/commonjs/index.min.js +3 -3
- package/dist/node_modules/tar/dist/commonjs/pack.js +4 -5
- package/dist/node_modules/tar/dist/commonjs/types.js +21 -1
- package/dist/node_modules/tar/dist/esm/header.js +51 -16
- package/dist/node_modules/tar/dist/esm/index.min.js +3 -3
- package/dist/node_modules/tar/dist/esm/pack.js +4 -5
- package/dist/node_modules/tar/dist/esm/types.js +20 -0
- package/dist/node_modules/tar/package.json +11 -10
- package/dist/pnpm.mjs +25053 -23326
- package/dist/worker.js +749 -1196
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -40,10 +40,10 @@ To quote the [Rush](https://rushjs.io/) team:
|
|
|
40
40
|
<tbody>
|
|
41
41
|
<tr>
|
|
42
42
|
<td align="center" valign="middle">
|
|
43
|
-
<a href="https://bit.cloud/?utm_source=pnpm&utm_medium=readme" target="_blank"><img src="https://pnpm.io/img/users/bit.svg" width="80" alt="Bit"></a>
|
|
43
|
+
<a href="https://bit.cloud/?utm_source=pnpm&utm_medium=readme" target="_blank" rel="noopener noreferrer"><img src="https://pnpm.io/img/users/bit.svg" width="80" alt="Bit"></a>
|
|
44
44
|
</td>
|
|
45
45
|
<td align="center" valign="middle">
|
|
46
|
-
<a href="https://openai.com/?utm_source=pnpm&utm_medium=readme" target="_blank">
|
|
46
|
+
<a href="https://openai.com/?utm_source=pnpm&utm_medium=readme" target="_blank" rel="noopener noreferrer">
|
|
47
47
|
<picture>
|
|
48
48
|
<source media="(prefers-color-scheme: light)" srcset="https://pnpm.io/img/users/openai_dark.svg" />
|
|
49
49
|
<source media="(prefers-color-scheme: dark)" srcset="https://pnpm.io/img/users/openai_light.svg" />
|
|
@@ -61,7 +61,7 @@ To quote the [Rush](https://rushjs.io/) team:
|
|
|
61
61
|
<tbody>
|
|
62
62
|
<tr>
|
|
63
63
|
<td align="center" valign="middle">
|
|
64
|
-
<a href="https://sanity.io/?utm_source=pnpm&utm_medium=readme" target="_blank">
|
|
64
|
+
<a href="https://sanity.io/?utm_source=pnpm&utm_medium=readme" target="_blank" rel="noopener noreferrer">
|
|
65
65
|
<picture>
|
|
66
66
|
<source media="(prefers-color-scheme: light)" srcset="https://pnpm.io/img/users/sanity.svg" />
|
|
67
67
|
<source media="(prefers-color-scheme: dark)" srcset="https://pnpm.io/img/users/sanity_light.svg" />
|
|
@@ -70,7 +70,7 @@ To quote the [Rush](https://rushjs.io/) team:
|
|
|
70
70
|
</a>
|
|
71
71
|
</td>
|
|
72
72
|
<td align="center" valign="middle">
|
|
73
|
-
<a href="https://discord.com/?utm_source=pnpm&utm_medium=readme" target="_blank">
|
|
73
|
+
<a href="https://discord.com/?utm_source=pnpm&utm_medium=readme" target="_blank" rel="noopener noreferrer">
|
|
74
74
|
<picture>
|
|
75
75
|
<source media="(prefers-color-scheme: light)" srcset="https://pnpm.io/img/users/discord.svg" />
|
|
76
76
|
<source media="(prefers-color-scheme: dark)" srcset="https://pnpm.io/img/users/discord_light.svg" />
|
|
@@ -79,12 +79,12 @@ To quote the [Rush](https://rushjs.io/) team:
|
|
|
79
79
|
</a>
|
|
80
80
|
</td>
|
|
81
81
|
<td align="center" valign="middle">
|
|
82
|
-
<a href="https://vite.dev/?utm_source=pnpm&utm_medium=readme" target="_blank"><img src="https://pnpm.io/img/users/vitejs.svg" width="42" alt="Vite"></a>
|
|
82
|
+
<a href="https://vite.dev/?utm_source=pnpm&utm_medium=readme" target="_blank" rel="noopener noreferrer"><img src="https://pnpm.io/img/users/vitejs.svg" width="42" alt="Vite"></a>
|
|
83
83
|
</td>
|
|
84
84
|
</tr>
|
|
85
85
|
<tr>
|
|
86
86
|
<td align="center" valign="middle">
|
|
87
|
-
<a href="https://serpapi.com/?utm_source=pnpm&utm_medium=readme" target="_blank">
|
|
87
|
+
<a href="https://serpapi.com/?utm_source=pnpm&utm_medium=readme" target="_blank" rel="noopener noreferrer">
|
|
88
88
|
<picture>
|
|
89
89
|
<source media="(prefers-color-scheme: light)" srcset="https://pnpm.io/img/users/serpapi_dark.svg" />
|
|
90
90
|
<source media="(prefers-color-scheme: dark)" srcset="https://pnpm.io/img/users/serpapi_light.svg" />
|
|
@@ -93,7 +93,7 @@ To quote the [Rush](https://rushjs.io/) team:
|
|
|
93
93
|
</a>
|
|
94
94
|
</td>
|
|
95
95
|
<td align="center" valign="middle">
|
|
96
|
-
<a href="https://coderabbit.ai/?utm_source=pnpm&utm_medium=readme" target="_blank">
|
|
96
|
+
<a href="https://coderabbit.ai/?utm_source=pnpm&utm_medium=readme" target="_blank" rel="noopener noreferrer">
|
|
97
97
|
<picture>
|
|
98
98
|
<source media="(prefers-color-scheme: light)" srcset="https://pnpm.io/img/users/coderabbit.svg" />
|
|
99
99
|
<source media="(prefers-color-scheme: dark)" srcset="https://pnpm.io/img/users/coderabbit_light.svg" />
|
|
@@ -102,7 +102,7 @@ To quote the [Rush](https://rushjs.io/) team:
|
|
|
102
102
|
</a>
|
|
103
103
|
</td>
|
|
104
104
|
<td align="center" valign="middle">
|
|
105
|
-
<a href="https://stackblitz.com/?utm_source=pnpm&utm_medium=readme" target="_blank">
|
|
105
|
+
<a href="https://stackblitz.com/?utm_source=pnpm&utm_medium=readme" target="_blank" rel="noopener noreferrer">
|
|
106
106
|
<picture>
|
|
107
107
|
<source media="(prefers-color-scheme: light)" srcset="https://pnpm.io/img/users/stackblitz.svg" />
|
|
108
108
|
<source media="(prefers-color-scheme: dark)" srcset="https://pnpm.io/img/users/stackblitz_light.svg" />
|
|
@@ -113,7 +113,7 @@ To quote the [Rush](https://rushjs.io/) team:
|
|
|
113
113
|
</tr>
|
|
114
114
|
<tr>
|
|
115
115
|
<td align="center" valign="middle">
|
|
116
|
-
<a href="https://workleap.com/?utm_source=pnpm&utm_medium=readme" target="_blank">
|
|
116
|
+
<a href="https://workleap.com/?utm_source=pnpm&utm_medium=readme" target="_blank" rel="noopener noreferrer">
|
|
117
117
|
<picture>
|
|
118
118
|
<source media="(prefers-color-scheme: light)" srcset="https://pnpm.io/img/users/workleap.svg" />
|
|
119
119
|
<source media="(prefers-color-scheme: dark)" srcset="https://pnpm.io/img/users/workleap_light.svg" />
|
|
@@ -122,7 +122,7 @@ To quote the [Rush](https://rushjs.io/) team:
|
|
|
122
122
|
</a>
|
|
123
123
|
</td>
|
|
124
124
|
<td align="center" valign="middle">
|
|
125
|
-
<a href="https://nx.dev/?utm_source=pnpm&utm_medium=readme" target="_blank">
|
|
125
|
+
<a href="https://nx.dev/?utm_source=pnpm&utm_medium=readme" target="_blank" rel="noopener noreferrer">
|
|
126
126
|
<picture>
|
|
127
127
|
<source media="(prefers-color-scheme: light)" srcset="https://pnpm.io/img/users/nx.svg" />
|
|
128
128
|
<source media="(prefers-color-scheme: dark)" srcset="https://pnpm.io/img/users/nx_light.svg" />
|
|
@@ -140,7 +140,7 @@ To quote the [Rush](https://rushjs.io/) team:
|
|
|
140
140
|
<tbody>
|
|
141
141
|
<tr>
|
|
142
142
|
<td align="center" valign="middle">
|
|
143
|
-
<a href="https://replit.com/?utm_source=pnpm&utm_medium=readme" target="_blank">
|
|
143
|
+
<a href="https://replit.com/?utm_source=pnpm&utm_medium=readme" target="_blank" rel="noopener noreferrer">
|
|
144
144
|
<picture>
|
|
145
145
|
<source media="(prefers-color-scheme: light)" srcset="https://pnpm.io/img/users/replit.png" />
|
|
146
146
|
<source media="(prefers-color-scheme: dark)" srcset="https://pnpm.io/img/users/replit_light.png" />
|
|
@@ -149,10 +149,10 @@ To quote the [Rush](https://rushjs.io/) team:
|
|
|
149
149
|
</a>
|
|
150
150
|
</td>
|
|
151
151
|
<td align="center" valign="middle">
|
|
152
|
-
<a href="https://cybozu.co.jp/?utm_source=pnpm&utm_medium=readme" target="_blank"><img src="https://pnpm.io/img/users/cybozu.svg" width="70" alt="Cybozu"></a>
|
|
152
|
+
<a href="https://cybozu.co.jp/?utm_source=pnpm&utm_medium=readme" target="_blank" rel="noopener noreferrer"><img src="https://pnpm.io/img/users/cybozu.svg" width="70" alt="Cybozu"></a>
|
|
153
153
|
</td>
|
|
154
154
|
<td align="center" valign="middle">
|
|
155
|
-
<a href="https://www.bairesdev.com/?utm_source=pnpm&utm_medium=readme" target="_blank">
|
|
155
|
+
<a href="https://www.bairesdev.com/?utm_source=pnpm&utm_medium=readme" target="_blank" rel="noopener noreferrer">
|
|
156
156
|
<picture>
|
|
157
157
|
<source media="(prefers-color-scheme: light)" srcset="https://pnpm.io/img/users/bairesdev.svg" />
|
|
158
158
|
<source media="(prefers-color-scheme: dark)" srcset="https://pnpm.io/img/users/bairesdev_light.svg" />
|
|
@@ -163,10 +163,19 @@ To quote the [Rush](https://rushjs.io/) team:
|
|
|
163
163
|
</tr>
|
|
164
164
|
<tr>
|
|
165
165
|
<td align="center" valign="middle">
|
|
166
|
-
<a href="https://
|
|
166
|
+
<a href="https://www.thesys.dev/?utm_source=pnpm&utm_medium=readme" target="_blank" rel="noopener noreferrer">
|
|
167
|
+
<picture>
|
|
168
|
+
<source media="(prefers-color-scheme: light)" srcset="https://pnpm.io/img/users/thesys.svg" />
|
|
169
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://pnpm.io/img/users/thesys_light.svg" />
|
|
170
|
+
<img src="https://pnpm.io/img/users/thesys.svg" width="120" alt="Thesys" />
|
|
171
|
+
</picture>
|
|
172
|
+
</a>
|
|
167
173
|
</td>
|
|
168
174
|
<td align="center" valign="middle">
|
|
169
|
-
<a href="https://
|
|
175
|
+
<a href="https://devowl.io/?utm_source=pnpm&utm_medium=readme" target="_blank" rel="noopener noreferrer"><img src="https://pnpm.io/img/users/devowlio.svg" width="100" alt="devowl.io"></a>
|
|
176
|
+
</td>
|
|
177
|
+
<td align="center" valign="middle">
|
|
178
|
+
<a href="https://uscreen.de/?utm_source=pnpm&utm_medium=readme" target="_blank" rel="noopener noreferrer">
|
|
170
179
|
<picture>
|
|
171
180
|
<source media="(prefers-color-scheme: light)" srcset="https://pnpm.io/img/users/uscreen.svg" />
|
|
172
181
|
<source media="(prefers-color-scheme: dark)" srcset="https://pnpm.io/img/users/uscreen_light.svg" />
|
|
@@ -174,13 +183,13 @@ To quote the [Rush](https://rushjs.io/) team:
|
|
|
174
183
|
</picture>
|
|
175
184
|
</a>
|
|
176
185
|
</td>
|
|
177
|
-
<td align="center" valign="middle">
|
|
178
|
-
<a href="https://www.leniolabs.com/?utm_source=pnpm&utm_medium=readme" target="_blank"><img src="https://pnpm.io/img/users/leniolabs.jpg" width="40" alt="Leniolabs_"></a>
|
|
179
|
-
</td>
|
|
180
186
|
</tr>
|
|
181
187
|
<tr>
|
|
182
188
|
<td align="center" valign="middle">
|
|
183
|
-
<a href="https://
|
|
189
|
+
<a href="https://www.leniolabs.com/?utm_source=pnpm&utm_medium=readme" target="_blank" rel="noopener noreferrer"><img src="https://pnpm.io/img/users/leniolabs.jpg" width="40" alt="Leniolabs_"></a>
|
|
190
|
+
</td>
|
|
191
|
+
<td align="center" valign="middle">
|
|
192
|
+
<a href="https://depot.dev/?utm_source=pnpm&utm_medium=readme" target="_blank" rel="noopener noreferrer">
|
|
184
193
|
<picture>
|
|
185
194
|
<source media="(prefers-color-scheme: light)" srcset="https://pnpm.io/img/users/depot.svg" />
|
|
186
195
|
<source media="(prefers-color-scheme: dark)" srcset="https://pnpm.io/img/users/depot_light.svg" />
|
|
@@ -189,7 +198,7 @@ To quote the [Rush](https://rushjs.io/) team:
|
|
|
189
198
|
</a>
|
|
190
199
|
</td>
|
|
191
200
|
<td align="center" valign="middle">
|
|
192
|
-
<a href="https://cerbos.dev/?utm_source=pnpm&utm_medium=readme" target="_blank">
|
|
201
|
+
<a href="https://cerbos.dev/?utm_source=pnpm&utm_medium=readme" target="_blank" rel="noopener noreferrer">
|
|
193
202
|
<picture>
|
|
194
203
|
<source media="(prefers-color-scheme: light)" srcset="https://pnpm.io/img/users/cerbos.svg" />
|
|
195
204
|
<source media="(prefers-color-scheme: dark)" srcset="https://pnpm.io/img/users/cerbos_light.svg" />
|
|
@@ -197,8 +206,10 @@ To quote the [Rush](https://rushjs.io/) team:
|
|
|
197
206
|
</picture>
|
|
198
207
|
</a>
|
|
199
208
|
</td>
|
|
209
|
+
</tr>
|
|
210
|
+
<tr>
|
|
200
211
|
<td align="center" valign="middle">
|
|
201
|
-
<a href="https://time.now/?utm_source=pnpm&utm_medium=readme" target="_blank">⏱️ Time.now</a>
|
|
212
|
+
<a href="https://time.now/?utm_source=pnpm&utm_medium=readme" target="_blank" rel="noopener noreferrer">⏱️ Time.now</a>
|
|
202
213
|
</td>
|
|
203
214
|
</tr>
|
|
204
215
|
</tbody>
|
|
@@ -4,20 +4,20 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "gyp-next"
|
|
7
|
-
version = "0.22.
|
|
7
|
+
version = "0.22.2"
|
|
8
8
|
authors = [
|
|
9
9
|
{ name="Node.js contributors", email="ryzokuken@disroot.org" },
|
|
10
10
|
]
|
|
11
11
|
description = "A fork of the GYP build system for use in the Node.js projects"
|
|
12
12
|
readme = "README.md"
|
|
13
|
-
license =
|
|
13
|
+
license = "BSD-3-Clause"
|
|
14
|
+
license-files = ["LICENSE"]
|
|
14
15
|
requires-python = ">=3.9"
|
|
15
|
-
dependencies = ["packaging>=24.0", "setuptools>=
|
|
16
|
+
dependencies = ["packaging>=24.0", "setuptools>=77.0.3"]
|
|
16
17
|
classifiers = [
|
|
17
18
|
"Development Status :: 3 - Alpha",
|
|
18
19
|
"Environment :: Console",
|
|
19
20
|
"Intended Audience :: Developers",
|
|
20
|
-
"License :: OSI Approved :: BSD License",
|
|
21
21
|
"Natural Language :: English",
|
|
22
22
|
"Programming Language :: Python",
|
|
23
23
|
"Programming Language :: Python :: 3",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const { Readable } = require('stream')
|
|
2
|
-
const { EnvHttpProxyAgent } = require('undici')
|
|
2
|
+
const { Agent, EnvHttpProxyAgent, RetryAgent, fetch } = require('undici')
|
|
3
3
|
const { promises: fs } = require('graceful-fs')
|
|
4
4
|
const log = require('./log')
|
|
5
5
|
|
|
@@ -48,7 +48,7 @@ async function createDispatcher (gyp) {
|
|
|
48
48
|
const env = process.env
|
|
49
49
|
const hasProxyEnv = env.http_proxy || env.HTTP_PROXY || env.https_proxy || env.HTTPS_PROXY
|
|
50
50
|
if (!gyp.opts.proxy && !gyp.opts.cafile && !hasProxyEnv) {
|
|
51
|
-
return
|
|
51
|
+
return new RetryAgent(new Agent(), { maxRetries: 3 })
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
const opts = {}
|
|
@@ -69,7 +69,7 @@ async function createDispatcher (gyp) {
|
|
|
69
69
|
if (gyp.opts.noproxy) {
|
|
70
70
|
opts.noProxy = gyp.opts.noproxy
|
|
71
71
|
}
|
|
72
|
-
return new EnvHttpProxyAgent(opts)
|
|
72
|
+
return new RetryAgent(new EnvHttpProxyAgent(opts), { maxRetries: 3 })
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
async function readCAFile (filename) {
|
|
@@ -277,6 +277,11 @@ const parseComparator = (comp, options) => {
|
|
|
277
277
|
|
|
278
278
|
const isX = id => !id || id.toLowerCase() === 'x' || id === '*'
|
|
279
279
|
|
|
280
|
+
const invalidXRangeOrder = (M, m, p) => (
|
|
281
|
+
(isX(M) && !isX(m)) ||
|
|
282
|
+
(isX(m) && p && !isX(p))
|
|
283
|
+
)
|
|
284
|
+
|
|
280
285
|
// ~, ~> --> * (any, kinda silly)
|
|
281
286
|
// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0
|
|
282
287
|
// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0
|
|
@@ -373,10 +378,10 @@ const replaceCaret = (comp, options) => {
|
|
|
373
378
|
if (M === '0') {
|
|
374
379
|
if (m === '0') {
|
|
375
380
|
ret = `>=${M}.${m}.${p
|
|
376
|
-
}
|
|
381
|
+
} <${M}.${m}.${+p + 1}-0`
|
|
377
382
|
} else {
|
|
378
383
|
ret = `>=${M}.${m}.${p
|
|
379
|
-
}
|
|
384
|
+
} <${M}.${+m + 1}.0-0`
|
|
380
385
|
}
|
|
381
386
|
} else {
|
|
382
387
|
ret = `>=${M}.${m}.${p
|
|
@@ -402,6 +407,10 @@ const replaceXRange = (comp, options) => {
|
|
|
402
407
|
const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]
|
|
403
408
|
return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
|
|
404
409
|
debug('xRange', comp, ret, gtlt, M, m, p, pr)
|
|
410
|
+
if (invalidXRangeOrder(M, m, p)) {
|
|
411
|
+
return comp
|
|
412
|
+
}
|
|
413
|
+
|
|
405
414
|
const xM = isX(M)
|
|
406
415
|
const xm = xM || isX(m)
|
|
407
416
|
const xp = xm || isX(p)
|
|
@@ -6,6 +6,22 @@ const { safeRe: re, t } = require('../internal/re')
|
|
|
6
6
|
|
|
7
7
|
const parseOptions = require('../internal/parse-options')
|
|
8
8
|
const { compareIdentifiers } = require('../internal/identifiers')
|
|
9
|
+
|
|
10
|
+
const isPrereleaseIdentifier = (prerelease, identifier) => {
|
|
11
|
+
const identifiers = identifier.split('.')
|
|
12
|
+
if (identifiers.length > prerelease.length) {
|
|
13
|
+
return false
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
for (let i = 0; i < identifiers.length; i++) {
|
|
17
|
+
if (compareIdentifiers(prerelease[i], identifiers[i]) !== 0) {
|
|
18
|
+
return false
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return true
|
|
23
|
+
}
|
|
24
|
+
|
|
9
25
|
class SemVer {
|
|
10
26
|
constructor (version, options) {
|
|
11
27
|
options = parseOptions(options)
|
|
@@ -309,8 +325,9 @@ class SemVer {
|
|
|
309
325
|
if (identifierBase === false) {
|
|
310
326
|
prerelease = [identifier]
|
|
311
327
|
}
|
|
312
|
-
if (
|
|
313
|
-
|
|
328
|
+
if (isPrereleaseIdentifier(this.prerelease, identifier)) {
|
|
329
|
+
const prereleaseBase = this.prerelease[identifier.split('.').length]
|
|
330
|
+
if (isNaN(prereleaseBase)) {
|
|
314
331
|
this.prerelease = prerelease
|
|
315
332
|
}
|
|
316
333
|
} else {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "semver",
|
|
3
|
-
"version": "7.8.
|
|
3
|
+
"version": "7.8.4",
|
|
4
4
|
"description": "The semantic version parser used by npm.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\""
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
|
-
"@npmcli/eslint-config": "^
|
|
17
|
+
"@npmcli/eslint-config": "^7.0.0",
|
|
18
18
|
"@npmcli/template-oss": "5.0.0",
|
|
19
19
|
"benchmark": "^2.1.4",
|
|
20
20
|
"tap": "^16.0.0"
|
|
@@ -78,22 +78,45 @@ class Header {
|
|
|
78
78
|
if (!buf || !(buf.length >= off + 512)) {
|
|
79
79
|
throw new Error('need 512 bytes for header');
|
|
80
80
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
81
|
+
// Decode the typeflag (independent of any pending PAX/GNU extended header)
|
|
82
|
+
// up front so we can tell whether THIS block is itself an intermediary
|
|
83
|
+
// extension header (PAX `x`/`g`, GNU long-name `L`, GNU long-link `K`).
|
|
84
|
+
// Per POSIX pax, a PAX extended header describes the *next file entry*, not
|
|
85
|
+
// the extension headers that may sit between it and that file. Applying the
|
|
86
|
+
// pending PAX overrides (notably `size`) to an intervening `L`/`K`/`x`/`g`
|
|
87
|
+
// header desynchronizes the stream relative to other tar implementations
|
|
88
|
+
// and enables tar interpretation-conflict / file-smuggling attacks.
|
|
89
|
+
const t = decString(buf, off + 156, 1);
|
|
90
|
+
const isNormalFS = types.normalFsTypes.has(t);
|
|
91
|
+
const exForFields = isNormalFS ? ex : undefined;
|
|
92
|
+
const gexForFields = isNormalFS ? gex : undefined;
|
|
93
|
+
this.path = exForFields?.path ?? decString(buf, off, 100);
|
|
94
|
+
this.mode =
|
|
95
|
+
exForFields?.mode ??
|
|
96
|
+
gexForFields?.mode ??
|
|
97
|
+
decNumber(buf, off + 100, 8);
|
|
98
|
+
this.uid =
|
|
99
|
+
exForFields?.uid ?? gexForFields?.uid ?? decNumber(buf, off + 108, 8);
|
|
100
|
+
this.gid =
|
|
101
|
+
exForFields?.gid ?? gexForFields?.gid ?? decNumber(buf, off + 116, 8);
|
|
102
|
+
this.size =
|
|
103
|
+
exForFields?.size ??
|
|
104
|
+
gexForFields?.size ??
|
|
105
|
+
decNumber(buf, off + 124, 12);
|
|
106
|
+
this.mtime =
|
|
107
|
+
exForFields?.mtime ??
|
|
108
|
+
gexForFields?.mtime ??
|
|
109
|
+
decDate(buf, off + 136, 12);
|
|
87
110
|
this.cksum = decNumber(buf, off + 148, 12);
|
|
88
111
|
// if we have extended or global extended headers, apply them now
|
|
89
112
|
// See https://github.com/npm/node-tar/pull/187
|
|
90
|
-
// Apply global before local, so it overrides
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
113
|
+
// Apply global before local, so it overrides. Never slurp the pending
|
|
114
|
+
// extended-header fields onto an intermediary extension header.
|
|
115
|
+
if (gexForFields)
|
|
116
|
+
this.#slurp(gexForFields, true);
|
|
117
|
+
if (exForFields)
|
|
118
|
+
this.#slurp(exForFields);
|
|
95
119
|
// old tar versions marked dirs as a file with a trailing /
|
|
96
|
-
const t = decString(buf, off + 156, 1);
|
|
97
120
|
if (types.isCode(t)) {
|
|
98
121
|
this.#type = t || '0';
|
|
99
122
|
}
|
|
@@ -111,12 +134,24 @@ class Header {
|
|
|
111
134
|
this.linkpath = decString(buf, off + 157, 100);
|
|
112
135
|
if (buf.subarray(off + 257, off + 265).toString() === 'ustar\u000000') {
|
|
113
136
|
/* c8 ignore start */
|
|
114
|
-
this.uname =
|
|
115
|
-
|
|
137
|
+
this.uname =
|
|
138
|
+
exForFields?.uname ??
|
|
139
|
+
gexForFields?.uname ??
|
|
140
|
+
decString(buf, off + 265, 32);
|
|
141
|
+
this.gname =
|
|
142
|
+
exForFields?.gname ??
|
|
143
|
+
gexForFields?.gname ??
|
|
144
|
+
decString(buf, off + 297, 32);
|
|
116
145
|
this.devmaj =
|
|
117
|
-
|
|
146
|
+
exForFields?.devmaj ??
|
|
147
|
+
gexForFields?.devmaj ??
|
|
148
|
+
decNumber(buf, off + 329, 8) ??
|
|
149
|
+
0;
|
|
118
150
|
this.devmin =
|
|
119
|
-
|
|
151
|
+
exForFields?.devmin ??
|
|
152
|
+
gexForFields?.devmin ??
|
|
153
|
+
decNumber(buf, off + 337, 8) ??
|
|
154
|
+
0;
|
|
120
155
|
/* c8 ignore stop */
|
|
121
156
|
if (buf[off + 475] !== 0) {
|
|
122
157
|
// definitely a prefix, definitely >130 chars.
|