Ticket #25128: helpful-dns.diff

File helpful-dns.diff, 1.1 KB (added by ryandesign (Ryan Carsten Schmidt), 14 years ago)

proposed patch

  • src/port1.0/portfetch.tcl

     
    492492                        file delete -force "${distpath}/${distfile}.TMP"
    493493
    494494                        # Continue on to try the next mirror, if any
     495                    } elseif {".html" != [file extension ${distfile}] &&
     496                        "text/html" == [exec [findBinary file $portutil::autoconf::file_path] ${distpath}/${distfile} --brief --mime-type]} {
     497
     498                        # Probably a helpful DNS server sent us to its search results page
     499                        # instead of admitting that the server we asked for doesn't exist.
     500                        ui_debug [msgcat::mc "Fetching failed because we received an HTML page"]
     501                        file delete -force "${distpath}/${distfile}"
     502
     503                        # Continue on to try the next mirror, if any
    495504                    } else {
    496505
    497506                        # Successful fetch