On Thu, Oct 19, 2017 at 04:41:04PM +0900, Mike Hommey wrote: > On Thu, Oct 19, 2017 at 03:57:29PM +0900, Mike Hommey wrote: > > On Wed, Oct 18, 2017 at 09:27:29PM +0900, Mike Hommey wrote: > > > Package: diffoscope > > > Version: 87 > > > Severity: normal > > > > > > While diffing firefox, zipinfo is run on omni.ja, and issues warnings > > > like: > > > warning [/tmp/tmplgigxgm__diffoscope/0/24]: 17283883 extra bytes at > > > beginning or within zipfile > > > > > > Now, when both ends have the same warning, as expected, the diff still > > > shows a difference because of the /tmp/tmp*__diffoscope/0/fd path. > > > > Note these messages are sent to stderr, and I noticed that for readelf, > > stderr is not part of the diff. It seems it would make sense to do the > > same for zipinfo. > > The code actually does the same thing as for readelf. The problem is > that zipinfo is not consistently sending its warning to stderr. > > $ zipinfo omni.ja > /dev/null > warning [omni.ja]: 17283876 extra bytes at beginning or within zipfile > (attempting to process anyway) > error [omni.ja]: reported length of central directory is > -17283876 bytes too long (Atari STZip zipfile? J.H.Holm ZIPSPLIT 1.1 > zipfile?). Compensating... > > ^ means the warnings are on stderr, right? Nope > > $ zipinfo omni.ja 2> /dev/null | grep -v 10-Jan-01 > Archive: omni.ja > Zip file size: 17400328 bytes, number of entries: 1313 > warning [omni.ja]: 17283876 extra bytes at beginning or within zipfile > (attempting to process anyway) > error [omni.ja]: reported length of central directory is > -17283876 bytes too long (Atari STZip zipfile? J.H.Holm ZIPSPLIT 1.1 > zipfile?). Compensating... > 1313 files, 17188436 bytes uncompressed, 17188436 bytes compressed: 0.0% > > It looks like it only sends those messages to stderr when it's a tty.
I haven't found a way to make things work with zipinfo's crazy behavior, however, I was able to get the zip comparator to work by using libarchive, like for other archive formats. I still need to do some more cleanup of the code, adjust the apk comparator, and adjust tests. Mike

