Merge pull request #54 from piranna/master
Ensure packed symlinks have size zero as required by GNU `tar`
This commit is contained in:
commit
449a70b3e3
2 changed files with 3 additions and 2 deletions
2
pack.js
2
pack.js
|
@ -117,7 +117,7 @@ Pack.prototype.entry = function (header, buffer, callback) {
|
||||||
|
|
||||||
var self = this
|
var self = this
|
||||||
|
|
||||||
if (!header.size) header.size = 0
|
if (!header.size || header.type === 'symlink') header.size = 0
|
||||||
if (!header.type) header.type = modeToType(header.mode)
|
if (!header.type) header.type = modeToType(header.mode)
|
||||||
if (!header.mode) header.mode = header.type === 'directory' ? DMODE : FMODE
|
if (!header.mode) header.mode = header.type === 'directory' ? DMODE : FMODE
|
||||||
if (!header.uid) header.uid = 0
|
if (!header.uid) header.uid = 0
|
||||||
|
|
|
@ -110,7 +110,8 @@ test('types', function (t) {
|
||||||
uname: 'maf',
|
uname: 'maf',
|
||||||
gname: 'staff',
|
gname: 'staff',
|
||||||
uid: 501,
|
uid: 501,
|
||||||
gid: 20
|
gid: 20,
|
||||||
|
size: 9 // Should convert to zero
|
||||||
})
|
})
|
||||||
|
|
||||||
pack.finalize()
|
pack.finalize()
|
||||||
|
|
Loading…
Reference in a new issue