Changeset 17197 for trunk/base
- Timestamp:
- Mar 27, 2006, 9:32:27 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/base/src/port1.0/portfetch.tcl
r14583 r17197 1 1 # et:ts=4 2 2 # portfetch.tcl 3 # $Id: portfetch.tcl,v 1.10 7 2005/10/12 22:10:28 pguyotExp $3 # $Id: portfetch.tcl,v 1.108 2006/03/27 21:32:27 jberry Exp $ 4 4 # 5 5 # Copyright (c) 2002 - 2003 Apple Computer, Inc. … … 400 400 global portfetch::$url_var 401 401 } 402 unset -nocomplain fetched 402 403 foreach site [set $url_var] { 403 404 ui_msg "$UI_PREFIX [format [msgcat::mc "Attempting to fetch %s from %s"] $distfile $site]" 404 405 set file_url [portfetch::assemble_url $site $distfile] 405 if {![catch {eval curl fetch $fetch_options {$file_url} ${distpath}/${distfile}.TMP} result] && 406 set effectiveURL "" 407 if {![catch {eval curl fetch --effective-url effectiveURL $fetch_options {$file_url} ${distpath}/${distfile}.TMP} result] && 406 408 ![catch {system "mv ${distpath}/${distfile}.TMP ${distpath}/${distfile}"}]} { 407 set fetched 1 408 break 409 410 # Special hack to check for sourceforge mirrors, which don't return a proper error code on failure 411 if {![string equal $effectiveURL $file_url] && 412 [string match "*sourceforge*" $file_url] && 413 [string match "*failedmirror*" $effectiveURL]} { 414 415 # *SourceForge hackage in effect* 416 # The url seen by curl seems to have been a redirect to the sourceforge mirror page 417 ui_debug "[msgcat::mc "Fetching from sourceforge mirror failed"]" 418 exec rm -f ${distpath}/${distfile}.TMP 419 420 # Continue on to try the next mirror, if any 421 } else { 422 423 # Successful fetch 424 set fetched 1 425 break 426 427 } 428 409 429 } else { 410 430 ui_debug "[msgcat::mc "Fetching failed:"]: $result" … … 414 434 if {![info exists fetched]} { 415 435 return -code error [msgcat::mc "fetch failed"] 416 } else {417 unset fetched418 436 } 419 437 }
Note: See TracChangeset
for help on using the changeset viewer.