Bug 1108085 - xzgrep returns wrong exitcode if match isn't found in every file
Summary: xzgrep returns wrong exitcode if match isn't found in every file
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: xz
Version: 6.5
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Pavel Raiskup
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks: 1109122 1109123
TreeView+ depends on / blocked
 
Reported: 2014-06-11 12:42 UTC by Tomas Dolezal
Modified: 2014-06-19 08:45 UTC (History)
3 users (show)

Fixed In Version: xz-4.999.9-0.5.beta.20091007git.el6
Doc Type: Bug Fix
Doc Text:
Previously, the xzgrep command returned exit status 1 when contents of one or more files did not match the requested pattern. With this update, xzgrep returns exit status 0 if there is at least one match of the pattern, which makes the xzgrep behavior consistent with the default grep command behavior.
Clone Of:
: 1109122 1109123 (view as bug list)
Environment:
Last Closed: 2014-06-19 08:45:53 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2014:0769 0 normal SHIPPED_LIVE xz bug fix update 2014-06-19 12:45:08 UTC

Description Tomas Dolezal 2014-06-11 12:42:29 UTC
Description of problem:
If xzgrep founds match in only portion of tested files, it returns exitcode 1 where EC 0 is expected as it is default behaviour for grep.

Version-Release number of selected component (if applicable):
xz-4.999.9-0.4.beta.20091007git.el6.x86_64

How reproducible:
always

Steps to Reproduce:
1. echo test | tee test1 | tee test3; echo text > test2
2. xz -z test*
3. xzgrep -l test *.xz || echo fail

Actual results:
test1.xz:test
test3.xz:test
fail

Expected results:
test1.xz:test
test3.xz:test


Additional info:
-l is optional for reproducing

Comment 1 Pavel Raiskup 2014-06-11 14:26:56 UTC
Thanks, this seems to be upstream problem, reported:
http://article.gmane.org/gmane.comp.compression.xz.devel/192

Comment 2 Pavel Raiskup 2014-06-12 10:56:07 UTC
Fix pushed upstream:
http://git.tukaani.org/?p=xz.git;a=commitdiff;h=ceca379

Comment 9 errata-xmlrpc 2014-06-19 08:45:53 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2014-0769.html


Note You need to log in before you can comment on or make changes to this bug.