summaryrefslogtreecommitdiff
path: root/deps/npm/lib
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2013-09-05 17:13:50 -0700
committerisaacs <i@izs.me>2013-09-05 17:13:50 -0700
commit1be09dfc25816acc87d96f82348d3bb3844d328e (patch)
treef5b80a55876d3c847bc7ba10e31e6b1117233c4d /deps/npm/lib
parent1da7bcc22ca115d4cb17193bc97cda027ebe2e30 (diff)
downloadandroid-node-v8-1be09dfc25816acc87d96f82348d3bb3844d328e.tar.gz
android-node-v8-1be09dfc25816acc87d96f82348d3bb3844d328e.tar.bz2
android-node-v8-1be09dfc25816acc87d96f82348d3bb3844d328e.zip
npm: upgrade to v1.3.10
Diffstat (limited to 'deps/npm/lib')
-rw-r--r--deps/npm/lib/npm.js1
-rw-r--r--deps/npm/lib/outdated.js18
-rw-r--r--deps/npm/lib/prune.js16
3 files changed, 29 insertions, 6 deletions
diff --git a/deps/npm/lib/npm.js b/deps/npm/lib/npm.js
index 8b8ee95b08..0d1e32f0fa 100644
--- a/deps/npm/lib/npm.js
+++ b/deps/npm/lib/npm.js
@@ -106,6 +106,7 @@ var commandCache = {}
, "tst": "test"
, "find-dupes": "dedupe"
, "ddp": "dedupe"
+ , "v": "view"
}
, aliasNames = Object.keys(aliases)
diff --git a/deps/npm/lib/outdated.js b/deps/npm/lib/outdated.js
index b21e10d06f..d9ef3ca0b9 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()
})
}
diff --git a/deps/npm/lib/prune.js b/deps/npm/lib/prune.js
index 2afb2b9988..dbe8790b9d 100644
--- a/deps/npm/lib/prune.js
+++ b/deps/npm/lib/prune.js
@@ -6,13 +6,25 @@ prune.usage = "npm prune"
var readInstalled = require("read-installed")
, npm = require("./npm.js")
+ , path = require("path")
+ , readJson = require("read-package-json")
+ , log = require("npmlog")
prune.completion = require("./utils/completion/installed-deep.js")
function prune (args, cb) {
- readInstalled(npm.prefix, npm.config.get("depth"), function (er, data) {
+ var jsonFile = path.resolve(npm.dir, "..", "package.json" )
+ readJson(jsonFile, log.warn, function (er, packageData) {
if (er) return cb(er)
- prune_(args, data, cb)
+ readInstalled(npm.prefix, npm.config.get("depth"), function (er, data) {
+ if (er) return cb(er)
+ if (npm.config.get("production")) {
+ Object.keys(packageData.devDependencies || {}).forEach(function (k) {
+ if (data.dependencies[k]) data.dependencies[k].extraneous = true
+ })
+ }
+ prune_(args, data, cb)
+ })
})
}