Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2019-07-12 21:16:52 +0300
committerisaacs <i@izs.me>2019-07-17 02:28:26 +0300
commite1d87a392371a070b0788ab7bfc62be18b21e9ad (patch)
tree7dc658ee764b549ec86626933c395866b2c0373f /node_modules/cacache/lib/verify.js
parent8e0a3100dffb3965bb3dc4240e82980dfadf2f3c (diff)
pacote@9.5.4
Diffstat (limited to 'node_modules/cacache/lib/verify.js')
-rw-r--r--node_modules/cacache/lib/verify.js16
1 files changed, 8 insertions, 8 deletions
diff --git a/node_modules/cacache/lib/verify.js b/node_modules/cacache/lib/verify.js
index 8eaab0b7d..617d38db1 100644
--- a/node_modules/cacache/lib/verify.js
+++ b/node_modules/cacache/lib/verify.js
@@ -22,9 +22,7 @@ const VerifyOpts = figgyPudding({
filter: {},
log: {
default: { silly () {} }
- },
- uid: {},
- gid: {}
+ }
})
module.exports = verify
@@ -67,9 +65,9 @@ function markEndTime (cache, opts) {
function fixPerms (cache, opts) {
opts.log.silly('verify', 'fixing cache permissions')
- return fixOwner.mkdirfix(cache, opts.uid, opts.gid).then(() => {
+ return fixOwner.mkdirfix(cache, cache).then(() => {
// TODO - fix file permissions too
- return fixOwner.chownr(cache, opts.uid, opts.gid)
+ return fixOwner.chownr(cache, cache)
}).then(() => null)
}
@@ -195,8 +193,6 @@ function rebuildBucket (cache, bucket, stats, opts) {
const content = contentPath(cache, entry.integrity)
return fs.statAsync(content).then(() => {
return index.insert(cache, entry.key, entry.integrity, {
- uid: opts.uid,
- gid: opts.gid,
metadata: entry.metadata,
size: entry.size
}).then(() => { stats.totalEntries++ })
@@ -216,7 +212,11 @@ function cleanTmp (cache, opts) {
function writeVerifile (cache, opts) {
const verifile = path.join(cache, '_lastverified')
opts.log.silly('verify', 'writing verifile to ' + verifile)
- return fs.writeFileAsync(verifile, '' + (+(new Date())))
+ try {
+ return fs.writeFileAsync(verifile, '' + (+(new Date())))
+ } finally {
+ fixOwner.chownr.sync(cache, verifile)
+ }
}
module.exports.lastRun = lastRun