Ticket #25128 (closed defect: fixed)
Point out when checksum errors are due to broken DNS or web servers
|Reported by:||ryandesign@…||Owned by:||macports-tickets@…|
We've had quite a lot of tickets filed lately about checksum errors, and I have a feeling a fair number of them are because of the "helpful" DNS servers ISPs seem to be so fond of providing these days. When asking such DNS servers about a hostname that does not exist, they do not respond that the hostname does not exist; instead, they respond with the IP address of the ISP's search page, and if you are trying to connect to it over HTTP, they do a web search for you and send you the results. OpenDNS does this by default, so does Time Warner's Roadrunner service and probably others. MacPorts can't currently recognize this, so it saves that search results page as the distfile, which then of course doesn't match the expected checksums.
The attached patch fixes this by using the "file" command to check if the downloaded file is an HTML page, and if so, discarding it and trying another mirror. I have tested this on Snow Leopard only. Before committing, I would like to verify that the "file" command on Leopard and preferably Tiger works the same way (i.e. accepts the same flags).
There is already special-case code in this procedure for dealing with SourceForge mirrors. Possibly the new code I propose could replace the old SourceForge code; I was unable to locate a test case that triggered the SourceForge special-case code.
- Summary changed from Avoid checksum errors due to helpful DNS servers to Avoid checksum errors due to broken DNS servers
- Status changed from new to closed
- Milestone set to MacPorts 1.9.2
- Resolution set to fixed
- Summary changed from Avoid checksum errors due to broken DNS servers to Point out when checksum errors are due to broken DNS or web servers