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

source_changes at macosforge.org source_changes at macosforge.org
Sun Oct 14 04:38:42 PDT 2007


Revision: 29872
          http://trac.macosforge.org/projects/macports/changeset/29872
Author:   nox at macports.org
Date:     2007-10-14 04:38:42 -0700 (Sun, 14 Oct 2007)

Log Message:
-----------
portlivecheck.tcl:
 * Now check regular expression against each master_site, instead of directly checking against ${master_sites}.
   Doing so prevent a false-positive match when there is a mirror name in one of the sites (e.g. "gnu" in
   savannah.gnu.org).
 * Fixed regexp to work when there is both a tag and a subdir in the mirror uri.

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

Modified: trunk/base/src/port1.0/portlivecheck.tcl
===================================================================
--- trunk/base/src/port1.0/portlivecheck.tcl	2007-10-14 11:33:58 UTC (rev 29871)
+++ trunk/base/src/port1.0/portlivecheck.tcl	2007-10-14 11:38:42 UTC (rev 29872)
@@ -72,12 +72,19 @@
 
     # Determine the default type depending on the mirror.
     if {${livecheck.check} eq "default"} {
-        if {$has_master_sites && [regexp {\y(sourceforge|freshmeat|googlecode|gnu)\y(?::(\S+))?} $master_sites _ site tag]} {
-            if {$tag ne "" && ${livecheck.name} eq "default"} {
-                set livecheck.name $tag
+        if {$has_master_sites} {
+            foreach {master_site} ${master_sites} {
+                if {[regexp {^(sourceforge|freshmeat|googlecode|gnu)(?::([^:]+))?} ${master_site} _ site subdir]} {
+                    if {${subdir} ne "" && ${livecheck.name} eq "default"} {
+                        set livecheck.name ${subdir}
+                    }
+                    set livecheck.check ${site}
+
+                    break
+                }
             }
-            set livecheck.check $site
-        } else {
+        }
+        if {${livecheck.check} eq "default"} {
             set livecheck.check "freshmeat"
         }
         if {$has_homepage} {

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20071014/abba3439/attachment.html


More information about the macports-changes mailing list