mafintosh/tar-fs

[bug] don't respect relative paths on symlinks when using strip option

piranna opened this issue · 0 comments

While trying to decompress the LInux kernel 4.6 with tar-fs with the option {strip: 1} I've got the next error:

{ Error: ENOENT: no such file or directory, symlink '' -> 'tmp/linux/arch/arm/boot/dts/sun8i-a23-ippo-q8h-v1.2.dts'
    at Error (native)
  errno: -2,
  code: 'ENOENT',
  syscall: 'symlink',
  path: '',
  dest: 'tmp/linux/arch/arm/boot/dts/sun8i-a23-ippo-q8h-v1.2.dts' }
    at errorPurge (/home/piranna/Proyectos/download-manager/index.js:200:15)
    at ClientRequest.<anonymous> (/home/piranna/Proyectos/download-manager/index.js:215:11)
    at ClientRequest.g (events.js:286:16)
    at emitNone (events.js:86:13)
    at ClientRequest.emit (events.js:185:7)
    at emitAbortNT (_http_client.js:247:8)
    at _combinedTickCallback (internal/process/next_tick.js:71:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)

Looking at the Linux kernet itself, that symlink should be pointing to sun8i-a23-q8-tablet.dts instead of being an empty string, and reviewing the tar-fs source code I think the problem is that it's changing inconditionally all the symlinks destinations, while it should don't do it when they are relative paths.