diff options
author | isaacs <i@izs.me> | 2012-04-06 14:42:19 -0700 |
---|---|---|
committer | isaacs <i@izs.me> | 2012-04-06 14:42:19 -0700 |
commit | 37ac5e52bfaa79be477b4ac123ed05980defe599 (patch) | |
tree | aa8a95c1fb225968f8ad5a55c14d6240d8a7609d /deps/npm/lib/utils/npm-registry-client | |
parent | 0b57fee3f8598e4d16af5ce89714e460dd042700 (diff) | |
download | node-new-37ac5e52bfaa79be477b4ac123ed05980defe599.tar.gz |
Update npm to 1.1.16
Diffstat (limited to 'deps/npm/lib/utils/npm-registry-client')
-rw-r--r-- | deps/npm/lib/utils/npm-registry-client/get.js | 7 | ||||
-rw-r--r-- | deps/npm/lib/utils/npm-registry-client/request.js | 2 |
2 files changed, 6 insertions, 3 deletions
diff --git a/deps/npm/lib/utils/npm-registry-client/get.js b/deps/npm/lib/utils/npm-registry-client/get.js index 49a8b4cc00..e0902f0276 100644 --- a/deps/npm/lib/utils/npm-registry-client/get.js +++ b/deps/npm/lib/utils/npm-registry-client/get.js @@ -6,8 +6,9 @@ var GET = require("./request.js").GET , npm = require("../../npm.js") , path = require("path") , log = require("../log.js") - , mkdir = require("../mkdir-p.js") + , mkdir = require("mkdirp") , cacheStat = null + , chownr = require("chownr") function get (project, version, timeout, nofollow, staleOk, cb) { if (typeof cb !== "function") cb = staleOk, staleOk = false @@ -173,13 +174,13 @@ function saveToCache (cache, data, saved) { } function saveToCache_ (cache, data, uid, gid, saved) { - mkdir(path.dirname(cache), npm.modes.exec, uid, gid, function (er) { + mkdir(path.dirname(cache), function (er, made) { if (er) return saved() fs.writeFile(cache, JSON.stringify(data), function (er) { if (er || uid === null || gid === null) { return saved() } - fs.chown(cache, uid, gid, saved) + chownr(made || cache, uid, gid, saved) }) }) } diff --git a/deps/npm/lib/utils/npm-registry-client/request.js b/deps/npm/lib/utils/npm-registry-client/request.js index 5213c7966b..d5122629dd 100644 --- a/deps/npm/lib/utils/npm-registry-client/request.js +++ b/deps/npm/lib/utils/npm-registry-client/request.js @@ -94,6 +94,8 @@ function makeRequest (method, remote, where, what, etag, nofollow, cb) { headers.accept = "application/json" + headers["user-agent"] = npm.config.get("user-agent") + opts.proxy = npm.config.get( remote.protocol === "https:" ? "https-proxy" : "proxy" ) |