Ticket #18889: defaults.tcl

File defaults.tcl, 2.2 KB (added by lperry (Perry Lee), 16 years ago)
Line 
1# $Id$
2# _resources/port1.0/livecheck/defaults.tcl
3#
4# This file is sourced by portlivecheck.tcl to load the default values (e.g.,
5# livecheck.regex) for the default types (e.g., freshmeat).
6
7# This switch block is executed after livecheck.check has been set. Refer to
8# portlivecheck::livecheck_main for more details.
9switch ${livecheck.check} {
10    "freshmeat" {
11        if {!$has_homepage || ${livecheck.url} eq ${homepage}} {
12            set livecheck.url "http://freshmeat.net/projects/${livecheck.name}/releases.atom"
13        }
14        if {${livecheck.regex} eq ""} {
15            set livecheck.regex [list "(?i)<title>${livecheck.name} (.*)</title>"]
16        }
17        set livecheck.check "regex"
18    }
19    "gnu" {
20        if {!$has_homepage || ${livecheck.url} eq ${homepage}} {
21            set livecheck.url "http://ftp.gnu.org/gnu/${livecheck.name}/?C=M&O=D"
22        }
23        if {${livecheck.distname} eq "default"} {
24            set livecheck.distname ${livecheck.name}
25        }
26        if {${livecheck.regex} eq ""} {
27            set livecheck.regex [list "[quotemeta ${livecheck.distname}]-(\\d+(?:\\.\\d+)*)"]
28        }
29        set livecheck.check "regex"
30    }
31    "googlecode" {
32        if {!$has_homepage || ${livecheck.url} eq ${homepage}} {
33            set livecheck.url "http://code.google.com/p/${livecheck.name}/downloads/list"
34        }
35        if {${livecheck.distname} eq "default"} {
36            set livecheck.distname [regsub ***=${livecheck.version} [file tail [lindex ${distfiles} 0]] (.*)]
37        }
38        if {${livecheck.regex} eq ""} {
39            set livecheck.regex [list "<a href=\"http://[quotemeta ${livecheck.name}].googlecode.com/files/[quotemeta ${livecheck.distname}]\""]
40        }
41        set livecheck.check "regex"
42    }
43    "sourceforge" {
44        if {!$has_homepage || ${livecheck.url} eq ${homepage}} {
45            set livecheck.url "http://sourceforge.net/export/rss2_projfiles.php?project=${livecheck.name}"
46        }
47        if {${livecheck.distname} eq "default"} {
48            set livecheck.distname ${livecheck.name}
49        }
50        if {${livecheck.regex} eq ""} {
51            set livecheck.regex [list "<title>[quotemeta ${livecheck.distname}] (.*) released.*</title>"]
52        }
53        set livecheck.check "regex"
54    }
55}