diff options
author | isaacs <i@izs.me> | 2014-06-25 00:52:55 +0400 |
---|---|---|
committer | isaacs <i@izs.me> | 2014-06-25 00:52:55 +0400 |
commit | 4562f9dd560a2d6a82cca5a1c340efbae61bde4a (patch) | |
tree | e5c4d7f7935b851724c1f4bf1cb097df65cc4164 /node_modules/tar | |
parent | 30b7eb9f2bde00c5db730c6ec51b6de4db65b61b (diff) |
bump tar and fstream deps
Diffstat (limited to 'node_modules/tar')
-rw-r--r-- | node_modules/tar/README.md | 2 | ||||
-rw-r--r-- | node_modules/tar/examples/packer.js | 10 | ||||
-rw-r--r-- | node_modules/tar/lib/parse.js | 7 | ||||
-rw-r--r-- | node_modules/tar/package.json | 18 | ||||
-rw-r--r-- | node_modules/tar/test/extract.js | 23 |
5 files changed, 40 insertions, 20 deletions
diff --git a/node_modules/tar/README.md b/node_modules/tar/README.md index 5bcc82cd8..424a2782b 100644 --- a/node_modules/tar/README.md +++ b/node_modules/tar/README.md @@ -19,6 +19,8 @@ Returns a through stream. Use pack stream and you will receive tar archive data from the pack stream. +This only works with directories, it does not work with individual files. + The optional `properties` object are used to set properties in the tar 'Global Extended Header'. diff --git a/node_modules/tar/examples/packer.js b/node_modules/tar/examples/packer.js new file mode 100644 index 000000000..ebe38926e --- /dev/null +++ b/node_modules/tar/examples/packer.js @@ -0,0 +1,10 @@ +var tar = require("../tar.js") + , fstream = require("fstream") + , fs = require("fs") + +var dir_destination = fs.createWriteStream('dir.tar') + +// This must be a "directory" +fstream.Reader({ path: __dirname, type: "Directory" }) + .pipe(tar.Pack({ noProprietary: true })) + .pipe(dir_destination)
\ No newline at end of file diff --git a/node_modules/tar/lib/parse.js b/node_modules/tar/lib/parse.js index 884e73dba..009a85f41 100644 --- a/node_modules/tar/lib/parse.js +++ b/node_modules/tar/lib/parse.js @@ -37,6 +37,7 @@ function Parse () { me.readable = true me._stream = new BlockStream(512) me.position = 0 + me._ended = false me._stream.on("error", function (e) { me.emit("error", e) @@ -118,13 +119,13 @@ Parse.prototype._process = function (c) { // so appending one tarball to another is technically valid. // ending without the eof null blocks is not allowed, however. if (zero) { - this._ended = this._eofStarted + if (this._eofStarted) + this._ended = true this._eofStarted = true } else { - this._ended = this._eofStarted = false + this._eofStarted = false this._startEntry(c) } - } this.position += 512 diff --git a/node_modules/tar/package.json b/node_modules/tar/package.json index 4c69c4ba2..2f261b890 100644 --- a/node_modules/tar/package.json +++ b/node_modules/tar/package.json @@ -6,7 +6,7 @@ }, "name": "tar", "description": "tar for node", - "version": "0.1.19", + "version": "0.1.20", "repository": { "type": "git", "url": "git://github.com/isaacs/node-tar.git" @@ -16,25 +16,23 @@ "test": "tap test/*.js" }, "dependencies": { - "inherits": "2", "block-stream": "*", - "fstream": "~0.1.8" + "fstream": "~0.1.28", + "inherits": "2" }, "devDependencies": { "tap": "0.x", "rimraf": "1.x" }, "license": "BSD", - "readme": "# node-tar\n\nTar for Node.js.\n\n[![NPM](https://nodei.co/npm/tar.png)](https://nodei.co/npm/tar/)\n\n## API\n\nSee `examples/` for usage examples.\n\n### var tar = require('tar')\n\nReturns an object with `.Pack`, `.Extract` and `.Parse` methods.\n\n### tar.Pack([properties])\n\nReturns a through stream. Use\n[fstream](https://npmjs.org/package/fstream) to write files into the\npack stream and you will receive tar archive data from the pack\nstream.\n\nThe optional `properties` object are used to set properties in the tar\n'Global Extended Header'.\n\n### tar.Extract([options])\n\nReturns a through stream. Write tar data to the stream and the files\nin the tarball will be extracted onto the filesystem.\n\n`options` can be:\n\n```js\n{\n path: '/path/to/extract/tar/into',\n strip: 0, // how many path segments to strip from the root when extracting\n}\n```\n\n`options` also get passed to the `fstream.Writer` instance that `tar`\nuses internally.\n\n### tar.Parse()\n\nReturns a writable stream. Write tar data to it and it will emit\n`entry` events for each entry parsed from the tarball. This is used by\n`tar.Extract`.\n", + "readme": "# node-tar\n\nTar for Node.js.\n\n[![NPM](https://nodei.co/npm/tar.png)](https://nodei.co/npm/tar/)\n\n## API\n\nSee `examples/` for usage examples.\n\n### var tar = require('tar')\n\nReturns an object with `.Pack`, `.Extract` and `.Parse` methods.\n\n### tar.Pack([properties])\n\nReturns a through stream. Use\n[fstream](https://npmjs.org/package/fstream) to write files into the\npack stream and you will receive tar archive data from the pack\nstream.\n\nThis only works with directories, it does not work with individual files.\n\nThe optional `properties` object are used to set properties in the tar\n'Global Extended Header'.\n\n### tar.Extract([options])\n\nReturns a through stream. Write tar data to the stream and the files\nin the tarball will be extracted onto the filesystem.\n\n`options` can be:\n\n```js\n{\n path: '/path/to/extract/tar/into',\n strip: 0, // how many path segments to strip from the root when extracting\n}\n```\n\n`options` also get passed to the `fstream.Writer` instance that `tar`\nuses internally.\n\n### tar.Parse()\n\nReturns a writable stream. Write tar data to it and it will emit\n`entry` events for each entry parsed from the tarball. This is used by\n`tar.Extract`.\n", "readmeFilename": "README.md", + "gitHead": "b5931010907cd1ef5a186bc947954391050cbcce", "bugs": { "url": "https://github.com/isaacs/node-tar/issues" }, "homepage": "https://github.com/isaacs/node-tar", - "_id": "tar@0.1.19", - "dist": { - "shasum": "fe45941799e660ce1ea52d875d37481b4bf13eac" - }, - "_from": "tar@0.1.19", - "_resolved": "https://registry.npmjs.org/tar/-/tar-0.1.19.tgz" + "_id": "tar@0.1.20", + "_shasum": "42940bae5b5f22c74483699126f9f3f27449cb13", + "_from": "tar@~0.1.19" } diff --git a/node_modules/tar/test/extract.js b/node_modules/tar/test/extract.js index fff481816..a68144be9 100644 --- a/node_modules/tar/test/extract.js +++ b/node_modules/tar/test/extract.js @@ -1,3 +1,6 @@ +// Set the umask, so that it works the same everywhere. +process.umask(parseInt('22', 8)) + var tap = require("tap") , tar = require("../tar.js") , fs = require("fs") @@ -114,6 +117,13 @@ var tap = require("tap") size: 200, linkpath: undefined, nlink: 2 }, + { path: '/200LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL', + mode: '120755', + type: 'SymbolicLink', + depth: 1, + size: 200, + linkpath: '200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', + nlink: 1 }, { path: '/200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', mode: '100644', type: 'Link', @@ -121,13 +131,6 @@ var tap = require("tap") size: 200, linkpath: path.join(target, '200-hard'), nlink: 2 }, - { path: '/200LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL', - mode: '120777', - type: 'SymbolicLink', - depth: 1, - size: 200, - linkpath: '200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', - nlink: 1 }, { path: '/c.txt', mode: '100644', type: 'File', @@ -280,6 +283,12 @@ var tap = require("tap") // So, this is as much a test of fstream.Reader and fstream.Writer // as it is of tar.Extract, but it sort of makes sense. +tap.test("preclean", function (t) { + require("rimraf").sync(__dirname + "/tmp/extract-test") + t.pass("cleaned!") + t.end() +}) + tap.test("extract test", function (t) { var extract = tar.Extract(target) var inp = fs.createReadStream(file) |