Skip to content
Permalink
Browse files

New livecheck check: sourceforge.

By default, the livecheck check is sourceforge if the project is obviously (looking at master_sites) hosted as a sourceforge project. Otherwise, it's freshmeat (which used to be the default but the information there isn't always very fresh).

git-svn-id: https://svn.macports.org/repository/macports/trunk/base@18745 d073be05-634f-4543-b044-5fe20cf6d1d6
  • Loading branch information
pguyot committed Jul 26, 2006
1 parent cc601b4 commit 7c69c12c5aebca0c9df40eaad970a1792205aab0
Showing with 40 additions and 5 deletions.
  1. +10 −2 doc/portfile.7
  2. +30 −3 src/port1.0/portlivecheck.tcl
@@ -903,6 +903,8 @@ What kind of check to perform to figure out if the software has been updated.
Can be
.Em freshmeat
(uses the date_updated tag of the freshmeat XML file),
.Em sourceforge
(uses the version of the latest file release of the project),
.Em moddate
(uses the modification date of some URL resource),
.Em regex
@@ -919,17 +921,21 @@ Can be
.br
.Sy Default:
.Em freshmeat
or
.Em sourceforge
if the master_sites is sourceforge.
.br
.Sy Values:
.Em freshmeat moddate regex regexm md5 none
.Em freshmeat sourceforge moddate regex regexm md5 none
.It Ic livecheck.name
Name of the project for live checks (used for freshmeat-based checks).
Name of the project for live checks (used for freshmeat and sourceforge checks).
.br
.Sy Type:
.Em optional
.br
.Sy Default:
.Em ${name}
or the sourceforge project name if it can be guessed by looking at the master_sites.
.It Ic livecheck.version
Version of the project for live checks (used for regex-based checks).
.br
@@ -948,6 +954,8 @@ URL to query for the check.
.Em ${homepage}
or
.Em http://freshmeat.net/projects-xml/${livecheck.name}/${livecheck.name}.xml
or
.Em http://sourceforge.net/export/rss2_projfiles.php?project=${livecheck.name}
.It Ic livecheck.regex
Regular expression to parse the resource for regex checks.
.br
@@ -1,7 +1,7 @@
# et:ts=4
# portlivecheck.tcl
#
# $Id: portlivecheck.tcl,v 1.8 2006/07/25 08:05:26 pguyot Exp $
# $Id: portlivecheck.tcl,v 1.9 2006/07/26 05:29:50 pguyot Exp $
#
# Copyright (c) 2005-2006 Paul Guyot <pguyot@kallisys.net>,
# All rights reserved.
@@ -47,15 +47,16 @@ options livecheck.url livecheck.check livecheck.md5 livecheck.regex livecheck.na

# defaults
default livecheck.url {$homepage}
default livecheck.check freshmeat
default livecheck.check default
default livecheck.md5 ""
default livecheck.regex ""
default livecheck.name {$name}
default livecheck.name default
default livecheck.version {$version}

proc livecheck_main {args} {
global livecheck.url livecheck.check livecheck.md5 livecheck.regex livecheck.name livecheck.version
global homepage portname portpath workpath
global master_sites name

set updated 0
set updated_version "unknown"
@@ -66,6 +67,24 @@ proc livecheck_main {args} {
ui_debug "Portfile modification date is [clock format $port_moddate]"
ui_debug "Port (livecheck) version is ${livecheck.version}"

# Determine the default type depending on the mirror.
if {"${livecheck.check}" == "default"} {
set sourceforge_projectname ${name}
if {[regexp {sourceforge:(.+)} $master_sites tag]} {
if {"${livecheck.name}" == "default"} {
set livecheck.name $tag
}
set livecheck.check sourceforge
} elseif {"$master_sites" == "sourceforge"} {
set livecheck.check sourceforge
} else {
set livecheck.check freshmeat
}
}
if {"${livecheck.name}" == "default"} {
set livecheck.name $name
}

# Perform the check depending on the type.
if {"${livecheck.check}" == "freshmeat"} {
if {![info exists homepage] || [string equal "${livecheck.url}" "${homepage}"]} {
@@ -75,6 +94,14 @@ proc livecheck_main {args} {
set livecheck.regex "<latest_release_version>(.*)</latest_release_version>"
}
set livecheck.check "regex"
} elseif {"${livecheck.check}" == "sourceforge"} {
if {![info exists homepage] || [string equal "${livecheck.url}" "${homepage}"]} {
set livecheck.url "http://sourceforge.net/export/rss2_projfiles.php?project=${livecheck.name}"
}
if {"${livecheck.regex}" == ""} {
set livecheck.regex "<title>${livecheck.name} (.*) released.*</title>"
}
set livecheck.check "regex"
}

switch ${livecheck.check} {

0 comments on commit 7c69c12

Please sign in to comment.
You can’t perform that action at this time.