[66708] users/jmr/restore_ports/restore_ports.tcl

jmr at macports.org jmr at macports.org
Tue Apr 20 16:02:48 PDT 2010


Revision: 66708
          http://trac.macports.org/changeset/66708
Author:   jmr at macports.org
Date:     2010-04-20 16:02:47 -0700 (Tue, 20 Apr 2010)
Log Message:
-----------
restore_ports: trunk compatibility

Modified Paths:
--------------
    users/jmr/restore_ports/restore_ports.tcl

Modified: users/jmr/restore_ports/restore_ports.tcl
===================================================================
--- users/jmr/restore_ports/restore_ports.tcl	2010-04-20 22:55:22 UTC (rev 66707)
+++ users/jmr/restore_ports/restore_ports.tcl	2010-04-20 23:02:47 UTC (rev 66708)
@@ -54,14 +54,24 @@
         #ui_msg "name = $name"
         set version [lindex $port 1]
         set variants ""
-        # XXX will need updating when we start recording -variants
-        set variantsStart [string first "+" $version]
-        if {$variantsStart != -1} {
-            set variants [string range $version $variantsStart end]
-            set variant_names [lrange [split $variants +] 1 end]
-            set variants [list]
-            foreach v $variant_names {
-                lappend variants $v "+"
+
+        if {[regexp {^@([^+]+?)(_(\d+)(([-+][^-+]+)*))?$} $version - - - - variantstr] && [info exists variantstr]} {
+            while 1 {
+                set nextplus [string last + $variantstr]
+                set nextminus [string last - $variantstr]
+                if {$nextplus > $nextminus} {
+                    set next $nextplus
+                    set sign +
+                } else {
+                    set next $nextminus
+                    set sign -
+                }
+                if {$next == -1} {
+                    break
+                }
+                set v [string range $variantstr [expr $next + 1] end]
+                lappend variants $v $sign
+                set variantstr [string range $variantstr 0 [expr $next - 1]]
             }
         }
         #ui_msg "variants = $variants"
@@ -141,9 +151,8 @@
         set porturl $portinfo(porturl)
         
         # XXX should explicitly turn off default variants that don't appear in the list
-        set filtered_variations [mport_filtervariants $variations no]
         
-        if {[catch {set workername [mportopen $porturl {} $filtered_variations]} result]} {
+        if {[catch {set workername [mportopen $porturl {} $variations]} result]} {
             global errorInfo
             ui_debug "$errorInfo"
             return -code error "Unable to open port '$name': $result"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20100420/af238a41/attachment-0001.html>


More information about the macports-changes mailing list