[71756] trunk/base/src/port1.0/portfetch.tcl

jmr at macports.org jmr at macports.org
Wed Sep 22 06:58:15 PDT 2010


Revision: 71756
          http://trac.macports.org/changeset/71756
Author:   jmr at macports.org
Date:     2010-09-22 06:58:14 -0700 (Wed, 22 Sep 2010)
Log Message:
-----------
create and chown distpath for all fetch types, not just standard (fixes some custom fetch phases like ffmpeg-devel)

Modified Paths:
--------------
    trunk/base/src/port1.0/portfetch.tcl

Modified: trunk/base/src/port1.0/portfetch.tcl
===================================================================
--- trunk/base/src/port1.0/portfetch.tcl	2010-09-22 13:32:40 UTC (rev 71755)
+++ trunk/base/src/port1.0/portfetch.tcl	2010-09-22 13:58:14 UTC (rev 71756)
@@ -426,20 +426,6 @@
     variable fetch_urls
     variable urlmap
 
-    if {![file isdirectory $distpath]} {
-        if {[catch {file mkdir $distpath} result]} {
-            elevateToRoot "fetch"
-            set elevated yes
-            if {[catch {file mkdir $distpath} result]} {
-                return -code error [format [msgcat::mc "Unable to create distribution files path: %s"] $result]
-            }
-        }
-    }
-    chownAsRoot $distpath
-    if {[info exists elevated] && $elevated == yes} {
-        dropPrivileges
-    }
-
     set fetch_options {}
     if {[string length ${fetch.user}] || [string length ${fetch.password}]} {
         lappend fetch_options -u
@@ -532,9 +518,24 @@
 }
 
 proc portfetch::fetch_start {args} {
-    global UI_PREFIX name
+    global UI_PREFIX name distpath
 
     ui_notice "$UI_PREFIX [format [msgcat::mc "Fetching %s"] $name]"
+
+    # create and chown $distpath
+    if {![file isdirectory $distpath]} {
+        if {[catch {file mkdir $distpath} result]} {
+            elevateToRoot "fetch"
+            set elevated yes
+            if {[catch {file mkdir $distpath} result]} {
+                return -code error [format [msgcat::mc "Unable to create distribution files path: %s"] $result]
+            }
+        }
+    }
+    chownAsRoot $distpath
+    if {[info exists elevated] && $elevated == yes} {
+        dropPrivileges
+    }
 }
 
 # Main fetch routine
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20100922/4ed6e302/attachment.html>


More information about the macports-changes mailing list