[91702] trunk/base/src/port1.0

jmr at macports.org jmr at macports.org
Sun Apr 8 04:26:10 PDT 2012


Revision: 91702
          https://trac.macports.org/changeset/91702
Author:   jmr at macports.org
Date:     2012-04-08 04:26:08 -0700 (Sun, 08 Apr 2012)
Log Message:
-----------
revert

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:09:49 UTC (rev 91701)
+++ trunk/base/src/port1.0/portchecksum.tcl	2012-04-08 11:26:08 UTC (rev 91702)
@@ -275,6 +275,12 @@
                         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
+                }
             }
 
         }
@@ -289,6 +295,18 @@
         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:09:49 UTC (rev 91701)
+++ trunk/base/src/port1.0/portfetch.tcl	2012-04-08 11:26:08 UTC (rev 91702)
@@ -472,20 +472,8 @@
                 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]} {
-                    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
-                    }
+                    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/cb2f93c7/attachment.html>


More information about the macports-changes mailing list