aboutsummaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/tar
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/node_modules/tar')
-rw-r--r--deps/npm/node_modules/tar/README.md3
-rw-r--r--deps/npm/node_modules/tar/lib/header.js22
-rw-r--r--deps/npm/node_modules/tar/lib/parse.js2
-rw-r--r--deps/npm/node_modules/tar/lib/unpack.js8
-rw-r--r--deps/npm/node_modules/tar/package.json22
5 files changed, 40 insertions, 17 deletions
diff --git a/deps/npm/node_modules/tar/README.md b/deps/npm/node_modules/tar/README.md
index fc55bc36fe..262dd063eb 100644
--- a/deps/npm/node_modules/tar/README.md
+++ b/deps/npm/node_modules/tar/README.md
@@ -230,6 +230,9 @@ The following options are supported:
Note that this prevents using other mtime-based features like
`tar.update` or the `keepNewer` option with the resulting tar archive.
[Alias: `m`, `no-mtime`]
+- `mtime` Set to a `Date` object to force a specific `mtime` for
+ everything added to the archive. Overridden by `noMtime`.
+
The following options are mostly internal, but can be modified in some
advanced use cases, such as re-using caches between runs.
diff --git a/deps/npm/node_modules/tar/lib/header.js b/deps/npm/node_modules/tar/lib/header.js
index cad4aec255..d29c3b9906 100644
--- a/deps/npm/node_modules/tar/lib/header.js
+++ b/deps/npm/node_modules/tar/lib/header.js
@@ -9,10 +9,11 @@ const types = require('./types.js')
const pathModule = require('path').posix
const large = require('./large-numbers.js')
+const SLURP = Symbol('slurp')
const TYPE = Symbol('type')
class Header {
- constructor (data, off) {
+ constructor (data, off, ex, gex) {
this.cksumValid = false
this.needPax = false
this.nullBlock = false
@@ -35,12 +36,12 @@ class Header {
this.ctime = null
if (Buffer.isBuffer(data))
- this.decode(data, off || 0)
+ this.decode(data, off || 0, ex, gex)
else if (data)
this.set(data)
}
- decode (buf, off) {
+ decode (buf, off, ex, gex) {
if (!off)
off = 0
@@ -55,6 +56,11 @@ class Header {
this.mtime = decDate(buf, off + 136, 12)
this.cksum = decNumber(buf, off + 148, 12)
+ // if we have extended or global extended headers, apply them now
+ // See https://github.com/npm/node-tar/pull/187
+ this[SLURP](ex)
+ this[SLURP](gex, true)
+
// old tar versions marked dirs as a file with a trailing /
this[TYPE] = decString(buf, off + 156, 1)
if (this[TYPE] === '')
@@ -101,6 +107,16 @@ class Header {
this.nullBlock = true
}
+ [SLURP] (ex, global) {
+ for (let k in ex) {
+ // we slurp in everything except for the path attribute in
+ // a global extended header, because that's weird.
+ if (ex[k] !== null && ex[k] !== undefined &&
+ !(global && k === 'path'))
+ this[k] = ex[k]
+ }
+ }
+
encode (buf, off) {
if (!buf) {
buf = this.block = Buffer.alloc(512)
diff --git a/deps/npm/node_modules/tar/lib/parse.js b/deps/npm/node_modules/tar/lib/parse.js
index 2a73b2bb72..df84079fd3 100644
--- a/deps/npm/node_modules/tar/lib/parse.js
+++ b/deps/npm/node_modules/tar/lib/parse.js
@@ -101,7 +101,7 @@ module.exports = warner(class Parser extends EE {
}
[CONSUMEHEADER] (chunk, position) {
- const header = new Header(chunk, position)
+ const header = new Header(chunk, position, this[EX], this[GEX])
if (header.nullBlock)
this[EMIT]('nullBlock')
diff --git a/deps/npm/node_modules/tar/lib/unpack.js b/deps/npm/node_modules/tar/lib/unpack.js
index 5b79cda09a..dcbdd19e1c 100644
--- a/deps/npm/node_modules/tar/lib/unpack.js
+++ b/deps/npm/node_modules/tar/lib/unpack.js
@@ -331,8 +331,10 @@ class Unpack extends Parser {
})
const tx = this.transform ? this.transform(entry) || entry : entry
- if (tx !== entry)
+ if (tx !== entry) {
+ tx.on('error', er => this[ONERROR](er, entry))
entry.pipe(tx)
+ }
tx.pipe(stream)
}
@@ -512,8 +514,10 @@ class UnpackSync extends Unpack {
return oner(er)
}
const tx = this.transform ? this.transform(entry) || entry : entry
- if (tx !== entry)
+ if (tx !== entry) {
+ tx.on('error', er => this[ONERROR](er, entry))
entry.pipe(tx)
+ }
tx.on('data', chunk => {
try {
diff --git a/deps/npm/node_modules/tar/package.json b/deps/npm/node_modules/tar/package.json
index a4b9e0053f..5cfb10128e 100644
--- a/deps/npm/node_modules/tar/package.json
+++ b/deps/npm/node_modules/tar/package.json
@@ -1,29 +1,29 @@
{
- "_from": "tar@4.4.4",
- "_id": "tar@4.4.4",
+ "_from": "tar@4.4.6",
+ "_id": "tar@4.4.6",
"_inBundle": false,
- "_integrity": "sha512-mq9ixIYfNF9SK0IS/h2HKMu8Q2iaCuhDDsZhdEag/FHv8fOaYld4vN7ouMgcSSt5WKZzPs8atclTcJm36OTh4w==",
+ "_integrity": "sha512-tMkTnh9EdzxyfW+6GK6fCahagXsnYk6kE6S9Gr9pjVdys769+laCTbodXDhPAjzVtEBazRgP0gYqOjnk9dQzLg==",
"_location": "/tar",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
- "raw": "tar@4.4.4",
+ "raw": "tar@4.4.6",
"name": "tar",
"escapedName": "tar",
- "rawSpec": "4.4.4",
+ "rawSpec": "4.4.6",
"saveSpec": null,
- "fetchSpec": "4.4.4"
+ "fetchSpec": "4.4.6"
},
"_requiredBy": [
"#USER",
"/",
"/pacote"
],
- "_resolved": "https://registry.npmjs.org/tar/-/tar-4.4.4.tgz",
- "_shasum": "ec8409fae9f665a4355cc3b4087d0820232bb8cd",
- "_spec": "tar@4.4.4",
- "_where": "/Users/rebecca/code/npm",
+ "_resolved": "https://registry.npmjs.org/tar/-/tar-4.4.6.tgz",
+ "_shasum": "63110f09c00b4e60ac8bcfe1bf3c8660235fbc9b",
+ "_spec": "tar@4.4.6",
+ "_where": "/Users/zkat/Documents/code/work/npm",
"author": {
"name": "Isaac Z. Schlueter",
"email": "i@izs.me",
@@ -76,5 +76,5 @@
"preversion": "npm test",
"test": "tap test/*.js --100 -J --coverage-report=text -c"
},
- "version": "4.4.4"
+ "version": "4.4.6"
}