porturls (was: Re: "port upgrade" error message usability)

Joshua Root jmr at macports.org
Sun Jan 30 15:15:11 UTC 2022

On 2022-1-30 21:12 , Ryan Schmidt wrote:
> I'm actually not sure what kind of file MacPorts is expecting to find at such a URL. I tried just a Portfile and a gzip-compressed tarball containing a Portfile and files directory; neither worked. Maybe this feature just doesn't even work anymore. I'm not sure why MacPorts ever had this capability. MacPorts was probably designed in the early days to work on any kind of URL, and to transform local port names into file URLs internally, with the assumption that this flexibility might prove useful at some point, but I think it ended up not being needed.

There were plans at one point for remote ports tree support so users 
wouldn't have to download the whole thing. Seems to still work fine for me:

% tar -cvzf ~/Downloads/testport1.tgz testport1
a testport1
a testport1/Portfile
% sudo port install file://${HOME}/Downloads/testport1.tgz
--->  Fetching distfiles for testport1
--->  Verifying checksums for testport1
--->  Extracting testport1
--->  Configuring testport1
--->  Building testport1
--->  Staging testport1 into destroot
--->  Installing testport1 @1.1_0
--->  Activating testport1 @1.1_0
--->  Cleaning testport1

It also works on binary archives:

% sudo port install 
--->  Fetching port 
--->  Fetching archive for anacron
--->  Attempting to fetch anacron-2.3_4.darwin_20.x86_64.tbz2 from 
--->  Attempting to fetch anacron-2.3_4.darwin_20.x86_64.tbz2 from 
--->  Attempting to fetch anacron-2.3_4.darwin_20.x86_64.tbz2.rmd160 
from https://packages.macports.org/anacron/
--->  Installing anacron @2.3_4
--->  Activating anacron @2.3_4
--->  Cleaning anacron

This can be legitimately useful for installing one port from a 
third-party repo without having to edit your config, or for installing 
an older version of a port.

- Josh

More information about the macports-dev mailing list