[82550] trunk/dports/_resources/port1.0/group/app-1.0.tcl

ryandesign at macports.org ryandesign at macports.org
Mon Aug 15 10:44:47 PDT 2011


Revision: 82550
          http://trac.macports.org/changeset/82550
Author:   ryandesign at macports.org
Date:     2011-08-15 10:44:45 -0700 (Mon, 15 Aug 2011)
Log Message:
-----------
app-1.0.tcl: make compatible with Tiger by providing fallback lreverse implementation

Modified Paths:
--------------
    trunk/dports/_resources/port1.0/group/app-1.0.tcl

Modified: trunk/dports/_resources/port1.0/group/app-1.0.tcl
===================================================================
--- trunk/dports/_resources/port1.0/group/app-1.0.tcl	2011-08-15 17:04:43 UTC (rev 82549)
+++ trunk/dports/_resources/port1.0/group/app-1.0.tcl	2011-08-15 17:44:45 UTC (rev 82550)
@@ -142,7 +142,19 @@
     return [regsub -all -nocase {[^a-z0-9.-]} [join ${identifier} .] ""]
 }
 
+# Implement our own lreverse proc, if it doesn't already exist. This will be
+# the case on Tiger which has Tcl 8.4; lreverse is new in Tcl 8.5.
+# Taken from http://wiki.tcl.tk/17188
+if {[info command lreverse] == ""} {
+    proc lreverse l {
+        set r {}
+        set i [llength $l]
+        while {[incr i -1]} {lappend r [lindex $l $i]}
+        lappend r [lindex $l 0]
+    }
+}
 
+
 platform macosx {
     post-destroot {
         if {[tbool app.create]} {
@@ -267,6 +279,3 @@
         depends_build-append port:makeicns
     }
 }
-
-
-# TODO: for Tiger we probably need our own lreverse implementation e.g. http://wiki.tcl.tk/17188
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20110815/6726e2b7/attachment.html>


More information about the macports-changes mailing list