summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/tar/lib/write-entry.js
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2018-04-05 22:51:49 +0200
committerAnna Henningsen <anna@addaleax.net>2018-04-05 23:00:02 +0200
commite37effe4cec98688e75d770f4d0b7f68927e2b73 (patch)
treee7efa0fc8a2139f9aba4b66ea3f3613262f20cef /deps/npm/node_modules/tar/lib/write-entry.js
parent026f6b787a7a23597790f1f0b076c58a68c7c38b (diff)
downloadandroid-node-v8-e37effe4cec98688e75d770f4d0b7f68927e2b73.tar.gz
android-node-v8-e37effe4cec98688e75d770f4d0b7f68927e2b73.tar.bz2
android-node-v8-e37effe4cec98688e75d770f4d0b7f68927e2b73.zip
Revert "deps: upgrade npm to 5.8.0"
This reverts commit 25a816dcda7b1db0929501acfe13f2fe5119759b. PR-URL: https://github.com/nodejs/node/pull/19837 Reviewed-By: Gus Caplan <me@gus.host>
Diffstat (limited to 'deps/npm/node_modules/tar/lib/write-entry.js')
-rw-r--r--deps/npm/node_modules/tar/lib/write-entry.js45
1 files changed, 19 insertions, 26 deletions
diff --git a/deps/npm/node_modules/tar/lib/write-entry.js b/deps/npm/node_modules/tar/lib/write-entry.js
index 4eddb8b7c9..f562bf138a 100644
--- a/deps/npm/node_modules/tar/lib/write-entry.js
+++ b/deps/npm/node_modules/tar/lib/write-entry.js
@@ -44,9 +44,6 @@ const WriteEntry = warner(class WriteEntry extends MiniPass {
this.cwd = opt.cwd || process.cwd()
this.strict = !!opt.strict
this.noPax = !!opt.noPax
- this.noMtime = !!opt.noMtime
- this.mtime = opt.mtime || null
-
if (typeof opt.onwarn === 'function')
this.on('warn', opt.onwarn)
@@ -104,9 +101,6 @@ const WriteEntry = warner(class WriteEntry extends MiniPass {
}
[HEADER] () {
- if (this.type === 'Directory' && this.portable)
- this.noMtime = true
-
this.header = new Header({
path: this.path,
linkpath: this.linkpath,
@@ -116,7 +110,8 @@ const WriteEntry = warner(class WriteEntry extends MiniPass {
uid: this.portable ? null : this.stat.uid,
gid: this.portable ? null : this.stat.gid,
size: this.stat.size,
- mtime: this.noMtime ? null : this.mtime || this.stat.mtime,
+ mtime: this.type === 'Directory' && this.portable
+ ? null : this.stat.mtime,
type: this.type,
uname: this.portable ? null :
this.stat.uid === this.myuid ? this.myuser : '',
@@ -129,7 +124,7 @@ const WriteEntry = warner(class WriteEntry extends MiniPass {
atime: this.portable ? null : this.header.atime,
ctime: this.portable ? null : this.header.ctime,
gid: this.portable ? null : this.header.gid,
- mtime: this.noMtime ? null : this.mtime || this.header.mtime,
+ mtime: this.header.mtime,
path: this.path,
linkpath: this.linkpath,
size: this.header.size,
@@ -299,30 +294,28 @@ const WriteEntryTar = warner(class WriteEntryTar extends MiniPass {
constructor (readEntry, opt) {
opt = opt || {}
super(opt)
- this.preservePaths = !!opt.preservePaths
- this.portable = !!opt.portable
- this.strict = !!opt.strict
- this.noPax = !!opt.noPax
- this.noMtime = !!opt.noMtime
-
this.readEntry = readEntry
this.type = readEntry.type
- if (this.type === 'Directory' && this.portable)
- this.noMtime = true
-
this.path = readEntry.path
this.mode = readEntry.mode
if (this.mode)
this.mode = this.mode & 0o7777
- this.uid = this.portable ? null : readEntry.uid
- this.gid = this.portable ? null : readEntry.gid
- this.uname = this.portable ? null : readEntry.uname
- this.gname = this.portable ? null : readEntry.gname
+ this.uid = readEntry.uid
+ this.gid = readEntry.gid
+ this.uname = readEntry.uname
+ this.gname = readEntry.gname
this.size = readEntry.size
- this.mtime = this.noMtime ? null : opt.mtime || readEntry.mtime
- this.atime = this.portable ? null : readEntry.atime
- this.ctime = this.portable ? null : readEntry.ctime
+ this.mtime = readEntry.mtime
+ this.atime = readEntry.atime
+ this.ctime = readEntry.ctime
this.linkpath = readEntry.linkpath
+ this.uname = readEntry.uname
+ this.gname = readEntry.gname
+
+ this.preservePaths = !!opt.preservePaths
+ this.portable = !!opt.portable
+ this.strict = !!opt.strict
+ this.noPax = !!opt.noPax
if (typeof opt.onwarn === 'function')
this.on('warn', opt.onwarn)
@@ -348,7 +341,7 @@ const WriteEntryTar = warner(class WriteEntryTar extends MiniPass {
uid: this.portable ? null : this.uid,
gid: this.portable ? null : this.gid,
size: this.size,
- mtime: this.noMtime ? null : this.mtime,
+ mtime: this.mtime,
type: this.type,
uname: this.portable ? null : this.uname,
atime: this.portable ? null : this.atime,
@@ -360,7 +353,7 @@ const WriteEntryTar = warner(class WriteEntryTar extends MiniPass {
atime: this.portable ? null : this.atime,
ctime: this.portable ? null : this.ctime,
gid: this.portable ? null : this.gid,
- mtime: this.noMtime ? null : this.mtime,
+ mtime: this.mtime,
path: this.path,
linkpath: this.linkpath,
size: this.size,