Fixes to force unmount call; __CFPREFERENCES_AVOID_DAEMON environment variable set to '1' upon makepkginfo invocation

This commit is contained in:
Heig Gregorian
2012-08-22 14:40:18 -07:00
parent 93fa3f837c
commit b3705ea7b5
2 changed files with 7 additions and 7 deletions
+3 -4
View File
@@ -42,6 +42,9 @@ from munkilib import munkicommon
from munkilib import FoundationPlist
from munkilib import adobeutils
# circumvent cfprefsd plist scanning
os.environ['__CFPREFERENCES_AVOID_DAEMON'] = "1"
def getCatalogInfoFromDmg(dmgpath, options):
"""
@@ -631,10 +634,6 @@ def main():
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:
+4 -3
View File
@@ -845,7 +845,7 @@ def unmountdmg(mountpoint):
Unmounts the dmg at mountpoint
"""
cmd = ['/usr/bin/hdiutil', 'detach', mountpoint]
proc = subprocess.Popen(cmd, bufsize=1, stdout=subprocess.PIPE,
proc = subprocess.Popen(cmd, bufsize=-1, stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
(unused_output, err) = proc.communicate()
if proc.returncode:
@@ -853,10 +853,11 @@ def unmountdmg(mountpoint):
display_warning('Polite unmount failed: %s' % err)
display_warning('Attempting to force unmount %s' % mountpoint)
cmd.append('-force')
proc = subprocess.Popen(cmd, bufsize=1, stdout=subprocess.PIPE,
proc = subprocess.Popen(cmd, bufsize=-1, stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
(unused_output, err) = proc.communicate()
if proc.returncode:
display_warning('Failed to unmount %s' % mountpoint)
display_warning('Failed to unmount %s' % mountpoint, err)
def gethash(filename, hash_function):