Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 914630 - Search for non existing package exit code
Summary: Search for non existing package exit code
Status: CONFIRMED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Interface (emerge) (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-09-25 07:08 UTC by Tomáš Doležal
Modified: 2023-11-26 21:34 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.