Projects
New Ticket     Wiki     Browse Source     Timeline     Roadmap     Bug Reports     Search

Changeset 36687

Show
Ignore:
Timestamp:
2008-05-11 15:01:57 (6 months ago)
Author:
jmr@…
Message:

back out the fetch part of r36679, as it breaks other phases

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/base/src/port1.0/portfetch.tcl

    r36679 r36687  
    511511# the listed url varable and associated distfile 
    512512proc fetchfiles {args} { 
    513         global fulldistpath all_dist_files UI_PREFIX fetch_urls 
     513        global distpath all_dist_files UI_PREFIX fetch_urls 
    514514        global fetch.user fetch.password fetch.use_epsv fetch.ignore_sslcert 
    515515        global distfile site 
    516516        global portverbose 
    517517 
    518         if {![file isdirectory $fulldistpath]} { 
    519                 if {[catch {file mkdir $fulldistpath} result]} { 
     518        if {![file isdirectory $distpath]} { 
     519                if {[catch {file mkdir $distpath} result]} { 
    520520                        return -code error [format [msgcat::mc "Unable to create distribution files path: %s"] $result] 
    521521                } 
     
    539539         
    540540        foreach {url_var distfile} $fetch_urls { 
    541                 if {![file isfile [file join $fulldistpath $distfile]]} { 
    542                         ui_info "$UI_PREFIX [format [msgcat::mc "%s doesn't seem to exist in %s"] $distfile $fulldistpath]" 
    543                         if {![file writable $fulldistpath]} { 
    544                                 return -code error [format [msgcat::mc "%s must be writable"] $fulldistpath] 
     541                if {![file isfile $distpath/$distfile]} { 
     542                        ui_info "$UI_PREFIX [format [msgcat::mc "%s doesn't seem to exist in %s"] $distfile $distpath]" 
     543                        if {![file writable $distpath]} { 
     544                                return -code error [format [msgcat::mc "%s must be writable"] $distpath] 
    545545                        } 
    546546                        if {!$sorted} { 
     
    559559                                set file_url [portfetch::assemble_url $site $distfile] 
    560560                                set effectiveURL "" 
    561                                 if {![catch {eval curl fetch --effective-url effectiveURL $fetch_options {$file_url} ${fulldistpath}/${distfile}.TMP} result] && 
    562                                         ![catch {system "mv ${fulldistpath}/${distfile}.TMP ${fulldistpath}/${distfile}"}]} { 
     561                                if {![catch {eval curl fetch --effective-url effectiveURL $fetch_options {$file_url} ${distpath}/${distfile}.TMP} result] && 
     562                                        ![catch {system "mv ${distpath}/${distfile}.TMP ${distpath}/${distfile}"}]} { 
    563563 
    564564                                        # Special hack to check for sourceforge mirrors, which don't return a proper error code on failure 
     
    570570                                                # The url seen by curl seems to have been a redirect to the sourceforge mirror page 
    571571                                                ui_debug "[msgcat::mc "Fetching from sourceforge mirror failed"]" 
    572                                                 exec rm -f [file join $fulldistpath ${distfile}.TMP] 
     572                                                exec rm -f ${distpath}/${distfile}.TMP 
    573573                                                 
    574574                                                # Continue on to try the next mirror, if any 
     
    583583                                } else { 
    584584                                        ui_debug "[msgcat::mc "Fetching failed:"]: $result" 
    585                                         exec rm -f [file join $fulldistpath ${distfile}.TMP] 
     585                                        exec rm -f ${distpath}/${distfile}.TMP 
    586586                                } 
    587587                        } 
     
    596596# Utility function to delete fetched files. 
    597597proc fetch_deletefiles {args} { 
    598         global fulldistpath fetch_urls 
     598        global distpath fetch_urls 
    599599        foreach {url_var distfile} $fetch_urls { 
    600                 if {[file isfile [file join $fulldistpath $distfile]]} { 
    601                         exec rm -f [file join $fulldistpath $distfile] 
     600                if {[file isfile $distpath/$distfile]} { 
     601                        exec rm -f ${distpath}/${distfile} 
    602602                } 
    603603        } 
     
    606606# Utility function to add files to a list of fetched files. 
    607607proc fetch_addfilestomap {filemapname} { 
    608         global fulldistpath fetch_urls $filemapname 
     608        global distpath fetch_urls $filemapname 
    609609        foreach {url_var distfile} $fetch_urls { 
    610                 if {[file isfile [file join $fulldistpath $distfile]]} { 
    611                         filemap set $filemapname [file join $fulldistpath $distfile] 1 
     610                if {[file isfile $distpath/$distfile]} { 
     611                        filemap set $filemapname $distpath/$distfile 1 
    612612                } 
    613613        } 
     
    616616# Initialize fetch target 
    617617proc fetch_init {args} { 
    618     global distfiles distname distpath fulldistpath all_dist_files dist_subdir fetch.type 
    619      
    620     if {[info exist distpath]} { 
    621         if {[info exists dist_subdir]} { 
    622             set fulldistpath [file join $distpath $dist_subdir] 
    623         } else { 
    624             set fulldistpath $distpath 
    625         } 
     618    global distfiles distname distpath all_dist_files dist_subdir fetch.type 
     619     
     620    if {[info exist distpath] && [info exists dist_subdir]} { 
     621        set distpath ${distpath}/${dist_subdir} 
    626622    } 
    627623}