[88177] trunk/base/src/port1.0/portlivecheck.tcl

pixilla at macports.org pixilla at macports.org
Wed Dec 21 09:20:55 PST 2011


Revision: 88177
          http://trac.macports.org/changeset/88177
Author:   pixilla at macports.org
Date:     2011-12-21 09:20:55 -0800 (Wed, 21 Dec 2011)
Log Message:
-----------
Fix port livecheck regex multiple matches on the same line

http://lists.macosforge.org/pipermail/macports-dev/2011-December/017134.html

Modified Paths:
--------------
    trunk/base/src/port1.0/portlivecheck.tcl

Modified: trunk/base/src/port1.0/portlivecheck.tcl
===================================================================
--- trunk/base/src/port1.0/portlivecheck.tcl	2011-12-21 17:00:13 UTC (rev 88176)
+++ trunk/base/src/port1.0/portlivecheck.tcl	2011-12-21 17:20:55 UTC (rev 88177)
@@ -169,13 +169,15 @@
                     set updated_version 0
                     set foundmatch 0
                     while {[gets $chan line] >= 0} {
-                        set matches [regexp -all -inline $the_re $line]
-                        foreach {matched upver} $matches {
+                        set lastoff 0
+                        while {[regexp -start $lastoff -indices $the_re $line offsets]} {
+                            regexp -start $lastoff $the_re $line matched upver
                             set foundmatch 1
                             if {$updated_version == 0 || [vercmp $upver $updated_version] > 0} {
                                 set updated_version $upver
                             }
                             ui_debug "The regex matched \"$matched\", extracted \"$upver\""
+                            lassign $offsets firstoff lastoff
                         }
                     }
                     if {$foundmatch == 1} {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20111221/6c1be276/attachment.html>


More information about the macports-changes mailing list