Fix for setting mode on items copied from DMG; more detail in log on setting owner/group/mode

git-svn-id: http://munki.googlecode.com/svn/trunk@604 a4e17f2e-e282-11dd-95e1-755cbddbdd66
This commit is contained in:
Greg Neagle
2010-07-26 23:40:07 +00:00
parent 83ed22f3af
commit 5bfe5efbe6

View File

@@ -362,7 +362,8 @@ def copyFromDMG(dmgpath, itemlist):
destitem = os.path.join(destpath, itemname)
if (retcode == 0) and ('user' in item):
munkicommon.display_detail(
"Setting owner for '%s'" % destitem)
"Setting owner for '%s' to '%s'" %
(destitem, item['user']))
cmd = ['/usr/sbin/chown', '-R', item['user'], destitem]
retcode = subprocess.call(cmd)
if retcode:
@@ -371,7 +372,8 @@ def copyFromDMG(dmgpath, itemlist):
if (retcode == 0) and ('group' in item):
munkicommon.display_detail(
"Setting group for '%s'" % destitem)
"Setting group for '%s' to '%s'" %
(destitem, item['group']))
cmd = ['/usr/bin/chgrp', '-R', item['group'], destitem]
retcode = subprocess.call(cmd)
if retcode:
@@ -379,8 +381,10 @@ def copyFromDMG(dmgpath, itemlist):
(destitem))
if (retcode == 0) and ('mode' in item):
munkicommon.display_detail("Setting mode for '%s'" % destitem)
cmd = ['/bin/chmod', '-R', options['mode'], destitem]
munkicommon.display_detail(
"Setting mode for '%s' to '%s'" %
(destitem, item['mode']))
cmd = ['/bin/chmod', '-R', item['mode'], destitem]
retcode = subprocess.call(cmd)
if retcode:
munkicommon.display_error("Error setting mode for %s" %