Public bug reported:

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)

** Affects: dlocate (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apport-bug quantal

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1061786

Title:
  Incorrect exit code 0 on failed search

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/dlocate/+bug/1061786/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to