"port upgrade" error message usability

Chris Jones jonesc at hep.phy.cam.ac.uk
Mon Jan 31 09:59:01 UTC 2022


Hi,

On 30/01/2022 8:24 am, Andrew Janke wrote:
> Hi, MacPorts developers,
> 
> Long-time Homebrew user and recent MacPorts convert here.
> 
> Minor usability issue with the `port` program, I think: I suspect that a 
> common operation for regular MacPorts users to do is "upgrade all my 
> stuff to the latest version".
> 
> I tried doing this with `port selfupdate`; `port upgrade`, and got this 
> error message:
> 
> [~] $ sudo port selfupdate
> --->  Updating MacPorts base sources using rsync
> MacPorts base version 2.7.1 installed,
> MacPorts base version 2.7.1 downloaded.
> --->  Updating the ports tree
> --->  MacPorts base is already the latest version
> 
> The ports tree has been updated. To upgrade your installed ports, you 
> should run
>    port upgrade outdated
> [~] $ sudo port upgrade

Others have given you long detailed messages, but a short one would be. 
the above tells you to run

 > (sudo) port upgrade outdated

(yes, it probably should include sudo....)

whereas you run

 > sudo port upgrade

so the simple fix is to just run exactly what the error message gave you.

Chris


> Can't map the URL 'file://.' to a port description file ("Could not find 
> Portfile in /Users/janke").
> Please verify that the directory and portfile syntax are correct.
> To use the current port, you must be in a port's directory.
> [~] $
> 
> I'm a dev with 25 years of coding and sysadmin experience, and I don't 
> know what to do with that error message. I dunno what a regular user is 
> supposed to do with that. (Yes, I saw the "To upgrade your installed 
> ports" output from the selfupdate command, but still.)
> 
> Maybe the error message here could be modified to include a "maybe you 
> meant `port upgrade outdated`" message or something like that? Where's 
> the 'file://'" coming from, anyway? Does `port upgrade` operate on some 
> port definition found in the current working directory by default? I did 
> not provide a URL as an input to the `port upgrade` command, so it's a 
> little unexpected that I got an error complaining about a URL here.
> 
> Cheers,
> Andrew


More information about the macports-dev mailing list