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

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

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

MacPorts
#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
Reply | Threaded
Open this post in threaded view
|

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

MacPorts
#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
Resolution:              |   Keywords:  haspatch
      Port:              |
-------------------------+----------------------------
Changes (by ryandesign):

 * keywords:   => haspatch


Comment:

 https://github.com/macports/macports-base/pull/111

--
Ticket URL: <https://trac.macports.org/ticket/57718#comment:1>
MacPorts <https://www.macports.org/>
Ports system for macOS
Reply | Threaded
Open this post in threaded view
|

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

MacPorts
In reply to this post by MacPorts
#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
Resolution:              |   Keywords:  haspatch
      Port:              |
-------------------------+----------------------------

Comment (by ryandesign):

 In [changeset:"531720bba7af24204b507f26bdefbc60e58556c0/macports-ports"
 531720bba7af24204b507f26bdefbc60e58556c0/macports-ports] (master):
 {{{
 #!ConfigurableCommitTicketReference repository="macports-ports"
 revision="531720bba7af24204b507f26bdefbc60e58556c0"
 Travis: Prefer public archives over private ones

 I had tried to do this with preferred_hosts before, but it appears to
 have no effect on archive_site_local.

 See: https://trac.macports.org/ticket/57720

 Instead list both the public and the private URLs in archive_site_local.
 They appear to be tried in the order listed.

 But then we need to fix the base bug with multiple URLs in
 archive_site_local:

 See: https://trac.macports.org/ticket/57718

 See: https://trac.macports.org/ticket/54800
 See: https://github.com/macports/macports-ports/pull/3099
 }}}

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