[41138] branches/variant-descs-14482/base/src/port1.0/portutil.tcl

raimue at macports.org raimue at macports.org
Sat Oct 25 11:52:52 PDT 2008


Revision: 41138
          http://trac.macports.org/changeset/41138
Author:   raimue at macports.org
Date:     2008-10-25 11:52:50 -0700 (Sat, 25 Oct 2008)
Log Message:
-----------
port1.0/portutil.tcl:
Use getportresourcepath for global variant descriptions

Modified Paths:
--------------
    branches/variant-descs-14482/base/src/port1.0/portutil.tcl

Modified: branches/variant-descs-14482/base/src/port1.0/portutil.tcl
===================================================================
--- branches/variant-descs-14482/base/src/port1.0/portutil.tcl	2008-10-25 14:47:48 UTC (rev 41137)
+++ branches/variant-descs-14482/base/src/port1.0/portutil.tcl	2008-10-25 18:52:50 UTC (rev 41138)
@@ -553,16 +553,10 @@
 proc variant_desc {porturl variant} {
     global variant_descs_global
 
-    set sourceconfigdir [getportresourcepath $porturl]
+    set descfile [getportresourcepath $porturl variant_descriptions.conf]
+    if {![info exists variant_descs_global($descfile)]} {
+        set variant_descs_global($descfile) yes
 
-    if {$sourceconfigdir == ""} {
-        # protocol does not support global variants
-        return ""
-    }
-    set descfile [file join $sourceconfigdir variant_descriptions.conf]
-    if {![info exists variant_descs_global($sourceconfigdir)]} {
-        set variant_descs_global($sourceconfigdir) yes
-
         if {[file exists $descfile]} {
             if {[catch {set fd [open $descfile r]} err]} {
                 ui_warn "Could not open global variant description file: $err"
@@ -574,7 +568,7 @@
                 set name [lindex $line 0]
                 set desc [lindex $line 1]
                 if {$name != "" && $desc != ""} {
-                    set variant_descs_global(${sourceconfigdir}_$name) $desc
+                    set variant_descs_global(${descfile}_$name) $desc
                 } else {
                     ui_warn "Invalid variant description in $descfile at line $lineno"
                 }
@@ -583,8 +577,8 @@
         }
     }
 
-    if {[info exists variant_descs_global(${sourceconfigdir}_${variant})]} {
-        return $variant_descs_global(${sourceconfigdir}_${variant})
+    if {[info exists variant_descs_global(${descfile}_${variant})]} {
+        return $variant_descs_global(${descfile}_${variant})
     } else {
         return ""
     }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20081025/9236caf1/attachment.html>


More information about the macports-changes mailing list