Skip to content

Commit d404c8c

Browse files
authoredJun 14, 2022
deps: cacache@16.1.1 (#4985)
* read: change lstat to stat to correctly evaluate file size
1 parent 053dffe commit d404c8c

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed
 

‎node_modules/cacache/lib/content/read.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ async function read (cache, integrity, opts = {}) {
1313
const { size } = opts
1414
const { stat, cpath, sri } = await withContentSri(cache, integrity, async (cpath, sri) => {
1515
// get size
16-
const stat = await fs.lstat(cpath)
16+
const stat = await fs.stat(cpath)
1717
return { stat, cpath, sri }
1818
})
1919
if (typeof size === 'number' && stat.size !== size) {
@@ -73,8 +73,8 @@ function readStream (cache, integrity, opts = {}) {
7373
// Set all this up to run on the stream and then just return the stream
7474
Promise.resolve().then(async () => {
7575
const { stat, cpath, sri } = await withContentSri(cache, integrity, async (cpath, sri) => {
76-
// just lstat to ensure it exists
77-
const stat = await fs.lstat(cpath)
76+
// just stat to ensure it exists
77+
const stat = await fs.stat(cpath)
7878
return { stat, cpath, sri }
7979
})
8080
if (typeof size === 'number' && size !== stat.size) {
@@ -111,7 +111,7 @@ async function hasContent (cache, integrity) {
111111

112112
try {
113113
return await withContentSri(cache, integrity, async (cpath, sri) => {
114-
const stat = await fs.lstat(cpath)
114+
const stat = await fs.stat(cpath)
115115
return { size: stat.size, sri, stat }
116116
})
117117
} catch (err) {
@@ -139,7 +139,7 @@ function hasContentSync (cache, integrity) {
139139

140140
return withContentSriSync(cache, integrity, (cpath, sri) => {
141141
try {
142-
const stat = fs.lstatSync(cpath)
142+
const stat = fs.statSync(cpath)
143143
return { size: stat.size, sri, stat }
144144
} catch (err) {
145145
if (err.code === 'ENOENT') {

‎node_modules/cacache/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cacache",
3-
"version": "16.1.0",
3+
"version": "16.1.1",
44
"cache-version": {
55
"content": "2",
66
"index": "5"
@@ -69,7 +69,7 @@
6969
},
7070
"devDependencies": {
7171
"@npmcli/eslint-config": "^3.0.1",
72-
"@npmcli/template-oss": "3.4.3",
72+
"@npmcli/template-oss": "3.5.0",
7373
"tap": "^16.0.0"
7474
},
7575
"engines": {
@@ -78,7 +78,7 @@
7878
"templateOSS": {
7979
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
8080
"windowsCI": false,
81-
"version": "3.4.3"
81+
"version": "3.5.0"
8282
},
8383
"author": "GitHub Inc."
8484
}

‎package-lock.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
"@npmcli/run-script": "^3.0.1",
9797
"abbrev": "~1.1.1",
9898
"archy": "~1.0.0",
99-
"cacache": "^16.1.0",
99+
"cacache": "^16.1.1",
100100
"chalk": "^4.1.2",
101101
"chownr": "^2.0.0",
102102
"cli-columns": "^4.0.0",
@@ -1579,9 +1579,9 @@
15791579
}
15801580
},
15811581
"node_modules/cacache": {
1582-
"version": "16.1.0",
1583-
"resolved": "https://registry.npmjs.org/cacache/-/cacache-16.1.0.tgz",
1584-
"integrity": "sha512-Pk4aQkwCW82A4jGKFvcGkQFqZcMspfP9YWq9Pr87/ldDvlWf718zeI6KWCdKt/jeihu6BytHRUicJPB1K2k8EQ==",
1582+
"version": "16.1.1",
1583+
"resolved": "https://registry.npmjs.org/cacache/-/cacache-16.1.1.tgz",
1584+
"integrity": "sha512-VDKN+LHyCQXaaYZ7rA/qtkURU+/yYhviUdvqEv2LT6QPZU8jpyzEkEVAcKlKLt5dJ5BRp11ym8lo3NKLluEPLg==",
15851585
"inBundle": true,
15861586
"dependencies": {
15871587
"@npmcli/fs": "^2.1.0",
@@ -11239,9 +11239,9 @@
1123911239
}
1124011240
},
1124111241
"cacache": {
11242-
"version": "16.1.0",
11243-
"resolved": "https://registry.npmjs.org/cacache/-/cacache-16.1.0.tgz",
11244-
"integrity": "sha512-Pk4aQkwCW82A4jGKFvcGkQFqZcMspfP9YWq9Pr87/ldDvlWf718zeI6KWCdKt/jeihu6BytHRUicJPB1K2k8EQ==",
11242+
"version": "16.1.1",
11243+
"resolved": "https://registry.npmjs.org/cacache/-/cacache-16.1.1.tgz",
11244+
"integrity": "sha512-VDKN+LHyCQXaaYZ7rA/qtkURU+/yYhviUdvqEv2LT6QPZU8jpyzEkEVAcKlKLt5dJ5BRp11ym8lo3NKLluEPLg==",
1124511245
"requires": {
1124611246
"@npmcli/fs": "^2.1.0",
1124711247
"@npmcli/move-file": "^2.0.0",

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
"@npmcli/run-script": "^3.0.1",
6666
"abbrev": "~1.1.1",
6767
"archy": "~1.0.0",
68-
"cacache": "^16.1.0",
68+
"cacache": "^16.1.1",
6969
"chalk": "^4.1.2",
7070
"chownr": "^2.0.0",
7171
"cli-columns": "^4.0.0",

0 commit comments

Comments
 (0)
Please sign in to comment.