[MacPorts] #59381: Do something better when no ports are specified (was: port clean: do something better when no ports are specified)
MacPorts
noreply at macports.org
Fri Jul 3 03:56:50 UTC 2020
#59381: Do something better when no ports are specified
--------------------------+--------------------
Reporter: 6aKa | Owner: (none)
Type: enhancement | Status: new
Priority: Normal | Milestone:
Component: base | Version:
Resolution: | Keywords:
Port: |
--------------------------+--------------------
Comment (by ryandesign):
Replying to [ticket:59381 6aKa]:
>
> {{{
> zeus local # port -d clean
> DEBUG: Copying /Users/baka/Library/Preferences/com.apple.dt.Xcode.plist
to /opt/local/var/macports/home/Library/Preferences
> DEBUG: Using normalized porturl file:///opt/local
> DEBUG: Changing to port directory: /opt/local
> DEBUG: Could not find Portfile in /opt/local
> while executing
> "mportopen $url"
> Can't map the URL 'file://.' to a port description file ("Could not find
Portfile in /opt/local").
> Please verify that the directory and portfile syntax are correct.
> To use the current port, you must be in a port's directory.
> }}}
It's behaving as designed. When you don't specify a port name, it uses the
portfile in the current directory. You were in a directory that didn't
have a portfile in it, hence the error. I agree we could improve the error
message to make it clearer to new users who are not familiar with this
feature and may not have intended to invoke this feature.
Replying to [comment:1 6aKa]:
> may be when `port clean` execute without portname, need clean all in
/opt/local/var/macports/{build,logs} or print good help
MacPorts developers use this feature—invoking MacPorts commands without
specifying the port name—all the time while developing their ports, so
changing it would break their existing workflows.
Replying to [comment:2 6aKa]:
> or add `failed` set for `port echo failed` and `port clean failed`
All of the existing pseudoports can be computed from the portindex or
registry. "failed" cannot so we would need to invent new capabilities for
the pseudoport feature to be able to scan the disk and find the failed
build directories. Even so, finding a build directory does not necessarily
indicate that a build failed. The user could have stopped the build
intentionally, or could have invoked a MacPorts command that leaves behind
a build directory, such as `sudo port extract`. So maybe "dirty" is a
better name for such a pseudoport than "failed".
--
Ticket URL: <https://trac.macports.org/ticket/59381#comment:5>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list