Bug 428757 - document yum exit codes
Summary: document yum exit codes
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: yum
Version: 5.1
Hardware: All
OS: Linux
medium
low
Target Milestone: rc
: ---
Assignee: James Antill
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-01-14 23:21 UTC by Jan Hutař
Modified: 2009-03-25 06:15 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-03-25 06:15:54 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Jan Hutař 2008-01-14 23:21:50 UTC
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 15:19:25 UTC
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 15:22:55 UTC
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 15:52:12 UTC
 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.