Incorrect exit code 0 on failed search

Bug #1061786 reported by Ignacio Larrain
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
dlocate (Debian)
Fix Released
Unknown
dlocate (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Exit status is 0 even if pattern is not found, due to piping.

Affected commands:
  DEFAULT/none PATTERN list records that match either package or files names
  -S PATTERN list records that match filenames

How to replicate:
$ /usr/bin/dlocate -F /usr/bin/dlocate; echo $?
dlocate: /usr/bin/dlocate
0
$ /usr/bin/dlocate -F /usr/bin/doesnotexist; echo $?
0

Expected result:
$ /usr/bin/dlocate -F /usr/bin/dlocate; echo $?
dlocate: /usr/bin/dlocate
0
$ /usr/bin/dlocate -F /usr/bin/doesnotexist; echo $?
1

I've attached a patch.

ProblemType: Bug
DistroRelease: Ubuntu 12.10
Package: dlocate 1.02
ProcVersionSignature: Ubuntu 3.5.0-16.25-generic 3.5.4
Uname: Linux 3.5.0-16-generic x86_64
ApportVersion: 2.6.1-0ubuntu1
Architecture: amd64
Date: Thu Oct 4 14:39:30 2012
PackageArchitecture: all
ProcEnviron:
 LANGUAGE=es_CL:en
 TERM=xterm
 PATH=(custom, no user)
 LANG=es_CL.UTF-8
 SHELL=/bin/bash
SourcePackage: dlocate
UpgradeStatus: Upgraded to quantal on 2012-09-27 (7 days ago)

Revision history for this message
Ignacio Larrain (ilarrain) wrote :
tags: added: lucid natty oneiric patch precise
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in dlocate (Ubuntu):
status: New → Confirmed
Changed in dlocate (Debian):
status: Unknown → New
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "Fix" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-reviewers team please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

Revision history for this message
John Paul Adrian Glaubitz (glaubitz) wrote :

FYI, I fixed the bug in Debian with my latest upload 1.02+nmu2.

Cheers,

Adrian

Changed in dlocate (Debian):
status: New → Fix Released
Revision history for this message
John Paul Adrian Glaubitz (glaubitz) wrote :

Someone should fix this Ubuntu bug, I fixed this issue with version 1.02+nmu2 in unstable.

Adrian

Changed in dlocate (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Patches

Remote bug watches

Bug watches keep track of this bug in other bug trackers.