softwareupdate always returns exit code 0

Originator:jnojr1
Number:rdar://16177712 Date Originated:2/26/2014
Status:Open Resolved:
Product:OSX Product Version:All
Classification:UI/Usability Reproducible:Always
 
Summary:
/usr/sbin/softwareupdate always returns an exit code of 0 regardless of the actual status.

Steps to Reproduce:
macbook:~ joliver$ sudo softwareupdate -l
Software Update Tool
Copyright 2002-2010 Apple

2014-02-26 13:24:50.792 softwareupdate[41170:3903] No alternate URLs found for packageId MobileDevice
Software Update found the following new or updated software:
   * SecUpd2014-001-1.0
	Security Update 2014-001 (1.0), 112751K [recommended] [restart]
   * Mac App Store Update-1.0
	Mac App Store Update (1.0), 3697K [recommended] [restart]
   * Safari6.1.2MountainLion-6.1.2
	Safari (6.1.2), 51679K [recommended]
   * iTunesXPatch-11.1.5
	iTunes (11.1.5), 79522K [recommended]
macbook:~ joliver$ echo $?
0
macbook:~ joliver$ sudo softwareupdate -i Safari6.1.2MountainLion-6.1.3
Software Update Tool
Copyright 2002-2010 Apple

2014-02-26 13:26:55.930 softwareupdate[41187:3903] No alternate URLs found for packageId MobileDevice
Safari6.1.2MountainLion-6.1.3: No such update
macbook:~ joliver$ echo $?
0
macbook:~ joliver$ sudo softwareupdate -i Safari6.1.2MountainLion-6.1.2
Software Update Tool
Copyright 2002-2010 Apple

2014-02-26 13:31:20.170 softwareupdate[41255:3803] No alternate URLs found for packageId MobileDevice

Downloading Safari	
   3.1 MB of 52.9 MB
   7.7 MB of 52.9 MB — About 5 seconds
   13 MB of 52.9 MB — About 5 seconds
   19.7 MB of 52.9 MB — About 5 seconds
   27.2 MB of 52.9 MB — About 5 seconds
   33.7 MB of 52.9 MB — About 5 seconds
   41.3 MB of 52.9 MB — About 5 seconds
   48.2 MB of 52.9 MB — About 5 seconds
Verifying Safari	
Waiting to install Safari	
   Checking packages…
Installing 	
   About 2 minutes
   About a minute
   Less than a minute
   About 10 seconds
   About 5 seconds
Installed Safari
Done.
macbook:~ joliver$ sudo softwareupdate -i Safari6.1.2MountainLion-6.1.2
Software Update Tool
Copyright 2002-2010 Apple

2014-02-26 13:38:06.578 softwareupdate[41335:3903] No alternate URLs found for packageId MobileDevice
Safari6.1.2MountainLion-6.1.2: No such update
macbook:~ joliver$ echo $?
0
macbook:~ joliver$ 

Expected Results:
I would at a minimum expect a non-zero error code if an update was not successfully installed.  Different error codes for "no such package" or "package already installed" would be nice.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!