| 495 | } elseif {![regexp {\.html?$} ${distfile}] && |
| 496 | "text/html" == [strsed [exec [findBinary file $portutil::autoconf::file_path] ${distpath}/${distfile} --brief --mime] {s/;.*$//}]} { |
| 497 | # file --mime-type would be preferable to file --mime and strsed, but is only available as of Snow Leopard |
| 498 | |
| 499 | # We got an HTML file, though the distfile name does not suggest that one was |
| 500 | # expected. Probably a helpful DNS server sent us to its search results page |
| 501 | # instead of admitting that the server we asked for doesn't exist. |
| 502 | ui_debug [msgcat::mc "Fetching failed because we received an HTML page instead of the distfile"] |
| 503 | file delete -force "${distpath}/${distfile}" |
| 504 | |
| 505 | # Continue on to try the next mirror, if any |