[78180] trunk/base/src/registry2.0/portimage.tcl

jmr at macports.org jmr at macports.org
Wed Apr 27 09:10:45 PDT 2011


Revision: 78180
          http://trac.macports.org/changeset/78180
Author:   jmr at macports.org
Date:     2011-04-27 09:10:44 -0700 (Wed, 27 Apr 2011)
Log Message:
-----------
don't try to change owner or group when activating as non-root

Modified Paths:
--------------
    trunk/base/src/registry2.0/portimage.tcl

Modified: trunk/base/src/registry2.0/portimage.tcl
===================================================================
--- trunk/base/src/registry2.0/portimage.tcl	2011-04-27 15:54:11 UTC (rev 78179)
+++ trunk/base/src/registry2.0/portimage.tcl	2011-04-27 16:10:44 UTC (rev 78180)
@@ -377,7 +377,12 @@
             if { ![file isdirectory $dstfile] } {
                 file mkdir $dstfile
                 # fix attributes on the directory.
-                eval file attributes {$dstfile} [file attributes $srcfile]
+                if {[getuid] == 0} {
+                    eval file attributes {$dstfile} [file attributes $srcfile]
+                } else {
+                    # not root, so can't set owner/group
+                    eval file attributes {$dstfile} -permissions [file attributes -permissions $srcfile]
+                }
                 # set mtime on installed element
                 file mtime $dstfile [file mtime $srcfile]
             }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20110427/87529a2a/attachment.html>


More information about the macports-changes mailing list