Opened 5 years ago

Closed 5 years ago

#57718 closed defect (fixed)

Unexpected behavior when archive_site_local contains more than 1 URL

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone: MacPorts 2.6.0
Component: base Version: 2.5.99
Keywords: haspatch Cc:
Port:

Description

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.

Change History (4)

comment:1 Changed 5 years ago by ryandesign (Ryan Carsten Schmidt)

Keywords: haspatch added

comment:2 Changed 5 years ago by ryandesign (Ryan Carsten Schmidt)

In 531720bba7af24204b507f26bdefbc60e58556c0/macports-ports (master):

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: #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: #57718

See: #54800
See: https://github.com/macports/macports-ports/pull/3099

comment:3 Changed 5 years ago by ryandesign (Ryan Carsten Schmidt)

I've manually applied this fix to the buildbot workers too.

comment:4 Changed 5 years ago by ryandesign (Ryan Carsten Schmidt)

Owner: set to ryandesign
Resolution: fixed
Status: newclosed

In 50f29345cb9208d49a45282aba6a0de37950aa29/macports-base (master):

Fix multiple URLs in *_site_local with tags

Correctly add multiple URLs specified in archive_site_local,
master_site_local, and patch_site_local when a tag is used.

Closes: #57718

Note: See TracTickets for help on using tickets.