Changeset 36952


Ignore:
Timestamp:
May 21, 2008, 2:20:27 AM (12 years ago)
Author:
raimue@…
Message:

port/port.tcl:
Remove get_variant_desc, this will now be done in port1.0/portutil.tcl instead

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/variant-descs-14482/base/src/port/port.tcl

    r34900 r36952  
    451451}
    452452
    453 ##
    454 # Get description for a variant from global descriptions file
    455 #
    456 # @param porturl url to a port
    457 # @param variant name
    458 # @return description from descriptions file or an empty string
    459 proc get_variant_desc {porturl variant} {
    460     global variant_descs_global
    461 
    462     set sourcepath [macports::getsourceconfigdir $porturl]
    463     if {$sourcepath == ""} {
    464         # protocol does not support global variants
    465         return ""
    466     }
    467     set descfile [file join $sourcepath variant_descriptions.conf]
    468     if {![info exists variant_descs_global($sourcepath)]} {
    469         set variant_descs_global($sourcepath) yes
    470 
    471         if {[file exists $descfile]} {
    472             set fd [open $descfile r]
    473             set lineno 0
    474             while {[gets $fd line] >= 0} {
    475                 incr lineno
    476                 if {[regexp {^(\w+)([ \t]+(.*))?$} $line match option ignore val] == 1} {
    477                     set variant_descs_global(${sourcepath}_$option) $val
    478                 } else {
    479                     ui_warn "Invalid variant description in $descfile at line $lineno"
    480                 }
    481             }
    482             close $fd
    483         }
    484     }
    485 
    486     if {[info exists variant_descs_global(${sourcepath}_${variant})]} {
    487         return $variant_descs_global(${sourcepath}_${variant})
    488     } else {
    489         return ""
    490     }
    491 }
    492 
    493453
    494454##########################################
     
    19671927            puts "$portname has the variants:"
    19681928            foreach v $portinfo(variants) {
    1969                 if {![info exists descs($v)]} {
    1970                     # if description is not set yet, get it from the global source descriptions file
    1971                     set descs($v) [get_variant_desc $porturl $v]
    1972                 }
    1973 
    19741929                if {[info exists descs($v)] && $descs($v) != ""} {
    19751930                    puts "\t$v: [string trim $descs($v)]"
Note: See TracChangeset for help on using the changeset viewer.