125 | | # Perform the check depending on the type. |
126 | | switch ${livecheck.check} { |
127 | | "freshmeat" { |
128 | | if {!$has_homepage || ${livecheck.url} eq ${homepage}} { |
129 | | set livecheck.url "http://freshmeat.net/projects/${livecheck.name}/releases.atom" |
130 | | } |
131 | | if {${livecheck.regex} eq ""} { |
132 | | set livecheck.regex [list "(?i)<title>${livecheck.name} (.*)</title>"] |
133 | | } |
134 | | set livecheck.check "regex" |
135 | | } |
136 | | "sourceforge" { |
137 | | if {!$has_homepage || ${livecheck.url} eq ${homepage}} { |
138 | | set livecheck.url "http://sourceforge.net/export/rss2_projfiles.php?project=${livecheck.name}" |
139 | | } |
140 | | if {${livecheck.distname} eq "default"} { |
141 | | set livecheck.distname ${livecheck.name} |
142 | | } |
143 | | if {${livecheck.regex} eq ""} { |
144 | | set livecheck.regex [list "<title>[quotemeta ${livecheck.distname}] (.*) released.*</title>"] |
145 | | } |
146 | | set livecheck.check "regex" |
147 | | } |
148 | | "googlecode" { |
149 | | if {!$has_homepage || ${livecheck.url} eq ${homepage}} { |
150 | | set livecheck.url "http://code.google.com/p/${livecheck.name}/downloads/list" |
151 | | } |
152 | | if {${livecheck.distname} eq "default"} { |
153 | | set livecheck.distname [regsub ***=${livecheck.version} [file tail [lindex ${distfiles} 0]] (.*)] |
154 | | } |
155 | | if {${livecheck.regex} eq ""} { |
156 | | set livecheck.regex [list "<a href=\"http://[quotemeta ${livecheck.name}].googlecode.com/files/[quotemeta ${livecheck.distname}]\""] |
157 | | } |
158 | | set livecheck.check "regex" |
159 | | } |
160 | | "gnu" { |
161 | | if {!$has_homepage || ${livecheck.url} eq ${homepage}} { |
162 | | set livecheck.url "http://ftp.gnu.org/gnu/${livecheck.name}/?C=M&O=D" |
163 | | } |
164 | | if {${livecheck.distname} eq "default"} { |
165 | | set livecheck.distname ${livecheck.name} |
166 | | } |
167 | | if {${livecheck.regex} eq ""} { |
168 | | set livecheck.regex [list "[quotemeta ${livecheck.distname}]-(\\d+(?:\\.\\d+)*)"] |
169 | | } |
170 | | set livecheck.check "regex" |
171 | | } |
| 125 | # Load the default values (e.g., livecheck.regex) for the default types |
| 126 | # (e.g., freshmeat). |
| 127 | set defaultsfile [getdefaultportresourcepath "port1.0/livecheck/defaults.tcl"] |
| 128 | if {[file exists $defaultsfile]} { |
| 129 | ui_debug "Loading the default values from $defaultsfile" |
| 130 | source $defaultsfile |
| 131 | } else { |
| 132 | ui_warn "The defaults file $defaultsfile could not be loaded; livecheck may not work as expected." |