Bug 1844925

Summary: when i execute "dnf download" failed i want to get return value 1 not 0 in shell.
Product: [Fedora] Fedora Reporter: zhangrui182
Component: dnf-plugins-coreAssignee: rpm-software-management
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 32CC: amatej, dmach, jmracek, mblaha, packaging-team-maint, pkratoch, praiskup, rpm-software-management, vmukhame
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: dnf-plugins-core-4.0.18-1.fc32.noarch Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-12-02 07:04:46 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:

Description zhangrui182 2020-06-08 03:37:08 UTC
Description of problem:
when i execute "dnf download --resolv --destdir=/home/tmp libunwind-devel"
i got an error but "echo $?" still return 0

Version-Release number of selected component (if applicable):
dnf-plugins-core-4.0.14-1.fc32.noarch

How reproducible:

Steps to Reproduce:
1.dnf download --resolv --destdir=/home/tmp libunwind-devel
2.echo $?
3.

Actual results:
[root@localhost ~]# dnf download --resolve --destdir=/home/tmp libunwind-devel
Last metadata expiration check: 0:05:57 ago on Mon 08 Jun 2020 11:07:42 AM CST.
Error in resolve of packages:
    libunwind-devel-2:1.3.1-10.eulerosv2r9.aarch64

 Problem: conflicting requests
  - nothing provides libunwind = 1.3.1-10.eulerosv2r9 needed by libunwind-devel-2:1.3.1-10.eulerosv2r9.aarch64
[root@localhost libunwind]# echo $?
0
[root@localhost libunwind]#

Expected results:
echo $?
1

Additional info:
https://github.com/zhangrui182/dnf-plugins-core/pull/1

Comment 1 amatej 2020-06-08 12:19:40 UTC
Can you open the pull request against our repository as well https://github.com/rpm-software-management/dnf-plugins-core/pulls?

Comment 2 zhangrui182 2020-06-30 08:15:25 UTC
I tried to fix this with pull-request: https://github.com/rpm-software-management/dnf-plugins-core/pull/400

Comment 3 Pavla Kratochvilova 2020-12-02 07:04:46 UTC
This is already fixed in dnf-plugins-core 4.0.18.

PR: https://github.com/rpm-software-management/dnf-plugins-core/pull/406
Tests: https://github.com/rpm-software-management/ci-dnf-stack/pull/856