unexpected error from port variant when port is not found
Hi I was just looking at the available variants for a port, I mistyped the name of the port and received the following error message: $ port variants misspelled_port No port misspelled_port found. can't read "portinfo(porturl)": no such element in array while executing "set porturl $portinfo(porturl)" ("uplevel" body line 15) invoked from within "uplevel 1 $block" (procedure "foreachport" line 16) invoked from within "foreachport $portlist { # search for port if {[catch {mportsearch $portname no exact} result]} { global errorInfo ..." (procedure "action_variants" 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 2651) $ I would expect the initial error of "No port misspelled_port found", but not the rest. This is with base from the top of the release_1_6 branch. Is this the expected behaviour? Cheers Adam
On Nov 20, 2007, at 13:38, Adam Mercer wrote:
I was just looking at the available variants for a port, I mistyped the name of the port and received the following error message:
$ port variants misspelled_port No port misspelled_port found. can't read "portinfo(porturl)": no such element in array while executing "set porturl $portinfo(porturl)" ("uplevel" body line 15) invoked from within "uplevel 1 $block" (procedure "foreachport" line 16) invoked from within "foreachport $portlist { # search for port if {[catch {mportsearch $portname no exact} result]} { global errorInfo ..." (procedure "action_variants" 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 2651) $
I would expect the initial error of "No port misspelled_port found", but not the rest. This is with base from the top of the release_1_6 branch. Is this the expected behaviour?
Yeah, that's pretty messy! Sure would be nice not to have all that cruft. "port info misspelled_port" doesn't have this problem.
On Nov 20, 2007, at 6:04 PM, Ryan Schmidt wrote:
On Nov 20, 2007, at 13:38, Adam Mercer wrote:
---snip---
I would expect the initial error of "No port misspelled_port found", but not the rest. This is with base from the top of the release_1_6 branch. Is this the expected behaviour?
Yeah, that's pretty messy! Sure would be nice not to have all that cruft.
"port info misspelled_port" doesn't have this problem.
It's not expected behavior, and I just fixed it in r31358. Output is now limited to the expected "Port not found" and an exit status of 1, just as for the "info" action. Regards,... -jmpp
participants (3)
-
Adam Mercer
-
Juan Manuel Palacios
-
Ryan Schmidt