Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#54743 closed defect (fixed)

Binary-only mode requested with no usable archive sites configured

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: raimue (Rainer Müller)
Priority: Normal Milestone: MacPorts 2.5.0
Component: base Version: 2.4.1
Keywords: Cc: kurthindenburg (Kurt Hindenburg)
Port:

Description

Attempting a binary-only install while in a port's source directory and not specifying the port name results in an incorrect error message:

$ cd $(port dir ncurses)
$ sudo port -b install
Error: Failed to archivefetch ncurses: Binary-only mode requested with no usable archive sites configured
Error: See /opt/local/var/macports/logs/_Users_rschmidt_macports_macports-ports-svn-trunk_devel_ncurses/ncurses/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets to report a bug.
Error: Processing of port ncurses failed
$

If specifying the port name, the install proceeds normally:

$ sudo port -b install ncurses
--->  Fetching archive for ncurses
--->  Attempting to fetch ncurses-6.0-20170520_0+universal.darwin_16.i386-x86_64.tbz2 from https://packages.macports.org/ncurses
--->  Attempting to fetch ncurses-6.0-20170520_0+universal.darwin_16.i386-x86_64.tbz2.rmd160 from https://packages.macports.org/ncurses
--->  Installing ncurses @6.0-20170520_0+universal
--->  Deactivating ncurses @6.0-20170708_0+universal
--->  Cleaning ncurses
--->  Activating ncurses @6.0-20170520_0+universal
--->  Cleaning ncurses
$

Change History (6)

comment:1 Changed 7 years ago by kurthindenburg (Kurt Hindenburg)

Cc: kurthindenburg added

I meant to add a comment when I looked at this a while ago. I believe the "install" stage doesn't have the code in earlier stages that handle setting port names when in a port directory. I got side-tracked and didn't follow up on it.

comment:2 Changed 7 years ago by jmroot (Joshua Root)

It's because we don't look for archive_sites.tcl in the fallback location, only in the Portfile's own ports tree (see r147456). When using the 'current' pseudoport, there is no knowledge about a ports tree as it has to work with just a single Portfile on its own.

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

So how do we fix it?

comment:4 Changed 7 years ago by jmroot (Joshua Root)

By changing the porturl used from file:///. to an absolute path I guess.

comment:5 Changed 7 years ago by raimue (Rainer Müller)

Owner: set to raimue
Resolution: fixed
Status: newclosed

In cc0663851d279ee1da692c6a65ad73500ea162ef/macports-base:

mportopen: Normalize file:// porturls

The evaluation of some targets may switch the current working directory,
which means a relative porturl will no longer point to the Portfile we
used. Normalize relative paths in a file:// porturl in order to be
able to calculate the correct path for the _resources directory in the
corresponding ports tree.

Update a macports_dlist test case which relied on a "file://." porturl.

Closes: #54743

comment:6 Changed 7 years ago by jmroot (Joshua Root)

Milestone: MacPorts 2.5.0
Note: See TracTickets for help on using tickets.