[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: pxz produces archives broken for busybox's unxz



Hi,

Holger Levsen wrote:

> the typo3 orig.tar.gz as it is in squeeze or sid is sufficient: gunzip it and 
> compress it with pxz and "voila"...

*builds pxz, tests*

Luckily the cause seems to be simple.  pxz works by concatenating
whole XZ files, but for simplicity busybox unxz ignores everything
past the end of the first stream it reads.  Meanwhile standard xz
handles concatenated streams by concatenating their decompressed form.

 $ xz --robot -v -l broken.tar.xz | grep stream
 stream	1	1	0	0	11083380	25169920	0.440	CRC64	0
 stream	2	1	11083380	25169920	5431156	25169920	0.216	CRC64	0
 stream	3	1	16514536	50339840	267724	1505280	0.178	CRC64	0
 $ busybox unxz -c <broken.tar.xz | wc -c
 25169920
 $ xz -dc <broken.tar.xz | wc -c
 51845120

This could be avoided by putting the compressed chunks into Blocks
instead of Streams, but that requires deeper knowledge of the file
format (see /usr/share/doc/liblzma-dev/xz-file-format.txt).  Or
perhaps busybox unxz should learn about concatenated streams.

Simplified example compressed file to play with attached.

	$ printf he | xz >test.xz
	$ echo llo | xz >>test.xz
	$ unxz <test.xz
	hello
	$ busybox unxz <test.xz
	he$

Have fun,
Jonathan

Attachment: concatenated.xz
Description: Binary data


Reply to: