Changeset 29872 for trunk/base


Ignore:
Timestamp:
Oct 14, 2007, 11:38:42 AM (12 years ago)
Author:
nox@…
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.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/src/port1.0/portlivecheck.tcl

    r29812 r29872  
    7373    # Determine the default type depending on the mirror.
    7474    if {${livecheck.check} eq "default"} {
    75         if {$has_master_sites && [regexp {\y(sourceforge|freshmeat|googlecode|gnu)\y(?::(\S+))?} $master_sites _ site tag]} {
    76             if {$tag ne "" && ${livecheck.name} eq "default"} {
    77                 set livecheck.name $tag
    78             }
    79             set livecheck.check $site
    80         } else {
     75        if {$has_master_sites} {
     76            foreach {master_site} ${master_sites} {
     77                if {[regexp {^(sourceforge|freshmeat|googlecode|gnu)(?::([^:]+))?} ${master_site} _ site subdir]} {
     78                    if {${subdir} ne "" && ${livecheck.name} eq "default"} {
     79                        set livecheck.name ${subdir}
     80                    }
     81                    set livecheck.check ${site}
     82
     83                    break
     84                }
     85            }
     86        }
     87        if {${livecheck.check} eq "default"} {
    8188            set livecheck.check "freshmeat"
    8289        }
Note: See TracChangeset for help on using the changeset viewer.