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

jmr at macports.org jmr at macports.org
Sun May 11 15:01:58 PDT 2008


Revision: 36687
          http://trac.macosforge.org/projects/macports/changeset/36687
Author:   jmr at macports.org
Date:     2008-05-11 15:01:57 -0700 (Sun, 11 May 2008)

Log Message:
-----------
back out the fetch part of r36679, as it breaks other phases

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

Modified: trunk/base/src/port1.0/portfetch.tcl
===================================================================
--- trunk/base/src/port1.0/portfetch.tcl	2008-05-11 21:27:55 UTC (rev 36686)
+++ trunk/base/src/port1.0/portfetch.tcl	2008-05-11 22:01:57 UTC (rev 36687)
@@ -510,13 +510,13 @@
 # Perform a standard fetch, assembling fetch urls from
 # the listed url varable and associated distfile
 proc fetchfiles {args} {
-	global fulldistpath all_dist_files UI_PREFIX fetch_urls
+	global distpath all_dist_files UI_PREFIX fetch_urls
 	global fetch.user fetch.password fetch.use_epsv fetch.ignore_sslcert
 	global distfile site
 	global portverbose
 
-	if {![file isdirectory $fulldistpath]} {
-		if {[catch {file mkdir $fulldistpath} result]} {
+	if {![file isdirectory $distpath]} {
+		if {[catch {file mkdir $distpath} result]} {
 			return -code error [format [msgcat::mc "Unable to create distribution files path: %s"] $result]
 		}
 	}
@@ -538,10 +538,10 @@
 	set sorted no
 	
 	foreach {url_var distfile} $fetch_urls {
-		if {![file isfile [file join $fulldistpath $distfile]]} {
-			ui_info "$UI_PREFIX [format [msgcat::mc "%s doesn't seem to exist in %s"] $distfile $fulldistpath]"
-			if {![file writable $fulldistpath]} {
-				return -code error [format [msgcat::mc "%s must be writable"] $fulldistpath]
+		if {![file isfile $distpath/$distfile]} {
+			ui_info "$UI_PREFIX [format [msgcat::mc "%s doesn't seem to exist in %s"] $distfile $distpath]"
+			if {![file writable $distpath]} {
+				return -code error [format [msgcat::mc "%s must be writable"] $distpath]
 			}
 			if {!$sorted} {
 			    sortsites
@@ -558,8 +558,8 @@
 				ui_msg "$UI_PREFIX [format [msgcat::mc "Attempting to fetch %s from %s"] $distfile $site]"
 				set file_url [portfetch::assemble_url $site $distfile]
 				set effectiveURL ""
-				if {![catch {eval curl fetch --effective-url effectiveURL $fetch_options {$file_url} ${fulldistpath}/${distfile}.TMP} result] &&
-					![catch {system "mv ${fulldistpath}/${distfile}.TMP ${fulldistpath}/${distfile}"}]} {
+				if {![catch {eval curl fetch --effective-url effectiveURL $fetch_options {$file_url} ${distpath}/${distfile}.TMP} result] &&
+					![catch {system "mv ${distpath}/${distfile}.TMP ${distpath}/${distfile}"}]} {
 
 					# Special hack to check for sourceforge mirrors, which don't return a proper error code on failure
 					if {![string equal $effectiveURL $file_url] &&
@@ -569,7 +569,7 @@
 						# *SourceForge hackage in effect*
 						# The url seen by curl seems to have been a redirect to the sourceforge mirror page
 						ui_debug "[msgcat::mc "Fetching from sourceforge mirror failed"]"
-						exec rm -f [file join $fulldistpath ${distfile}.TMP]
+						exec rm -f ${distpath}/${distfile}.TMP
 						
 						# Continue on to try the next mirror, if any
 					} else {
@@ -582,7 +582,7 @@
 
 				} else {
 					ui_debug "[msgcat::mc "Fetching failed:"]: $result"
-					exec rm -f [file join $fulldistpath ${distfile}.TMP]
+					exec rm -f ${distpath}/${distfile}.TMP
 				}
 			}
 			if {![info exists fetched]} {
@@ -595,34 +595,30 @@
 
 # Utility function to delete fetched files.
 proc fetch_deletefiles {args} {
-	global fulldistpath fetch_urls
+	global distpath fetch_urls
 	foreach {url_var distfile} $fetch_urls {
-		if {[file isfile [file join $fulldistpath $distfile]]} {
-			exec rm -f [file join $fulldistpath $distfile]
+		if {[file isfile $distpath/$distfile]} {
+			exec rm -f ${distpath}/${distfile}
 		}
 	}
 }
 
 # Utility function to add files to a list of fetched files.
 proc fetch_addfilestomap {filemapname} {
-	global fulldistpath fetch_urls $filemapname
+	global distpath fetch_urls $filemapname
 	foreach {url_var distfile} $fetch_urls {
-		if {[file isfile [file join $fulldistpath $distfile]]} {
-			filemap set $filemapname [file join $fulldistpath $distfile] 1
+		if {[file isfile $distpath/$distfile]} {
+			filemap set $filemapname $distpath/$distfile 1
 		}
 	}
 }
 
 # Initialize fetch target
 proc fetch_init {args} {
-    global distfiles distname distpath fulldistpath all_dist_files dist_subdir fetch.type
+    global distfiles distname distpath all_dist_files dist_subdir fetch.type
     
-    if {[info exist distpath]} {
-        if {[info exists dist_subdir]} {
-            set fulldistpath [file join $distpath $dist_subdir]
-        } else {
-            set fulldistpath $distpath
-        }
+    if {[info exist distpath] && [info exists dist_subdir]} {
+	set distpath ${distpath}/${dist_subdir}
     }
 }
 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20080511/9125bcbc/attachment.html


More information about the macports-changes mailing list