Extract tar.lz

tring to add ddrescue to repository but I face this problem

. /home/build/sunxi/include/shell.sh;  /home/build/sunxi/dl/ddrescue-1.23.tar.lz | tar -C /home/build/sunxi/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/ddrescue-1.23/.. -xf -
bash: /home/build/sunxi/dl/ddrescue-1.23.tar.lz: Permission denied
tar: This does not look like a tar archive
tar: Exiting with failure status due to previous errors

if I manually do it like tar -xvf ddrescue-1.23.tar.lz it works, how should I change the way this file type is extracted ?

for the moment I converted it to .tar.xz

Regards

Three options:

  • ask upstream to provide a 'normal' tarball (gz, bz2, xz), instead of drinking the kool-aid from the lzip author.
  • provide a repacked tarball yourself
  • add lzip specific extractor support to include/unpack.mk
1 Like

Set PKG_CAT:=xzcat in your Makefile.

1 Like

thank you for input but

xzcat: /home/build/sunxi/dl/ddrescue-1.23.tar.lz: File format not recognized
tar: This does not look like a tar archive
tar: Exiting with failure status due to previous errors

tar -xvf ddrescue-1.23.tar.lz works for me on Ubuntu 16.04 which has tar (GNU tar) 1.28. Wikipedia says:

Versions 1.23 and newer of GNU tar support using lzip to handle compressed files transparently

While lzip and xz both use lzma as compressor, the meta formats are not the same. You most likely need to use the lzip tools.

yes, on my system too, but the openwrt sdk can't extract it properly, I'll look into unpack.mk maybe I can do something

edit:
anyway if lzip is not installed (not a dependency of sdk)

tar (child): lzip: Cannot exec: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now

@jow can you look at this https://github.com/openwrt/openwrt/pull/867

Regards