Bug 428757 - document yum exit codes
document yum exit codes
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: yum (Show other bugs)
5.1
All Linux
medium Severity low
: rc
: ---
Assigned To: James Antill
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-01-14 18:21 EST by Jan Hutař
Modified: 2009-03-25 02:15 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-03-25 02:15:54 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Jan Hutař 2008-01-14 18:21:50 EST
Description of problem:
Please document yum exit values. The only note in a `man yum` is about check-
updates 100/0. 

I'm asking because I just noted, then when I tried to upgrade while one of the 
packages have broken deps I got $? == 1. Usually yum returns 0, or 1 if it 
tracebacks.


Version-Release number of selected component (if applicable):
yum-3.0.1-5.el5.noarch


Additional info:
  Make yum more "hackable" with exit codes and/or standardize
  the output to make it easier for shell scripts and one liners
  to interact with
  
  No. Just no. If you don't like it, go have a conversation
  with yourself about it. Alone. At home. In your closet. 
  
  Why not?
  ...
  --http://wiki.linux.duke.edu/YumTodont#head-
dbc33b4a2fa91306796798e6f9119d235172e1aa
Comment 1 Jan Hutař 2008-01-16 10:19:25 EST
Just run into another issue - while yum did what I wanted, it ended with 1:

# yum -y install --disablerepo=repo011 --disablerepo=repo022 --downloadonly 
test --downloaddir=.
...
Downloading Packages:
(1/1): test-0.1-1.i386.rp 100% |=========================| 2.2 kB    00:00
# echo $?
1
Comment 2 Jan Hutař 2008-01-16 10:22:55 EST
Bad copy&paste:

# yum -y install --disablerepo=repo011 --disablerepo=repo022 --downloadonly 
test --downloaddir=.
...
Downloading Packages:
(1/1): test-0.1-1.i386.rp 100% |=========================| 2.2 kB    00:00


exiting because --downloadonly specified
# echo $?
1

And there is this code in /usr/lib/yum-plugins/downloadonly.py:

def postdownload_hook(conduit):
    opts, commands = conduit.getCmdLine()
    if opts.dlonly:
        raise PluginYumExit('exiting because --downloadonly specified ')
Comment 3 James Antill 2008-01-16 10:52:12 EST
 Right, that's how yum-downloadonly works ... it pretends something bad
happened. In theory it could probably call sys.exit(), but this way guarantees
any cleanup needed is done.

Note You need to log in before you can comment on or make changes to this bug.