Acting on a subport in a development Portfile

Joshua Root jmr at macports.org
Sat Jan 22 20:31:42 UTC 2022


On 2022-1-23 06:20 , Georges Martin wrote:
> When working on a Portfile in a macports-ports clone, it's possible to perform actions in its directory, without giving the port name (and not adding the repo  to sources.conf):
> 
> 	$ cd ~/repos/macports-ports/<category>/<portname>
> 	$ port info
> 	$ port lint
> 	$ sudo port build
> 
> But if the Portfile contains a subport, how can I invoke actions on the subport ?
> 
> Do I really need to add that repository to sources.conf ? And rerun portindex every time I switch branches ? :-q

No. You can set Portfile variables on the command line for development 
purposes, and this includes 'subport'. For example:

sudo port build subport=thesubportname

- Josh


More information about the macports-dev mailing list