[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: 1.22: zcat does not decompress data anymore [bisected]
From:       Michael Tokarev <mjt () tls ! msk ! ru>
Date:       2014-01-28 9:01:11
Message-ID: 52E771D7.4020500 () msgid ! tls ! msk ! ru
[Download RAW message or body]

28.01.2014 12:48, Michael Tokarev пишет:
> Since this commit:
> 
> commit 41655438c6b61d05ddf3619f31abc1fa3583e2be
> Author: Denys Vlasenko <vda.linux@googlemail.com>
> Date:   Thu Feb 28 18:37:04 2013 +0100
> 
> zcat: fix "zcat FILE" trying to do detection twice
> 
> busybox's zcat does not decompress files without .gz
> extension anymore:
> 
> $ gzip < README > x
> $ ./busybox zcat x | wc -c
> 
> -- before the above commit, it will uncompress the data fine,
> yelding the size of original README file (8763 bytes).  But
> after this commit, it emits compressed data (effectively just
> copies content of the input file), of size 3985 bytes.
> 
> 
> I was about to submit this as a bugreport, but took a look at
> the current git tree, and noticed that apparently, this issue
> has already been fixed by the following two commits:
> 
> commit	7c47b560a8fc97956dd8132bd7f1863d83c19866 (patch)
> libarchive: open_zipped() does not need to check extensions for e.g. gzip
> We only need to check for signature-less extensions, currently only .lzma. The rest \
> can be happily autodetected. This fixes "zcat FILE_WITHOUT_GZ_EXT" case, among \
> others. 
> commit	b664f740d90880560ce46b11f766625341342e80 (patch)
> busybox-b664f740d90880560ce46b11f766625341342e80.tar.bz2
> libbb: open_zipped() should not fail on non-compressed files
> 
> 
> So it looks like the two commits are good candidates for 1.21.

Note that with the above two patches, busybox zcat will happily
accept uncompressed input and will behave like plain cat, while
original zcat refuses to work on uncompressed data:

$ zcat README
gzip: README: not in gzip format
$ ./busybox zcat README | wc -l
204

For some, it might look like a bug.  I've seen scripts verifying
if the data is compressed by running zcat >/dev/null - arguable
those are also broken, but heck...

Note that for (uncompressed) data read from stdin, busybox actually
fails correctly, but does not produce any error message:

$ ./busybox zcat < README
$ echo $?
1

Thanks,

/mjt

_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic