diff options
author | Kat Marchán <kzm@sykosomatic.org> | 2015-09-04 14:47:14 -0700 |
---|---|---|
committer | Rod Vagg <rod@vagg.org> | 2015-09-06 21:38:09 +1000 |
commit | d15ba80d6f7a473a70081768500260429ecb6218 (patch) | |
tree | d83559d4277c56eab5fffb986dd1e4ec8db94a4b /deps/npm/node_modules/chownr | |
parent | b4f1711a629251f6aab7615907fe7358881e0648 (diff) | |
download | android-node-v8-d15ba80d6f7a473a70081768500260429ecb6218.tar.gz android-node-v8-d15ba80d6f7a473a70081768500260429ecb6218.tar.bz2 android-node-v8-d15ba80d6f7a473a70081768500260429ecb6218.zip |
deps: upgrade to npm 2.14.2
PR-URL: https://github.com/nodejs/node/pull/2696
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Rod Vagg <rod@vagg.org>
Diffstat (limited to 'deps/npm/node_modules/chownr')
-rw-r--r-- | deps/npm/node_modules/chownr/LICENCE | 25 | ||||
-rw-r--r-- | deps/npm/node_modules/chownr/chownr.js | 15 | ||||
-rw-r--r-- | deps/npm/node_modules/chownr/package.json | 28 | ||||
-rw-r--r-- | deps/npm/node_modules/chownr/test/basic.js | 84 | ||||
-rw-r--r-- | deps/npm/node_modules/chownr/test/sync.js | 79 |
5 files changed, 29 insertions, 202 deletions
diff --git a/deps/npm/node_modules/chownr/LICENCE b/deps/npm/node_modules/chownr/LICENCE deleted file mode 100644 index 74489e2e26..0000000000 --- a/deps/npm/node_modules/chownr/LICENCE +++ /dev/null @@ -1,25 +0,0 @@ -Copyright (c) Isaac Z. Schlueter -All rights reserved. - -The BSD License - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS -``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. diff --git a/deps/npm/node_modules/chownr/chownr.js b/deps/npm/node_modules/chownr/chownr.js index 598b8f8441..ecd7b452df 100644 --- a/deps/npm/node_modules/chownr/chownr.js +++ b/deps/npm/node_modules/chownr/chownr.js @@ -14,7 +14,15 @@ function chownr (p, uid, gid, cb) { var len = children.length , errState = null children.forEach(function (child) { - chownr(path.resolve(p, child), uid, gid, then) + var pathChild = path.resolve(p, child); + fs.lstat(pathChild, function(er, stats) { + if (er) + return cb(er) + if (!stats.isSymbolicLink()) + chownr(pathChild, uid, gid, then) + else + then() + }) }) function then (er) { if (errState) return @@ -35,7 +43,10 @@ function chownrSync (p, uid, gid) { if (!children.length) return fs.chownSync(p, uid, gid) children.forEach(function (child) { - chownrSync(path.resolve(p, child), uid, gid) + var pathChild = path.resolve(p, child) + var stats = fs.lstatSync(pathChild) + if (!stats.isSymbolicLink()) + chownrSync(pathChild, uid, gid) }) return fs.chownSync(p, uid, gid) } diff --git a/deps/npm/node_modules/chownr/package.json b/deps/npm/node_modules/chownr/package.json index a551c869ec..fdd1dd2308 100644 --- a/deps/npm/node_modules/chownr/package.json +++ b/deps/npm/node_modules/chownr/package.json @@ -6,38 +6,41 @@ }, "name": "chownr", "description": "like `chown -R`", - "version": "0.0.2", + "version": "1.0.1", "repository": { "type": "git", "url": "git://github.com/isaacs/chownr.git" }, "main": "chownr.js", + "files": [ + "chownr.js" + ], "devDependencies": { - "tap": "0.2", "mkdirp": "0.3", - "rimraf": "" + "rimraf": "", + "tap": "^1.2.0" }, "scripts": { "test": "tap test/*.js" }, "license": "ISC", - "gitHead": "3cafeb70b2c343e893f710750406b3909ec537cb", + "gitHead": "c6c43844e80d7c7045e737a72b9fbb1ba0579a26", "bugs": { "url": "https://github.com/isaacs/chownr/issues" }, "homepage": "https://github.com/isaacs/chownr#readme", - "_id": "chownr@0.0.2", - "_shasum": "2f9aebf746f90808ce00607b72ba73b41604c485", - "_from": "chownr@0.0.2", - "_npmVersion": "2.10.0", - "_nodeVersion": "2.0.1", + "_id": "chownr@1.0.1", + "_shasum": "e2a75042a9551908bebd25b8523d5f9769d79181", + "_from": "chownr@1.0.1", + "_npmVersion": "3.2.2", + "_nodeVersion": "2.2.1", "_npmUser": { "name": "isaacs", "email": "isaacs@npmjs.com" }, "dist": { - "shasum": "2f9aebf746f90808ce00607b72ba73b41604c485", - "tarball": "http://registry.npmjs.org/chownr/-/chownr-0.0.2.tgz" + "shasum": "e2a75042a9551908bebd25b8523d5f9769d79181", + "tarball": "http://registry.npmjs.org/chownr/-/chownr-1.0.1.tgz" }, "maintainers": [ { @@ -46,5 +49,6 @@ } ], "directories": {}, - "_resolved": "https://registry.npmjs.org/chownr/-/chownr-0.0.2.tgz" + "_resolved": "https://registry.npmjs.org/chownr/-/chownr-1.0.1.tgz", + "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/chownr/test/basic.js b/deps/npm/node_modules/chownr/test/basic.js deleted file mode 100644 index 9e4f6bde03..0000000000 --- a/deps/npm/node_modules/chownr/test/basic.js +++ /dev/null @@ -1,84 +0,0 @@ -if (!process.getuid || !process.getgid) { - throw new Error("Tests require getuid/getgid support") -} - -var curUid = +process.getuid() -, curGid = +process.getgid() -, chownr = require("../") -, test = require("tap").test -, mkdirp = require("mkdirp") -, rimraf = require("rimraf") -, fs = require("fs") - -// sniff the 'id' command for other groups that i can legally assign to -var exec = require("child_process").exec -, groups -, dirs = [] - -exec("id", function (code, output) { - if (code) throw new Error("failed to run 'id' command") - groups = output.trim().split("groups=")[1].split(",").map(function (s) { - return parseInt(s, 10) - }).filter(function (g) { - return g !== curGid - }) - - console.error([curUid, groups[0]], "uid, gid") - - rimraf("/tmp/chownr", function (er) { - if (er) throw er - var cnt = 5 - for (var i = 0; i < 5; i ++) { - mkdirp(getDir(), then) - } - function then (er) { - if (er) throw er - if (-- cnt === 0) { - runTest() - } - } - }) -}) - -function getDir () { - var dir = "/tmp/chownr" - - dir += "/" + Math.floor(Math.random() * Math.pow(16,4)).toString(16) - dirs.push(dir) - dir += "/" + Math.floor(Math.random() * Math.pow(16,4)).toString(16) - dirs.push(dir) - dir += "/" + Math.floor(Math.random() * Math.pow(16,4)).toString(16) - dirs.push(dir) - return dir -} - -function runTest () { - test("should complete successfully", function (t) { - console.error("calling chownr", curUid, groups[0], typeof curUid, typeof groups[0]) - chownr("/tmp/chownr", curUid, groups[0], function (er) { - t.ifError(er) - t.end() - }) - }) - - dirs.forEach(function (dir) { - test("verify "+dir, function (t) { - fs.stat(dir, function (er, st) { - if (er) { - t.ifError(er) - return t.end() - } - t.equal(st.uid, curUid, "uid should be " + curUid) - t.equal(st.gid, groups[0], "gid should be "+groups[0]) - t.end() - }) - }) - }) - - test("cleanup", function (t) { - rimraf("/tmp/chownr/", function (er) { - t.ifError(er) - t.end() - }) - }) -} diff --git a/deps/npm/node_modules/chownr/test/sync.js b/deps/npm/node_modules/chownr/test/sync.js deleted file mode 100644 index 2e26c56aaf..0000000000 --- a/deps/npm/node_modules/chownr/test/sync.js +++ /dev/null @@ -1,79 +0,0 @@ -if (!process.getuid || !process.getgid) { - throw new Error("Tests require getuid/getgid support") -} - -var curUid = +process.getuid() -, curGid = +process.getgid() -, chownr = require("../") -, test = require("tap").test -, mkdirp = require("mkdirp") -, rimraf = require("rimraf") -, fs = require("fs") - -// sniff the 'id' command for other groups that i can legally assign to -var exec = require("child_process").exec -, groups -, dirs = [] - -exec("id", function (code, output) { - if (code) throw new Error("failed to run 'id' command") - groups = output.trim().split("groups=")[1].split(",").map(function (s) { - return parseInt(s, 10) - }).filter(function (g) { - return g !== curGid - }) - - console.error([curUid, groups[0]], "uid, gid") - - rimraf("/tmp/chownr", function (er) { - if (er) throw er - var cnt = 5 - for (var i = 0; i < 5; i ++) { - mkdirp(getDir(), then) - } - function then (er) { - if (er) throw er - if (-- cnt === 0) { - runTest() - } - } - }) -}) - -function getDir () { - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var dir = "/tmp/chownr/" + [x,y,z].join("/") - dirs.push(dir) - return dir -} - -function runTest () { - test("should complete successfully", function (t) { - console.error("calling chownr", curUid, groups[0], typeof curUid, typeof groups[0]) - chownr.sync("/tmp/chownr", curUid, groups[0]) - t.end() - }) - - dirs.forEach(function (dir) { - test("verify "+dir, function (t) { - fs.stat(dir, function (er, st) { - if (er) { - t.ifError(er) - return t.end() - } - t.equal(st.uid, curUid, "uid should be " + curUid) - t.equal(st.gid, groups[0], "gid should be "+groups[0]) - t.end() - }) - }) - }) - - test("cleanup", function (t) { - rimraf("/tmp/chownr/", function (er) { - t.ifError(er) - t.end() - }) - }) -} |