mirror of
https://github.com/munki/munki.git
synced 2026-04-22 04:28:21 -05:00
Fix for cfprefsd interference; ensure that stdout stream only contains pkginfo xml and not messages intended for the user.
This commit is contained in:
@@ -625,12 +625,16 @@ def main():
|
||||
print >> sys.stderr, 'Ignoring additional installer items:'
|
||||
print >> sys.stderr, '\t', '\n\t'.join(arguments[1:])
|
||||
|
||||
os_version = munkicommon.getOsVersion(
|
||||
only_major_minor=False, as_tuple=True)
|
||||
if options.installer_choices_xml:
|
||||
os_version = munkicommon.getOsVersion(
|
||||
only_major_minor=False, as_tuple=True)
|
||||
if os_version < (10, 6, 6):
|
||||
options.installer_choices_xml = False
|
||||
|
||||
# circumvent cfprefsd plist scanning
|
||||
if os_version >= (10, 8):
|
||||
os.environ['__CFPREFERENCES_AVOID_DAEMON'] = "1"
|
||||
|
||||
catinfo = {}
|
||||
installs = []
|
||||
if arguments:
|
||||
|
||||
@@ -844,17 +844,18 @@ def unmountdmg(mountpoint):
|
||||
"""
|
||||
Unmounts the dmg at mountpoint
|
||||
"""
|
||||
proc = subprocess.Popen(['/usr/bin/hdiutil', 'detach', mountpoint],
|
||||
bufsize=1, stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE)
|
||||
cmd = ['/usr/bin/hdiutil', 'detach', mountpoint]
|
||||
proc = subprocess.Popen(cmd, bufsize=1, stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE)
|
||||
(unused_output, err) = proc.communicate()
|
||||
if proc.returncode:
|
||||
cmd.append('-force')
|
||||
display_warning('Polite unmount failed: %s' % err)
|
||||
display_info('Attempting to force unmount %s' % mountpoint)
|
||||
display_warning('Attempting to force unmount %s' % mountpoint)
|
||||
# try forcing the unmount
|
||||
retcode = subprocess.call(['/usr/bin/hdiutil', 'detach', mountpoint,
|
||||
'-force'])
|
||||
if retcode:
|
||||
proc = subprocess.Popen(cmd, bufsize=1, stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE)
|
||||
if proc.returncode:
|
||||
display_warning('Failed to unmount %s' % mountpoint)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user