[91701] trunk/base/src/port1.0
ryandesign at macports.org
ryandesign at macports.org
Sun Apr 8 04:09:49 PDT 2012
Revision: 91701
https://trac.macports.org/changeset/91701
Author: ryandesign at macports.org
Date: 2012-04-08 04:09:49 -0700 (Sun, 08 Apr 2012)
Log Message:
-----------
Silently ignore MisbehavingServers rather than inconvenience the user; see #33930
Modified Paths:
--------------
trunk/base/src/port1.0/portchecksum.tcl
trunk/base/src/port1.0/portfetch.tcl
Modified: trunk/base/src/port1.0/portchecksum.tcl
===================================================================
--- trunk/base/src/port1.0/portchecksum.tcl 2012-04-08 11:08:21 UTC (rev 91700)
+++ trunk/base/src/port1.0/portchecksum.tcl 2012-04-08 11:09:49 UTC (rev 91701)
@@ -275,12 +275,6 @@
set fail yes
}
}
- if {[tbool fail] && ![regexp {\.html?$} ${distfile}] &&
- ![catch {strsed [exec [findBinary file $portutil::autoconf::file_path] $fullpath --brief --mime] {s/;.*$//}} mimetype]
- && "text/html" == $mimetype} {
- # file --mime-type would be preferable to file --mime and strsed, but is only available as of Snow Leopard
- set wrong_mimetype yes
- }
}
}
@@ -295,18 +289,6 @@
ui_info "The correct checksum line may be:"
ui_info [format "%-20s%s" "checksums" [join $sums [format " \\\n%-20s" ""]]]
- if {[tbool wrong_mimetype]} {
- # We got an HTML file, though the distfile name does not suggest that one was
- # expected. Probably a helpful DNS server sent us to its search results page
- # instead of admitting that the server we asked for doesn't exist, or a mirror that
- # no longer has the file served its error page with a 200 response.
- ui_notice "***"
- ui_notice "The non-matching file appears to be HTML. See this page for possible reasons"
- ui_notice "for the checksum mismatch:"
- ui_notice "<https://trac.macports.org/wiki/MisbehavingServers>"
- ui_notice "***"
- }
-
return -code error "[msgcat::mc "Unable to verify file checksums"]"
}
Modified: trunk/base/src/port1.0/portfetch.tcl
===================================================================
--- trunk/base/src/port1.0/portfetch.tcl 2012-04-08 11:08:21 UTC (rev 91700)
+++ trunk/base/src/port1.0/portfetch.tcl 2012-04-08 11:09:49 UTC (rev 91701)
@@ -472,8 +472,20 @@
set file_url [portfetch::assemble_url $site $distfile]
if {![catch {eval curl fetch $fetch_options {$file_url} {"${distpath}/${distfile}.TMP"}} result] &&
![catch {file rename -force "${distpath}/${distfile}.TMP" "${distpath}/${distfile}"} result]} {
- set fetched 1
- break
+ if {![regexp {\.html?$} ${distfile}] &&
+ ![catch {strsed [exec [findBinary file $portutil::autoconf::file_path] ${distpath}/${distfile} --brief --mime] {s/;.*$//}} mimetype]
+ && "text/html" == ${mimetype}} {
+ # file --mime-type would be preferable to file --mime and strsed, but is only available as of Snow Leopard
+ # We got an HTML file, though the distfile name does not suggest that one was
+ # expected. Probably a helpful DNS server sent us to its search results page
+ # instead of admitting that the server we asked for doesn't exist, or a mirror that
+ # no longer has the file served its error page with a 200 response.
+ ui_debug "[msgcat::mc "Fetching distfile failed:"]: [msgcat::mc "an HTML file was unexpectedly received instead"]"
+ file delete -force "${distpath}/${distfile}"
+ } else {
+ set fetched 1
+ break
+ }
} else {
ui_debug "[msgcat::mc "Fetching distfile failed:"]: $result"
file delete -force "${distpath}/${distfile}.TMP"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120408/1452a1dc/attachment.html>
More information about the macports-changes
mailing list