[48370] trunk/base/src/port/port.tcl
raimue at macports.org
raimue at macports.org
Thu Mar 19 19:14:19 PDT 2009
Revision: 48370
http://trac.macports.org/changeset/48370
Author: raimue at macports.org
Date: 2009-03-19 19:14:19 -0700 (Thu, 19 Mar 2009)
Log Message:
-----------
port/port.tcl:
Output all mods for variant selection in action_variants, also use wrapline
Modified Paths:
--------------
trunk/base/src/port/port.tcl
Modified: trunk/base/src/port/port.tcl
===================================================================
--- trunk/base/src/port/port.tcl 2009-03-20 00:52:06 UTC (rev 48369)
+++ trunk/base/src/port/port.tcl 2009-03-20 02:14:19 UTC (rev 48370)
@@ -2297,6 +2297,7 @@
}
proc action_variants { action portlist opts } {
+ global global_variations
set status 0
if {[require_portlist portlist]} {
return 1
@@ -2355,7 +2356,6 @@
# print out all the variants
puts "$portname has the variants:"
foreach v [lsort $portinfo(variants)] {
- set mod ""
unset -nocomplain vconflicts vdescription vrequires
# Retrieve variants' information from the new format.
if {[info exists vinfo]} {
@@ -2370,8 +2370,17 @@
if {[info exists variant(description)]} {
set vdescription $variant(description)
}
- if {[info exists variant(is_default)]} {
- set mod "\[+] "
+
+ # XXX Keep these mods in sync with action_info, or create a wrapper for it
+ if {[info exists variations($v)]} {
+ set mod " $variations($v)"
+ } elseif {[info exists global_variations($v)]} {
+ # selected by variants.conf, prefixed with (+)/(-)
+ set mod "($global_variations($v))"
+ } elseif {[info exists variant(is_default)]} {
+ set mod "\[+]"
+ } else {
+ set mod " "
}
if {[info exists variant(requires)]} {
set vrequires $variant(requires)
@@ -2382,21 +2391,21 @@
set vdescription $vdescriptions($v)
}
- puts -nonewline " $mod$v"
if {[info exists vdescription]} {
- puts -nonewline ": [string trim $vdescription]"
+ puts [wraplabel "$mod$v" [string trim $vdescription] 0 [string repeat " " [expr 5 + [string length $v]]]]
+ } else {
+ puts "$mod$v"
}
if {[info exists vconflicts]} {
- puts -nonewline "\n * conflicts with [string trim $vconflicts]"
+ puts " * conflicts with [string trim $vconflicts]"
}
if {[info exists vrequires]} {
- puts -nonewline "\n * requires [string trim $vrequires]"
+ puts " * requires [string trim $vrequires]"
}
- puts ""
}
}
}
-
+
return $status
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090319/fb6bfa3c/attachment.html>
More information about the macports-changes
mailing list