Ticket #10919: portunarchive.diff
File portunarchive.diff, 2.5 KB (added by elcascador@…, 18 years ago) |
---|
-
portunarchive.tcl
old new 51 51 default unarchive.post_args {} 52 52 53 53 default unarchive.srcpath {${portarchivepath}} 54 default unarchive.binhost {${portarchivebinhost}} 54 55 default unarchive.type {} 55 56 default unarchive.file {} 56 57 default unarchive.path {} … … 63 64 global portname portversion portrevision portvariants portpath 64 65 global unarchive.srcpath unarchive.type unarchive.file unarchive.path 65 66 67 global fetch.user fetch.password fetch.use_epsv unarchive.binhost 68 global portverbose 69 set fetch_options {} 70 if {[string length ${fetch.user}] || [string length ${fetch.password}]} { 71 lappend fetch_options -u 72 lappend fetch_options "${fetch.user}:${fetch.password}" 73 } 74 if {${fetch.use_epsv} != "yes"} { 75 lappend fetch_options "--disable-epsv" 76 } 77 if {$portverbose == "yes"} { 78 lappend fetch_options "-v" 79 } 80 66 81 # Check mode in case archive called directly by user 67 82 if {[option portarchivemode] != "yes"} { 68 83 return -code error "Archive mode is not enabled!" … … 84 99 if {![string equal ${unarchive.srcpath} ${workpath}] && ![string equal ${unarchive.srcpath} ""]} { 85 100 set unarchive.srcpath [file join ${unarchive.srcpath} [option os.platform] [option os.arch]] 86 101 } 102 # Define achive binhost url 103 if {![string equal ${unarchive.binhost} ""]} { 104 set unarchive.binhost "${unarchive.binhost}/[option os.platform]/[option os.arch]" 105 } 87 106 88 107 # Determine if unarchive should be skipped 89 108 set skipped 0 … … 109 128 set found 1 110 129 break 111 130 } else { 112 ui_debug "No [string toupper ${unarchive.type}] archive: ${unarchive.path}" 131 # file does not exist locally, we will try to download it from the binhost 132 set effectiveURL "" 133 set file_url "${unarchive.binhost}/${unarchive.file}" 134 ui_msg "$UI_PREFIX [format [msgcat::mc "Checking binhost for %s %s_%s%s"] $portname $portversion $portrevision $portvariants]" 135 if {![catch {eval curl fetch --effective-url effectiveURL $fetch_options {$file_url} ${unarchive.srcpath}/${unarchive.file}.TMP} result] && 136 ![catch {system "mv ${unarchive.srcpath}/${unarchive.file}.TMP ${unarchive.srcpath}/${unarchive.file}"}] } { 137 set found 1 138 break 139 } else { 140 ui_debug "No [string toupper ${unarchive.type}] archive: ${unarchive.path}" 141 exec rm -f ${unarchive.srcpath}/${unarchive.file}.TMP 142 } 113 143 } 114 144 } else { 115 145 ui_debug "Skipping [string toupper ${unarchive.type}] archive: $errmsg"