[25442] branches/dp2mp-move/base/src/port

source_changes at macosforge.org source_changes at macosforge.org
Mon May 21 22:41:53 PDT 2007


Revision: 25442
          http://trac.macosforge.org/projects/macports/changeset/25442
Author:   jmpp at macports.org
Date:     2007-05-21 22:41:53 -0700 (Mon, 21 May 2007)

Log Message:
-----------
Merging jberry's 25147: Add support for descriptions on variants (...).

Modified Paths:
--------------
    branches/dp2mp-move/base/src/port/port.tcl
    branches/dp2mp-move/base/src/port1.0/portutil.tcl

Modified: branches/dp2mp-move/base/src/port/port.tcl
===================================================================
--- branches/dp2mp-move/base/src/port/port.tcl	2007-05-22 05:39:53 UTC (rev 25441)
+++ branches/dp2mp-move/base/src/port/port.tcl	2007-05-22 05:41:53 UTC (rev 25442)
@@ -1239,16 +1239,26 @@
 				if {[info exists portinfo(revision)] && $portinfo(revision) > 0} { 
 					puts -nonewline ", Revision $portinfo(revision)" 
 				}
-				puts -nonewline ", $portinfo(portdir)" 
+				puts ", $portinfo(portdir)" 
+				
 				if {[info exists portinfo(variants)]} {
-					puts -nonewline " (Variants: "
+					if {[info exists portinfo(variant_desc)]} {
+						array set descs $portinfo(variant_desc)
+					} else {
+						array set descs ""
+					}
+					puts "Variants:"
 					for {set i 0} {$i < [llength $portinfo(variants)]} {incr i} {
-						if {$i > 0} { puts -nonewline ", " }
-						puts -nonewline "[lindex $portinfo(variants) $i]"
+						set v [lindex $portinfo(variants) $i]
+						if {[info exists descs($v)]} {
+							puts " - $v: $descs($v)"
+						} else {
+							puts " - $v"
+						}
 					}
-					puts -nonewline ")"
 				}
 				puts ""
+				
 				if {[info exists portinfo(homepage)]} { 
 					puts "$portinfo(homepage)"
 				}

Modified: branches/dp2mp-move/base/src/port1.0/portutil.tcl
===================================================================
--- branches/dp2mp-move/base/src/port1.0/portutil.tcl	2007-05-22 05:39:53 UTC (rev 25441)
+++ branches/dp2mp-move/base/src/port1.0/portutil.tcl	2007-05-22 05:41:53 UTC (rev 25442)
@@ -367,9 +367,10 @@
     set mode "provides"
     foreach arg $args {
 	switch -exact $arg {
-	    provides { set mode "provides" }
-	    requires { set mode "requires" }
-	    conflicts { set mode "conflicts" }
+	    description -
+	    provides -
+	    requires -
+	    conflicts { set mode $arg }
 	    default { ditem_append $ditem $mode $arg }		
         }
     }
@@ -388,6 +389,10 @@
 		variant_remove_ditem $variant_provides
 	} else {
 	    lappend PortInfo(variants) $variant_provides
+	    set vdesc [join [ditem_key $ditem description]]
+	    if {$vdesc != ""} {
+		    lappend PortInfo(variant_desc) $variant_provides $vdesc
+		}
 	}
 
 	# Finally append the ditem to the dlist.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20070521/5229097d/attachment.html


More information about the macports-changes mailing list