Bug 1107737

Summary: Exit code 0 with 'dnf install existing not-existing'
Product: [Fedora] Fedora Reporter: Adam Samalik <asamalik>
Component: dnfAssignee: Michal Luscon <mluscon>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: high    
Version: 20CC: jsilhan, jzeleny, kdudka, msuchy, nikolai.kondrashov, pnemade, praiskup, rholy, tim.lauridsen
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1107742 (view as bug list) Environment:
Last Closed: 2015-02-13 10:51:16 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:    
Bug Blocks: 1045076, 1072957    

Description Adam Samalik 2014-06-10 13:48:05 UTC
Description of problem:
When I run for example 'dnf install bash fdfrhewiaur' (first package exists, the second doesn't), I got an exit code 0. 

Version-Release number of selected component (if applicable):
dnf-0:0.5.2-1.fc20.noarch

How reproducible:

Steps to Reproduce:
1. dnf install bash fdfrhewiaur

Actual results:
exit code == 0

Expected results:
exit code != 0

Additional info:
I got the same behaviour with yum as well.

Comment 1 Ales Kozumplik 2014-06-10 13:54:34 UTC
Thanks, we'll take a look.

Comment 2 Honza Silhan 2014-11-19 12:29:45 UTC
*** Bug 1128139 has been marked as a duplicate of this bug. ***

Comment 3 Radek Holy 2015-02-04 11:29:20 UTC
*** Bug 1113080 has been marked as a duplicate of this bug. ***

Comment 4 Radek Holy 2015-02-04 11:38:56 UTC
Just to make it clear, the expected behaviour in this case (and that's how we are going to fix this) is that DNF should fail (aka install nothing) with a non-zero exit status.
When we fix this, there will be no command that allows you to install just the installable packages and skip the arguments that match packages that cannot be installed. There should be a really good use case for such a command that is not known to us yet.

Comment 5 Kamil Dudka 2015-02-04 12:02:20 UTC
(In reply to Radek Holy from comment #4)
> Just to make it clear, the expected behaviour in this case (and that's how
> we are going to fix this) is that DNF should fail (aka install nothing) with
> a non-zero exit status.

Yes, the non-zero exit status is very important here.

> When we fix this, there will be no command that allows you to install just
> the installable packages and skip the arguments that match packages that
> cannot be installed. There should be a really good use case for such a
> command that is not known to us yet.

When installing (build) dependencies of a package interactively, I would like dnf to install all the packages that it knows to install and then let me (the user) install the missing ones manually.  AFAIK, this functionality is already missing in yum-builddep.

Please have a look at the --continue-on-failure option of Paludis:

http://paludis.exherbo.org/clients/cave-resolve.html

Comment 6 Radek Holy 2015-02-04 12:16:56 UTC
Kamil, feel free to open an RFE if you run into a real situation that cannot be (and should be) solved by DNF.

Comment 7 Michal Luscon 2015-02-13 10:51:16 UTC
Fixed by upstream commit 5bc2e739e47923d728359cb5e2447fa8e0183199 ( https://github.com/rpm-software-management/dnf/commit/5bc2e739e47923d728359cb5e2447fa8e0183199 ).