Ticket #36179: port.diff
File port.diff, 2.6 KB (added by devshashwatpandey@…, 11 years ago) |
---|
-
port.tcl
old new 2503 2503 2504 2504 proc action_select { action portlist opts } { 2505 2505 ui_debug "action_select \[$portlist] \[$opts]..." 2506 2507 # Error out if no group is specified. 2508 if {[llength $portlist] < 1} { 2509 ui_error "port select \[--list|--set|--show] <group> \[<version>]" 2510 return 1 2511 } 2512 set group [lindex $portlist 0] 2506 2507 set group [lindex $portlist 0] 2513 2508 2514 2509 array set opts_array $opts 2515 2510 set commands [array names opts_array ports_select_*] 2516 2511 array unset opts_array 2512 2513 # Error out if no group is specified or command is not --summary. 2514 if {[llength $portlist] < 1 && [string map {ports_select_ ""} [lindex $commands 0]] != "summary"} { 2515 ui_error "port select \[--list|--set|--show|--summary] \<group> \[<version>]" 2516 return 1 2517 } 2518 2517 2519 # If no command (--set, --show, --list) is specified *but* more than one 2518 2520 # argument is specified, default to the set command. 2519 2521 if {[llength $commands] < 1 && [llength $portlist] > 1} { … … 2601 2603 "'$selected_version'."] 2602 2604 return 0 2603 2605 } 2606 summary { 2607 if {[llength $portlist] > 0} { 2608 ui_warn [concat "The 'summary' command does not expect any " \ 2609 "arguments. Extra arguments will be ignored."] 2610 } 2611 2612 if {[catch {mportselect $command} portgroups]} { 2613 ui_error "The 'summary' command failed: $portgroups" 2614 return 1 2615 } 2616 puts "Portgroups\tOptions" 2617 foreach pg $portgroups { 2618 ui_notice $pg 2619 if {[catch {mportselect list $pg} versions]} { 2620 ui_error "The list of versions could not be obtained: $versions" 2621 return 1 2622 } 2623 foreach v $versions { 2624 ui_notice -nonewline "\t" 2625 if {[{mportselect show $pg} selected_version] == $v} { 2626 ui_msg "$v (active)" 2627 } else { 2628 ui_msg "$v" 2629 } 2630 } 2631 return 0 2632 } 2633 } 2604 2634 default { 2605 2635 ui_error "An unknown command '$command' was specified." 2606 2636 return 1 … … 4294 4325 clean {all archive dist work logs} 4295 4326 mirror {new} 4296 4327 lint {nitpick} 4297 select {list set show }4328 select {list set show summary} 4298 4329 log {{phase 1} {level 1}} 4299 4330 upgrade {force enforce-variants no-replace no-rev-upgrade} 4300 4331 rev-upgrade {id-loadcmd-check}