Ticket #14061 (closed defect: fixed)
"port contents" in a non-port directory causes 38 lines of error spew
| Reported by: | ryandesign@… | Owned by: | jmpp@… |
|---|---|---|---|
| Priority: | Normal | Milestone: | MacPorts 1.7.0 |
| Component: | base | Version: | 1.7.0 |
| Keywords: | Cc: | ||
| Port: |
Description
I think this error output can be shortened considerably:
$ cd
$ port contents
Can't map the URL 'file://.' to a port description file ("Could not find Portfile in /Users/rschmidt").
Please verify that the directory and portfile syntax are correct.
To use the current port, you must be in a port's directory.
(you might also see this message if a pseudo-port such as
outdated or installed expands to no ports).
Registry error: @0_0 not registered as installed.
while executing
"open_entry $name"
(procedure "receipt_flat::port_registered" line 16)
invoked from within
"${macports::registry.format}::port_registered $name"
(procedure "registry::port_registered" line 3)
invoked from within
"registry::port_registered $portname"
invoked from within
"set files [registry::port_registered $portname]"
("uplevel" body line 2)
invoked from within
"uplevel 1 $block"
(procedure "foreachport" line 16)
invoked from within
"foreachport $portlist {
set files [registry::port_registered $portname]
if { $files != 0 } {
if { [llength $files] > 0 } {..."
(procedure "action_contents" line 4)
invoked from within
"$action_proc $action $portlist [array get global_options]"
(procedure "process_cmd" line 60)
invoked from within
"process_cmd $remaining_args"
invoked from within
"if { [llength $remaining_args] > 0 } {
# If there are remaining arguments, process those as a command
# Exit immediately, by default, unless..."
(file "/opt/local/bin/port" line 2706)
$
Perhaps to fix this we need something like in #13284.
Attachments
Change History
comment:1 Changed 5 years ago by ryandesign@…
- Owner changed from macports-tickets@… to jmpp@…
Is the attached patch an appropriate fix for this issue? I just copied some code from the action_variants procedure but it seems to work.
comment:2 Changed 5 years ago by ryandesign@…
The patch I attached seems to have a bad side-effect. It causes "port contents" in an uncommitted port's dir to say "Error: Port foo not found". So a different solution is needed.
comment:3 Changed 4 years ago by toby@…
- Milestone changed from MacPorts base bugs to MacPorts Future
Milestone MacPorts base bugs deleted
Note: See
TracTickets for help on using
tickets.

