Ticket #32018: patch-port1.0-fetch_common.tcl.diff

File patch-port1.0-fetch_common.tcl.diff, 1.0 KB (added by someuser12, 12 years ago)

Patch to /opt/local/share/macports/Tcl/port1.0/fetch_common.tcl

  • fetch_common.tcl

    old new  
    105105        # have been assigned in mirror_sites.tcl
    106106        set splitlist [split $element :]
    107107        # every element is a URL, so we'll always have multiple elements. no need to check
    108         set element "[lindex $splitlist 0]:[lindex $splitlist 1]"
    109         set mirror_tag "[lindex $splitlist 2]"
     108        # element can be:
     109        # http://svn.macports.org/repository/macports/distfiles/
     110        # http://distfiles.macports.org/:mirror
     111        # http://localhost:6227/:nosubdir
     112        # http://packages.macports.org/:nosubdir
     113        set mirror_tag_index [expr [llength $splitlist] - 1]
     114        if {$mirror_tag_index < 2} {
     115                set mirror_tag_index 2
     116        } else {
     117        set element [join [lreplace $splitlist $mirror_tag_index end] ":"]
     118        }
     119        set mirror_tag "[lindex $splitlist $mirror_tag_index]"
    110120
    111121        set name_re {\$(?:name\y|\{name\})}
    112122        # if the URL has $name embedded, kill any mirror_tag that may have been added