Skip to content

Commit

Permalink
ui_ask_*: Eliminate special port output formatting
Browse files Browse the repository at this point in the history
Instead of formatting the port entry in ui_choice in the port client,
pass correctly formatted strings to the ui_ask_* procs and use them
unaltered.
  • Loading branch information
raimue committed Feb 7, 2017
1 parent 483926d commit 01d98db
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
3 changes: 1 addition & 2 deletions src/port/port.tcl
Expand Up @@ -5366,8 +5366,7 @@ namespace eval portclient::questions {
# Print portname or port list suitably
set i 1
foreach port $ports {
puts -nonewline [format " %*d) " $maxlen $i]
puts [string map {@ " @" ( " ("} $port]
puts [format " %*d) %s" $maxlen $i $port]
incr i
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/registry2.0/portimage.tcl
Expand Up @@ -237,9 +237,9 @@ proc _check_registry {name version revision variants} {
# Asking choice to select option in case of ambiguous activate
if {[info exists macports::ui_options(questions_singlechoice)]} {
if { [$i state] eq "installed" } {
lappend portilist $iname@${iversion}_${irevision}${ivariants}(active)
lappend portilist "$iname @${iversion}_${irevision}${ivariants} (active)"
} else {
lappend portilist $iname@${iversion}_${irevision}${ivariants}
lappend portilist "$iname @${iversion}_${irevision}${ivariants}"
}
} else {
if { [$i state] eq "installed" } {
Expand Down
6 changes: 3 additions & 3 deletions src/registry2.0/portuninstall.tcl
Expand Up @@ -157,9 +157,9 @@ proc uninstall {portname {version ""} {revision ""} {variants 0} {optionslist ""
# Asking choice to select option in case of ambiguous uninstall
if {[info exists macports::ui_options(questions_multichoice)]} {
if { [$i state] eq "installed" } {
lappend portilist [$i name]@[$i version]_[$i revision][$i variants](active)
} else {
lappend portilist [$i name]@[$i version]_[$i revision][$i variants]
lappend portilist "[$i name] @[$i version]_[$i revision][$i variants] (active)"
} else {
lappend portilist "[$i name] @[$i version]_[$i revision][$i variants]"
}
} else {
if {[$i state] eq "installed"} {
Expand Down

0 comments on commit 01d98db

Please sign in to comment.