mirror of
https://github.com/munki/munki.git
synced 2026-04-22 04:28:21 -05:00
Fixed installer's percentage-done output for post-Leopard.
git-svn-id: http://munki.googlecode.com/svn/trunk@184 a4e17f2e-e282-11dd-95e1-755cbddbdd66
This commit is contained in:
@@ -68,7 +68,10 @@ def install(pkgpath, choicesXMLpath=''):
|
||||
if restartaction == "RequireRestart":
|
||||
munkicommon.display_status("%s requires a restart after installation." % packagename)
|
||||
restartneeded = True
|
||||
|
||||
|
||||
# get the OS version; we need it later when processing installer's output,
|
||||
# which varies depnding on OS version.
|
||||
osvers = int(os.uname()[2].split('.')[0])
|
||||
cmd = ['/usr/sbin/installer', '-verboseR', '-pkg', pkgpath, '-target', '/']
|
||||
if choicesXMLpath:
|
||||
cmd.extend(['-applyChoiceChangesXML', choicesXMLpath])
|
||||
@@ -103,7 +106,9 @@ def install(pkgpath, choicesXMLpath=''):
|
||||
elif msg.startswith("%"):
|
||||
if munkicommon.munkistatusoutput:
|
||||
percent = float(msg[1:])
|
||||
percent = int(percent * 100)
|
||||
if osvers < 10:
|
||||
# Leopard uses a float from 0 to 1
|
||||
percent = int(percent * 100)
|
||||
munkistatus.percent(percent)
|
||||
elif msg.startswith(" Error"):
|
||||
if munkicommon.munkistatusoutput:
|
||||
|
||||
Reference in New Issue
Block a user