[41145] branches/variant-descs-14482/base/src/macports1.0/macports.tcl

raimue at macports.org raimue at macports.org
Sat Oct 25 15:04:16 PDT 2008


Revision: 41145
          http://trac.macports.org/changeset/41145
Author:   raimue at macports.org
Date:     2008-10-25 15:04:15 -0700 (Sat, 25 Oct 2008)
Log Message:
-----------
macports1.0/macports.tcl:
Fix a problem with URLs not using the file protocol

Modified Paths:
--------------
    branches/variant-descs-14482/base/src/macports1.0/macports.tcl

Modified: branches/variant-descs-14482/base/src/macports1.0/macports.tcl
===================================================================
--- branches/variant-descs-14482/base/src/macports1.0/macports.tcl	2008-10-25 21:23:39 UTC (rev 41144)
+++ branches/variant-descs-14482/base/src/macports1.0/macports.tcl	2008-10-25 22:04:15 UTC (rev 41145)
@@ -912,16 +912,21 @@
 
     switch -- ${protocol} {
         file {
-            set proposedpath [file normalize [file join [getportdir $url] .. .. .resources $path]]
+            set proposedpath [file normalize [file join [getportdir $url] .. ..]]
         }
     }
 
-    if {[file exists $proposedpath]} {
-        return $proposedpath
+    if {![file exists $proposedpath]} {
+        # fallback
+        set default_source_url [lindex ${sources_default} 0]
+        if {[getprotocol $default_source_url] == "file"} {
+            set proposedpath [getportdir $default_source_url]
+        } else {
+            set proposedpath [getsourcepath $default_source_url]
+        }
     }
 
-    # fallback
-    return [file join [getportdir [lindex ${sources_default} 0]] .resources $path]
+    return [file join $proposedpath .resources $path]
 }
 
 # dportopen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20081025/f6ea9395/attachment.html>


More information about the macports-changes mailing list