Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1109123

Summary: xzgrep returns wrong exitcode if match isn't found in every file
Product: Red Hat Enterprise Linux 7 Reporter: Pavel Raiskup <praiskup>
Component: xzAssignee: Pavel Raiskup <praiskup>
Status: CLOSED ERRATA QA Contact: qe-baseos-daemons
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0CC: jpopelka, jscotka, lmiksik, ovasik, rskvaril, todoleza
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: xz-5.1.2-10alpha.el7 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.
Story Points: ---
Clone Of: 1108085 Environment:
Last Closed: 2015-08-12 07:48:43 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1108085, 1190713, 1202520    
Bug Blocks: 1109122, 1110706, 1191020    

Description Pavel Raiskup 2014-06-13 09:47:17 UTC
+++ This bug was initially created as a clone of Bug #1108085 +++

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

--- Additional comment from Pavel Raiskup on 2014-06-11 16:26:56 CEST ---

Thanks, this seems to be upstream problem, reported:
http://article.gmane.org/gmane.comp.compression.xz.devel/192

--- Additional comment from Pavel Raiskup on 2014-06-12 12:56:07 CEST ---

Fix pushed upstream:
http://git.tukaani.org/?p=xz.git;a=commitdiff;h=ceca379

------

(already fixed in RHEL-6.6)

Comment 1 Radka Brychtova 2014-09-23 16:35:27 UTC
*** Bug 1145754 has been marked as a duplicate of this bug. ***

Comment 2 Pavel Raiskup 2014-09-23 20:10:26 UTC
Moving to 7.2 FAST.  Already fixed in RHEL6.

Comment 7 errata-xmlrpc 2015-08-12 07:48:43 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.

https://rhn.redhat.com/errata/RHBA-2015-1598.html