[51575] trunk

raimue at macports.org raimue at macports.org
Wed May 27 17:45:21 PDT 2009


Revision: 51575
          http://trac.macports.org/changeset/51575
Author:   raimue at macports.org
Date:     2009-05-27 17:45:21 -0700 (Wed, 27 May 2009)
Log Message:
-----------
port1.0/portlivecheck.tcl, _resources/port1.0/livecheck:
Deprecate livecheck.check and rename to livecheck.type

Modified Paths:
--------------
    trunk/base/src/port1.0/portlivecheck.tcl
    trunk/dports/_resources/port1.0/livecheck/freshmeat.tcl
    trunk/dports/_resources/port1.0/livecheck/gnome.tcl
    trunk/dports/_resources/port1.0/livecheck/gnu.tcl
    trunk/dports/_resources/port1.0/livecheck/googlecode.tcl
    trunk/dports/_resources/port1.0/livecheck/sourceforge.tcl

Modified: trunk/base/src/port1.0/portlivecheck.tcl
===================================================================
--- trunk/base/src/port1.0/portlivecheck.tcl	2009-05-28 00:41:42 UTC (rev 51574)
+++ trunk/base/src/port1.0/portlivecheck.tcl	2009-05-28 00:45:21 UTC (rev 51575)
@@ -46,19 +46,23 @@
 }
 
 # define options
-options livecheck.url livecheck.check livecheck.md5 livecheck.regex livecheck.name livecheck.distname livecheck.version
+options livecheck.url livecheck.type livecheck.check livecheck.md5 livecheck.regex livecheck.name livecheck.distname livecheck.version
 
 # defaults
 default livecheck.url {$homepage}
 default livecheck.check default
+default livecheck.type default
 default livecheck.md5 ""
 default livecheck.regex ""
 default livecheck.name default
 default livecheck.distname default
 default livecheck.version {$version}
 
+# Deprecation
+option_deprecate livecheck.check livecheck.type
+
 proc portlivecheck::livecheck_main {args} {
-    global livecheck.url livecheck.check livecheck.md5 livecheck.regex livecheck.name livecheck.distname livecheck.version
+    global livecheck.url livecheck.type livecheck.md5 livecheck.regex livecheck.name livecheck.distname livecheck.version
     global fetch.user fetch.password fetch.use_epsv fetch.ignore_sslcert
     global homepage portpath workpath
     global master_sites name distfiles
@@ -98,7 +102,7 @@
     # "freshmeat|gnu|...").
     set available_types [regsub -all {\.tcl} [join $available_types |] {}]
 
-    if {${livecheck.check} eq "default"} {
+    if {${livecheck.type} eq "default"} {
         # Determine the default type from the mirror.
         if {$has_master_sites} {
             foreach {master_site} ${master_sites} {
@@ -106,7 +110,7 @@
                     if {${subdir} ne "" && ${livecheck.name} eq "default"} {
                         set livecheck.name ${subdir}
                     }
-                    set livecheck.check ${site}
+                    set livecheck.type ${site}
 
                     break
                 }
@@ -114,17 +118,17 @@
         }
         # If the default type cannot be determined from the mirror, use the
         # fallback.
-        if {${livecheck.check} eq "default"} {
-            set livecheck.check "fallback"
+        if {${livecheck.type} eq "default"} {
+            set livecheck.type "fallback"
         }
         # If livecheck.name is still "default", set it to $name.
         if {${livecheck.name} eq "default"} {
             set livecheck.name $name
         }
     }
-    if {[lsearch -exact [split $available_types "|"] ${livecheck.check}] != -1} {
-        # Load the defaults from _resources/port1.0/livecheck/${livecheck.check}.tcl.
-        set defaults_file "$types_dir/${livecheck.check}.tcl"
+    if {[lsearch -exact [split $available_types "|"] ${livecheck.type}] != -1} {
+        # Load the defaults from _resources/port1.0/livecheck/${livecheck.type}.tcl.
+        set defaults_file "$types_dir/${livecheck.type}.tcl"
         ui_debug "Loading the defaults from '$defaults_file'"
         if {[catch {source $defaults_file} result]} {
             return -code 1 "The defaults could not be loaded from '$defaults_file'."
@@ -134,7 +138,7 @@
     # de-escape livecheck.url
     set livecheck.url [join ${livecheck.url}]
 
-    switch ${livecheck.check} {
+    switch ${livecheck.type} {
         "regex" -
         "regexm" {
             # single and multiline regex
@@ -148,7 +152,7 @@
                 set updated -1
                 set the_re [join ${livecheck.regex}]
                 ui_debug "The regex is \"$the_re\""
-                if {${livecheck.check} == "regexm"} {
+                if {${livecheck.type} == "regexm"} {
                     set data [read $chan]
                     if {[regexp $the_re $data matched updated_version]} {
                         if {$updated_version != ${livecheck.version}} {
@@ -214,13 +218,13 @@
         "none" {
         }
         default {
-            ui_error "unknown livecheck.check ${livecheck.check}"
+            ui_error "unknown livecheck.type ${livecheck.type}"
         }
     }
 
     file delete -force $tempfile
 
-    if {${livecheck.check} != "none"} {
+    if {${livecheck.type} != "none"} {
         if {$updated > 0} {
             ui_msg "$name seems to have been updated (port version: ${livecheck.version}, new version: $updated_version)"
         } elseif {$updated == 0} {

Modified: trunk/dports/_resources/port1.0/livecheck/freshmeat.tcl
===================================================================
--- trunk/dports/_resources/port1.0/livecheck/freshmeat.tcl	2009-05-28 00:41:42 UTC (rev 51574)
+++ trunk/dports/_resources/port1.0/livecheck/freshmeat.tcl	2009-05-28 00:45:21 UTC (rev 51575)
@@ -8,4 +8,4 @@
 if {${livecheck.regex} eq ""} {
     set livecheck.regex [list "(?i)<title>${livecheck.name} (.*)</title>"]
 }
-set livecheck.check "regex"
+set livecheck.type "regex"

Modified: trunk/dports/_resources/port1.0/livecheck/gnome.tcl
===================================================================
--- trunk/dports/_resources/port1.0/livecheck/gnome.tcl	2009-05-28 00:41:42 UTC (rev 51574)
+++ trunk/dports/_resources/port1.0/livecheck/gnome.tcl	2009-05-28 00:45:21 UTC (rev 51575)
@@ -8,4 +8,4 @@
 if {${livecheck.regex} eq ""} {
     set livecheck.regex [list "\"LATEST-IS-(.*)\""]
 }
-set livecheck.check "regex"
+set livecheck.type "regex"

Modified: trunk/dports/_resources/port1.0/livecheck/gnu.tcl
===================================================================
--- trunk/dports/_resources/port1.0/livecheck/gnu.tcl	2009-05-28 00:41:42 UTC (rev 51574)
+++ trunk/dports/_resources/port1.0/livecheck/gnu.tcl	2009-05-28 00:45:21 UTC (rev 51575)
@@ -15,4 +15,4 @@
 if {${livecheck.regex} eq ""} {
     set livecheck.regex [list "[quotemeta ${livecheck.distname}]-(\\d+(?:\\.\\d+)*)"]
 }
-set livecheck.check "regex"
+set livecheck.type "regex"

Modified: trunk/dports/_resources/port1.0/livecheck/googlecode.tcl
===================================================================
--- trunk/dports/_resources/port1.0/livecheck/googlecode.tcl	2009-05-28 00:41:42 UTC (rev 51574)
+++ trunk/dports/_resources/port1.0/livecheck/googlecode.tcl	2009-05-28 00:45:21 UTC (rev 51575)
@@ -15,4 +15,4 @@
 if {${livecheck.regex} eq ""} {
     set livecheck.regex [list "<a href=\"http://[quotemeta ${livecheck.name}].googlecode.com/files/${livecheck.distname}\""]
 }
-set livecheck.check "regex"
+set livecheck.type "regex"

Modified: trunk/dports/_resources/port1.0/livecheck/sourceforge.tcl
===================================================================
--- trunk/dports/_resources/port1.0/livecheck/sourceforge.tcl	2009-05-28 00:41:42 UTC (rev 51574)
+++ trunk/dports/_resources/port1.0/livecheck/sourceforge.tcl	2009-05-28 00:45:21 UTC (rev 51575)
@@ -11,4 +11,4 @@
 if {${livecheck.regex} eq ""} {
     set livecheck.regex [list "(?i)<title>[quotemeta ${livecheck.distname}] (.*) released.*</title>"]
 }
-set livecheck.check "regex"
+set livecheck.type "regex"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090527/9889c663/attachment-0001.html>


More information about the macports-changes mailing list