Opened 4 years ago
Closed 4 years ago
#61426 closed defect (invalid)
port -D flag does not seem to do what it says it does
Reported by: | rnkn (Paul W. Rankin) | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | base | Version: | 2.6.3 |
Keywords: | Cc: | ||
Port: |
Description
Calling any subcommand from port -D does not seem to have the effect that its documentation suggests...
Documentation
-D portdir|portname
Specify a directory to which the port command should change to before processing any actions. If the specified value does not contain any slashes, the value is used to look up a port and the current working directory is set to the corresponding port directory.
Steps to reproduce
- clone the macports-ports repo
- edit a Portfile
- call port -D ./ [info|install|sync|etc.] from edited Portfile directory
- call port -D <port> [info|install|sync|etc.] from edited Portfile directory for <port>
Expected results
MacPorts should use edited Portfile.
Actual results
MacPorts ignores edited Portfile.
Change History (3)
comment:1 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)
comment:2 Changed 4 years ago by rnkn (Paul W. Rankin)
Okay I fundamentally misunderstood how to install a custom Portfile. I did not realise you could just call port <command>
from the directory of the Portfile and I was specifying extra arguments.
comment:3 Changed 4 years ago by jmroot (Joshua Root)
Resolution: | → invalid |
---|---|
Status: | new → closed |
OK. Let us know if there's a way the documentation could be made more clear.
I must admit I was not aware of the
-D
flag, but it seems to work for me, if I'm understanding how it's meant to be used. For example, this works:I also tried editing a portfile in a non-default port tree and then running
port -D ./ info
while in that directory and it reflected my edits.Can you show a specific command that is not working for you?
Usually when you are editing a portfile and you want to use that portfile, you just use the port command without specifying a port name, e.g. just run
port info
orsudo port install
while in that directory.The sync command doesn't accept a port name.