diff options
author | isaacs <i@izs.me> | 2013-09-05 17:13:50 -0700 |
---|---|---|
committer | isaacs <i@izs.me> | 2013-09-05 17:13:50 -0700 |
commit | 1be09dfc25816acc87d96f82348d3bb3844d328e (patch) | |
tree | f5b80a55876d3c847bc7ba10e31e6b1117233c4d /deps/npm/lib/outdated.js | |
parent | 1da7bcc22ca115d4cb17193bc97cda027ebe2e30 (diff) | |
download | node-1be09dfc25816acc87d96f82348d3bb3844d328e.tar.gz |
npm: upgrade to v1.3.10
Diffstat (limited to 'deps/npm/lib/outdated.js')
-rw-r--r-- | deps/npm/lib/outdated.js | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/deps/npm/lib/outdated.js b/deps/npm/lib/outdated.js index b21e10d06..d9ef3ca0b 100644 --- a/deps/npm/lib/outdated.js +++ b/deps/npm/lib/outdated.js @@ -24,6 +24,7 @@ var path = require("path") , cache = require("./cache.js") , asyncMap = require("slide").asyncMap , npm = require("./npm.js") + , url = require("url") function outdated (args, silent, cb) { if (typeof cb !== "function") cb = silent, silent = false @@ -143,7 +144,7 @@ function shouldUpdate (args, dir, dep, has, req, cb) { } function doIt (shouldHave) { - cb(null, [[ dir, dep, curr.version, shouldHave, req ]]) + cb(null, [[ dir, dep, curr && curr.version, shouldHave, req ]]) } if (args.length && args.indexOf(dep) === -1) { @@ -153,9 +154,18 @@ function shouldUpdate (args, dir, dep, has, req, cb) { // so, we can conceivably update this. find out if we need to. cache.add(dep, req, function (er, d) { // if this fails, then it means we can't update this thing. - // it's probably a thing that isn't published. otherwise - // check that the origin hasn't changed (#1727) and that + // it's probably a thing that isn't published. + if (er) return skip() + + // check that the url origin hasn't changed (#1727) and that // there is no newer version available - return (er || (d._from === curr.from && d.version === has[dep])) ? skip() : doIt(d.version) + var dFromUrl = d._from && url.parse(d._from).protocol + var cFromUrl = curr && curr.from && url.parse(curr.from).protocol + + if (!curr || dFromUrl && cFromUrl && d._from !== curr.from + || d.version !== curr.version) + doIt(d.version) + else + skip() }) } |