installing subport from a portdir

Rainer Müller raimue at macports.org
Wed Jun 12 18:31:29 UTC 2019


On 11.06.19 17:53, Ryan Schmidt wrote:
> 
> 
> On Jun 11, 2019, at 10:35, René J.V. Bertin wrote:
> 
>> On Tuesday June 11 2019 10:10:21 Ryan Schmidt wrote:
>>
>>>> or change "base" so it will recognise when a port name corresponds to a subport provided by the Portfile in the working directory.
>>>
>>> That doesn't seem like a change that would be a good idea.
>>
>> Honestly, why not? I've always found it counter-intuitive that you cannot specify a port name in this usage type
> 
> Because "sudo port action X" means to perform the action on the port (or subport) named X as identified in the portindex. You are proposing that the behavior should vary depending on whether or not the current directory contains a portfile for port (or subport) X. That doesn't seem like a good idea because it makes the port command's behavior less predictable.

If you do not specify an explicit port name, it will use the "current"
pseudo-port. I think this is a simple logic and in line with other tools
such as make(1). We should not add more complexity.

To know which port is provided by the Portfile in the current directory,
we would first have to parse it. If a Portfile exists, any port action
would always be delayed by this parsing in the current directory only to
check the name. In case of a (syntax) error in this Portfile, it would
even prevent running any port command at all. This is definitely not a
good idea.

>> (nor use `upgrade` btw, but that might be unrelated).
> 
> It is confusing that "sudo port upgrade" in a port directory does not use the portfile in that port directory, but instead upgrades the port of that name that's in the portindex. I know I've discussed this before with Rainer and/or Joshua but I don't remember where so I can't provide a link to the discussion.

Indeed, 'port upgrade' is the only command that behaves differently.
However, we were not able to decide what should be the proper behavior.

https://trac.macports.org/ticket/15186

Rainer


More information about the macports-users mailing list