Package: xz-utils
Version: 5.1.1alpha+20120614-2+b3
Severity: important
Tags: newcomer
I noticed that xzcmp returns status code 2 (error) for a few file pairs,
especially if they differ in size.
After some investigation, I found out that exit status 141 (SIGPIPE) is raised
by the xz-commands, because cmp seems to have already quit after it found the
first difference between the two streams. After that, the two xz commands write
into the broken pipe.
The exit status of the two xz commands is written into $xz_status . At the end
of the script, if $xz_status is not 0, then xzcmp's exit status will become 2
(although the actual CMP did work fine in this specific case)
Workaround:
If the following line is added, the signal SIGPIPE (exit status 141) will not
be raised by the xz commands, and thus, the xzdiff process will return the
correct exit code:
trap '' PIPE
-- System Information:
Debian Release: 8.6
APT prefers stable-updates
APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)
Kernel: Linux 3.16.0-4-amd64 (SMP w/8 CPU cores)
Locale: LANG=de_DE, LC_CTYPE=de_DE (charmap=ISO-8859-1)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
Versions of packages xz-utils depends on:
ii libc6 2.19-18+deb8u6
ii liblzma5 5.1.1alpha+20120614-2+b3
xz-utils recommends no packages.
xz-utils suggests no packages.
-- no debconf information