Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 914630

Summary: Search for non existing package exit code
Product: Portage Development Reporter: Tomáš Doležal <tomak1>
Component: Core - Interface (emerge)Assignee: Portage team <dev-portage>
Status: CONFIRMED ---    
Severity: normal CC: ajak, gentoo, sam
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Tomáš Doležal 2023-09-25 07:08:22 UTC
Hello,

I recently started comparing package managers according to their usage and I encountered some strange behavior.

Searchings non existing package:
emerge -S non-existing-package

It gives me an exit code 0, but others like apt, dnf, pacman, ... returns non 0 value (error), which I think is also appropriate.

Is this behavior a bug or is it intentional, if so why?
Such behavior would be easy to combine in a scripts instead of checking the output text on STDOUT.

Thanks for any reply.
Comment 1 Zac Medico gentoo-dev 2023-09-26 04:43:00 UTC
It supports multiple search strings, so in the case of multiple, should it return 0 if any string matches something, or only return 0 if all strings match something?
Comment 2 Tomáš Doležal 2023-09-26 05:14:55 UTC
(In reply to Zac Medico from comment #1)
> It supports multiple search strings, so in the case of multiple, should it
> return 0 if any string matches something, or only return 0 if all strings
> match something?

I think it should return 0 if something matched.