You've already forked macports-base
mirror of
https://github.com/macports/macports-base.git
synced 2026-07-12 18:18:43 -07:00
port info: Slight refactoring of field formatting
Remove one level of indentation, no functional changes.
This commit is contained in:
committed by
Rainer Müller
parent
b75ba554fe
commit
8d73019a46
+37
-36
@@ -2202,47 +2202,48 @@ proc action_info { action portlist opts } {
|
||||
}
|
||||
set inf $infresult
|
||||
}
|
||||
# ... special formatting for certain fields when prettyprinting
|
||||
if {$pretty_print} {
|
||||
if {$ropt eq "variants"} {
|
||||
# Use the new format for variants iff it exists in
|
||||
# PortInfo. This key currently does not exist outside of
|
||||
# trunk (1.8.0).
|
||||
array unset vinfo
|
||||
if {[info exists portinfo(vinfo)]} {
|
||||
array set vinfo $portinfo(vinfo)
|
||||
}
|
||||
|
||||
set pi_vars $inf
|
||||
set inf {}
|
||||
foreach v [lsort $pi_vars] {
|
||||
set varmodifier ""
|
||||
if {[info exists variations($v)]} {
|
||||
# selected by command line, prefixed with +/-
|
||||
set varmodifier $variations($v)
|
||||
} elseif {[info exists global_variations($v)]} {
|
||||
# selected by variants.conf, prefixed with (+)/(-)
|
||||
set varmodifier "($global_variations($v))"
|
||||
# Retrieve additional information from the new key.
|
||||
} elseif {[info exists vinfo]} {
|
||||
array unset variant
|
||||
array set variant $vinfo($v)
|
||||
if {[info exists variant(is_default)]} {
|
||||
set varmodifier "\[$variant(is_default)]"
|
||||
}
|
||||
# Format variants
|
||||
if {$pretty_print && $ropt eq "variants"} {
|
||||
array unset vinfo
|
||||
if {[info exists portinfo(vinfo)]} {
|
||||
array set vinfo $portinfo(vinfo)
|
||||
}
|
||||
|
||||
set pi_vars $inf
|
||||
set inf {}
|
||||
foreach v [lsort $pi_vars] {
|
||||
set varmodifier ""
|
||||
if {[info exists variations($v)]} {
|
||||
# selected by command line, prefixed with +/-
|
||||
set varmodifier $variations($v)
|
||||
} elseif {[info exists global_variations($v)]} {
|
||||
# selected by variants.conf, prefixed with (+)/(-)
|
||||
set varmodifier "($global_variations($v))"
|
||||
# Retrieve additional information from the new key.
|
||||
} elseif {[info exists vinfo]} {
|
||||
array unset variant
|
||||
array set variant $vinfo($v)
|
||||
if {[info exists variant(is_default)]} {
|
||||
set varmodifier "\[$variant(is_default)]"
|
||||
}
|
||||
lappend inf "$varmodifier$v"
|
||||
}
|
||||
} elseif {[string match "depend*" $ropt]
|
||||
&& ![macports::ui_isset ports_verbose]} {
|
||||
set pi_deps $inf
|
||||
set inf {}
|
||||
foreach d $pi_deps {
|
||||
lappend inf [lindex [split $d :] end]
|
||||
}
|
||||
lappend inf "$varmodifier$v"
|
||||
}
|
||||
}
|
||||
#End of special pretty-print formatting for certain fields
|
||||
|
||||
# Show full depspec only in verbose mode
|
||||
if {[string match "depend*" $ropt]
|
||||
&& ![macports::ui_isset ports_verbose]} {
|
||||
set pi_deps $inf
|
||||
set inf {}
|
||||
foreach d $pi_deps {
|
||||
lappend inf [lindex [split $d :] end]
|
||||
}
|
||||
}
|
||||
|
||||
# End of special pretty-print formatting for certain fields
|
||||
|
||||
if {[info exists list_map($ropt)]} {
|
||||
set field [join $inf [lindex $list_map($ropt) $list_map_index]]
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user