Bug 848518

Summary: wrong exit codes
Product: Red Hat Enterprise Linux 7 Reporter: Vladimir Benes <vbenes>
Component: PackageKitAssignee: Richard Hughes <rhughes>
Status: CLOSED CURRENTRELEASE QA Contact: Desktop QE <desktop-qa-list>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.0CC: mclasen, pvine, smatula, vhumpa
Target Milestone: beta   
Target Release: 7.0   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: PackageKit-0.8.6-1.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-13 11:49:06 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 Vladimir Benes 2012-08-15 19:43:09 UTC
Description of problem:
I've found a lot of wrong exit codes. I've decided to file them all into one place as it looks like some of those can be for discussion

exit code 0:

    pkcon --non_existing_option

    download errors (disabled network)

    failed to parse error  (pkcon --cache-age=sda or so) 

    missing argument for cache-age returns 0
 
    already installed package error when installing locally returns 0 (should be 5)
 
    pkcon local-install (on invalid package - no rpm)
    
    fatal erorr: user declined simulation (when declined dependencies)

    pkcon install unavailable has 1

    fatal error user declined interaction (installing unsigned package declined)

    fatat error: no transaction to process (pkcon update kernel when updated)

    fatal error: nothing to do (pkcon update on updated system)

    fatal error: cannot refresh cache when offline (pkcon refresh when offline)

    pkcon get-depends setup (no more depends .. shouldn't it be 5 instead of 0?)

    pkcon get-requires mc (no requires returned still 0?)

    Fatal error: Trying to remove "yum", which is protected (pkcon get-requires glibc)

    Fatal error: Error getting repository data for alpha23, repository not found (enable non existing repo)

        ditto with disable invalid repo)

    no requires found by pkcon get-requires mc (is 0 shouldn't be 5?)

    pkcon repo enable/disable of enabled/disabled repo shoudl return 5 not 0

Version-Release number of selected component (if applicable):
PackageKit-0.7.4-5.el7.x86_64

Comment 2 Vladimir Benes 2012-08-16 13:38:23 UTC
I've got one more :

when dependencies are not available there is 0 as well

Resolving dependencies        [=========================]         
Fatal error: gnome-boxes-3.5.5-1.el7.x86_64 requires libspice-client-glib-2.0.so.8(SPICEGTK_1)(64bit)
gnome-boxes-3.5.5-1.el7.x86_64 requires libvirt-gobject-1.0.so.0(LIBVIRT_GOBJECT_0.0.9)(64bit)
gnome-boxes-3.5.5-1.el7.x86_64 requires libspice-client-gtk-3.0.so.4(SPICEGTK_1)(64bit)
gnome-boxes-3.5.5-1.el7.x86_64 requires libvirt-gconfig-1.0.so.0(LIBVIRT_GCONFIG_0.1.0)(64bit)
gnome-boxes-3.5.5-1.el7.x86_64 requires libspice-client-glib-2.0.so.8()(64bit)
gnome-boxes-3.5.5-1.el7.x86_64 requires libspice-client-gtk-3.0.so.4()(64bit)
gnome-boxes-3.5.5-1.el7.x86_64 requires libvirt-gconfig-1.0.so.0(LIBVIRT_GCONFIG_0.0.9)(64bit)
[root@rhle7alpha2 repo]# echo $?
0

Comment 3 Vladimir Benes 2012-08-16 13:50:48 UTC
and one more:
when installing with no network after a download error there is 0 returned.

Comment 4 Vitezslav Humpa 2012-08-21 11:02:10 UTC
I've also found that:

Fatal error: GDBus.Error:org.gtk.GDBus.UnmappedGError.Quark._pk_5ftransaction_5ferror.Code11: The search string length is too large

exits with value of 0.

Comment 5 Richard Hughes 2012-11-29 11:32:08 UTC
I've fixed *loads* of these in the last release, can you please retest with PackageKit-0.8.6-1.el7 -- thanks!

Comment 6 Matthias Clasen 2013-01-17 21:07:21 UTC
moving to modified, then

Comment 7 smatula 2013-11-21 14:57:43 UTC
Fix Verified with Build RHEL-7.0-20131115.2 x86_64 PackageKit-0.8.9-8.el7.

All negative error scenarios that produce error status other 5 pass and now produce a non 0 error status.
Four scenarios still produce error status of 0 where status of 5 is expected.
Error Status 5 is 'Nothing useful was done.' These are the following:
pkcon repo-enable  a already enabled repo.
pkcon repo-disable a already disabled repo.
pkcon get-depends setup   (no depends - no results)
pkcon get-requires mc     (no requires - no results)

Opening new bug for this case and the four scenarios.

Comment 8 Ludek Smid 2014-06-13 11:49:06 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.