Skip to content
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: 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
.Sy Default:
.Em freshmeat
.Em sourceforge
if the master_sites is sourceforge.
.Sy Values:
.Em freshmeat moddate regex regexm md5 none
.Em freshmeat sourceforge moddate regex regexm md5 none
.It Ic
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).
.Sy Type:
.Em optional
.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).
@@ -948,6 +954,8 @@ URL to query for the check.
.Em ${homepage}
.It Ic livecheck.regex
Regular expression to parse the resource for regex checks.
@@ -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 <>,
# All rights reserved.
@@ -47,15 +47,16 @@ options livecheck.url livecheck.check livecheck.md5 livecheck.regex

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

proc livecheck_main {args} {
global livecheck.url livecheck.check livecheck.md5 livecheck.regex 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 {"${}" == "default"} {
set $tag
set livecheck.check sourceforge
} elseif {"$master_sites" == "sourceforge"} {
set livecheck.check sourceforge
} else {
set livecheck.check freshmeat
if {"${}" == "default"} {
set $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 "${}"
if {"${livecheck.regex}" == ""} {
set livecheck.regex "<title>${} (.*) 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.