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

source_changes at macosforge.org source_changes at macosforge.org
Wed Oct 10 08:51:44 PDT 2007


Revision: 29812
          http://trac.macosforge.org/projects/macports/changeset/29812
Author:   nox at macports.org
Date:     2007-10-10 08:51:44 -0700 (Wed, 10 Oct 2007)

Log Message:
-----------
portlivecheck.tcl (closes #11948): Added GNU livecheck.

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-10 13:25:43 UTC (rev 29811)
+++ trunk/base/src/port1.0/portlivecheck.tcl	2007-10-10 15:51:44 UTC (rev 29812)
@@ -72,7 +72,7 @@
 
     # Determine the default type depending on the mirror.
     if {${livecheck.check} eq "default"} {
-        if {$has_master_sites && [regexp {\y(sourceforge|freshmeat|googlecode)\y(?::(\S+))?} $master_sites _ site tag]} {
+        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
             }
@@ -80,11 +80,18 @@
         } else {
             set livecheck.check "freshmeat"
         }
-        if {$has_homepage && [regexp {^http://code.google.com/p/([^/]+)} $homepage _ tag]} {
-            if {${livecheck.name} eq "default"} {
-                set livecheck.name $tag
+        if {$has_homepage} {
+            if {[regexp {^http://code.google.com/p/([^/]+)} $homepage _ tag]} {
+                if {${livecheck.name} eq "default"} {
+                    set livecheck.name $tag
+                }
+                set livecheck.check "googlecode"
+            } elseif {[regexp {^http://www.gnu.org/software/([^/]+)} $homepage _ tag]} {
+                if {${livecheck.name} eq "default"} {
+                    set livecheck.name $tag
+                }
+                set livecheck.check "gnu"
             }
-            set livecheck.check "googlecode"
         }
     }
     if {${livecheck.name} eq "default"} {
@@ -126,6 +133,18 @@
             }
             set livecheck.check "regex"
         }
+        "gnu" {
+            if {!$has_homepage || ${livecheck.url} eq ${homepage}} {
+                set livecheck.url "http://ftp.gnu.org/gnu/${livecheck.name}/?C=M&O=D"
+            }
+            if {${livecheck.distname} eq "default"} {
+                set livecheck.distname ${livecheck.name}
+            }
+            if {${livecheck.regex} eq ""} {
+                set livecheck.regex {${livecheck.distname}-(\\d+(?:\\.\\d+)*)}
+            }
+            set livecheck.check "regex"
+        }
     }
     
     # de-escape livecheck.url

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


More information about the macports-changes mailing list