[MacPorts] #57718: Unexpected behavior when archive_site_local contains more than 1 URL

MacPorts noreply at macports.org
Tue Dec 4 09:32:18 UTC 2018


#57718: Unexpected behavior when archive_site_local contains more than 1 URL
------------------------+----------------------------
 Reporter:  ryandesign  |      Owner:  (none)
     Type:  defect      |     Status:  new
 Priority:  Normal      |  Milestone:  MacPorts 2.6.0
Component:  base        |    Version:  2.5.99
 Keywords:              |       Port:
------------------------+----------------------------
 After fixing `archive_site_local` (see #57717), I set it as follows in
 macports.conf:

 {{{
 archive_site_local http://SITE1/:tbz2 http://SITE2/:tbz2
 }}}

 Specifying the tag `:tbz2` on each URL appears to be mandatory; without
 that, the URLs are not used.

 This had the following unexpected behavior:

 {{{
 $ sudo port -bu upgr smpeg2
 --->  Computing dependencies for smpeg2
 --->  Fetching archive for smpeg2
 --->  Attempting to fetch smpeg2-2.0.0_2.darwin_18.x86_64.tbz2 from
 http://SITE1/:tbz2 http://SITE2/smpeg2
 --->  Attempting to fetch smpeg2-2.0.0_2.darwin_18.x86_64.tbz2 from
 http://SITE1/smpeg2
 --->  Attempting to fetch smpeg2-2.0.0_2.darwin_18.x86_64.tbz2.rmd160 from
 http://SITE1/smpeg2
 --->  Installing smpeg2 @2.0.0_2
 [snip]
 }}}

 Why did it first try to access the `archive_site_local` value as a
 complete URL?

 It looks like the problem is in `portfetch::checksites`—it adds
 `archive_site_local` ("`$env($senv)`") to the list of sites twice—first
 correctly, as individual items, when adding URLs for use with any tag:

 {{{
         # add the specified global and user-defined mirrors
 }}}
 {{{
             if {[info exists env($senv)]} {
                 set full_list [concat $env($senv) $full_list]
             }
 }}}

 and then incorrectly, as a single item, when adding URLs for use with a
 specific tag:

 {{{
         # add in the global and user-defined mirrors for each tag
 }}}
 {{{
                 if {[info exists env($senv)]} {
                     set site_list [concat [list $env($senv)] $site_list]
                 }
 }}}

 It looks like this problem goes all the way back to
 [462cb467be6d98fde9bd0539597c440cb7237a73/macports-base] when #15485 was
 implemented.

 I'll submit a PR to fix this.

-- 
Ticket URL: <https://trac.macports.org/ticket/57718>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list