[85109] trunk/dports/_resources/port1.0/group/zope-1.0.tcl

jmr at macports.org jmr at macports.org
Sun Oct 9 14:25:42 PDT 2011


Revision: 85109
          http://trac.macports.org/changeset/85109
Author:   jmr at macports.org
Date:     2011-10-09 14:25:39 -0700 (Sun, 09 Oct 2011)
Log Message:
-----------
zope portgroup: remove use of cd, remove reliance on env(USER)

Modified Paths:
--------------
    trunk/dports/_resources/port1.0/group/zope-1.0.tcl

Modified: trunk/dports/_resources/port1.0/group/zope-1.0.tcl
===================================================================
--- trunk/dports/_resources/port1.0/group/zope-1.0.tcl	2011-10-09 21:17:03 UTC (rev 85108)
+++ trunk/dports/_resources/port1.0/group/zope-1.0.tcl	2011-10-09 21:25:39 UTC (rev 85109)
@@ -133,21 +133,20 @@
 
 	destroot {
 		# Warn user if not running as root
-		if {$env(USER) != "root"} {
+		if {[geteuid] != 0} {
 			ui_msg "-----------------------------------------------------------"
 			ui_msg "Note that you are not running as root, so files installed"
 			ui_msg "by this port will not end up with proper ownership and"
 			ui_msg "likely not work correctly with Zope."
 			ui_msg "-----------------------------------------------------------"
 		}
-		cd ${worksrcpath}
 
 		# Install product(s)
 		if {[llength ${zope.products}] > 0} {
 			xinstall -d -m 0755 ${destroot}${zope.prodhome}
 			foreach item ${zope.products} {
 				set cmd "cp -R ${item} ${destroot}${zope.prodhome}/${item}"
-				ui_info ${cmd}; system ${cmd}
+				ui_info ${cmd}; system -W ${worksrcpath} ${cmd}
 			}
 		}
 
@@ -156,12 +155,12 @@
 			xinstall -d -m 0755 ${destroot}${zope.exthome}
 			foreach item ${zope.extensions} {
 				set cmd "cp -R ${item} ${destroot}${zope.exthome}/${item}"
-				ui_info ${cmd}; system ${cmd}
+				ui_info ${cmd}; system -W ${worksrcpath} ${cmd}
 			}
 		}
 
 		# Fix owner and group on installed data
-		if {$env(USER) == "root"} {
+		if {[geteuid] == 0} {
 			if {[llength ${zope.products}] > 0} {
 				set cmd "chown -R ${zope.user} ${destroot}${zope.home}"
 				ui_info ${cmd}; system ${cmd}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20111009/02a87344/attachment.html>


More information about the macports-changes mailing list