Revision
67194
Author
jmr@macports.org
Date
2010-05-01 06:26:59 -0700 (Sat, 01 May 2010)

Log Message

fix creation of worksymlink in alt prefix

Modified Paths

Diff

Modified: trunk/base/src/port1.0/portutil.tcl (67193 => 67194)


--- trunk/base/src/port1.0/portutil.tcl	2010-05-01 09:48:48 UTC (rev 67193)
+++ trunk/base/src/port1.0/portutil.tcl	2010-05-01 13:26:59 UTC (rev 67194)
@@ -1514,24 +1514,14 @@
     global workpath worksymlink place_worksymlink name portpath ports_ignore_older ports_dryrun
     global usealtworkpath altprefix env applications_dir portbuildpath
 
-    if {![file isdirectory $workpath] && ![tbool ports_dryrun]} {
-        file mkdir $workpath
-        chownAsRoot $portbuildpath
-        # Create a symlink to the workpath for port authors
-        if {[tbool place_worksymlink] && ![file isdirectory $worksymlink]} {
-            ui_debug "Attempting ln -sf $workpath $worksymlink"
-            ln -sf $workpath $worksymlink
-        }
-    }
-
     # de-escalate privileges if MacPorts was started with sudo
     dropPrivileges
-    
+
     if {$usealtworkpath} {
          ui_warn_once "privileges" "MacPorts running without privileges.\
                 You may be unable to complete certain actions (e.g. install)."
 
-        set newsourcepath "$altprefix/$portpath"
+        set newsourcepath "${altprefix}${portpath}"
     
         # copy Portfile (and patch files) if not there already
         # note to maintainers/devs: the original portfile in /opt/local is ALWAYS the one that will be
@@ -1550,6 +1540,16 @@
         }
     }
 
+    if {![file isdirectory $workpath] && ![tbool ports_dryrun]} {
+        file mkdir $workpath
+        chownAsRoot $portbuildpath
+        # Create a symlink to the workpath for port authors
+        if {[tbool place_worksymlink] && ![file isdirectory $worksymlink]} {
+            ui_debug "Attempting ln -sf $workpath $worksymlink"
+            ln -sf $workpath $worksymlink
+        }
+    }
+
     # flock Portfile
     set statefile [file join $workpath .macports.${name}.state]
     if {[file exists $statefile]} {