Changeset 18745


Ignore:
Timestamp:
Jul 26, 2006, 5:29:50 AM (14 years ago)
Author:
pguyot (Paul Guyot)
Message:

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).

Location:
trunk/base
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/doc/portfile.7

    r18741 r18745  
    904904.Em freshmeat
    905905(uses the date_updated tag of the freshmeat XML file),
     906.Em sourceforge
     907(uses the version of the latest file release of the project),
    906908.Em moddate
    907909(uses the modification date of some URL resource),
     
    920922.Sy Default:
    921923.Em freshmeat
     924or
     925.Em sourceforge
     926if the master_sites is sourceforge.
    922927.br
    923928.Sy Values:
    924 .Em freshmeat moddate regex regexm md5 none
     929.Em freshmeat sourceforge moddate regex regexm md5 none
    925930.It Ic livecheck.name
    926 Name of the project for live checks (used for freshmeat-based checks).
     931Name of the project for live checks (used for freshmeat and sourceforge checks).
    927932.br
    928933.Sy Type:
     
    931936.Sy Default:
    932937.Em ${name}
     938or the sourceforge project name if it can be guessed by looking at the master_sites.
    933939.It Ic livecheck.version
    934940Version of the project for live checks (used for regex-based checks).
     
    949955or
    950956.Em http://freshmeat.net/projects-xml/${livecheck.name}/${livecheck.name}.xml
     957or
     958.Em http://sourceforge.net/export/rss2_projfiles.php?project=${livecheck.name}
    951959.It Ic livecheck.regex
    952960Regular expression to parse the resource for regex checks.
  • trunk/base/src/port1.0/portlivecheck.tcl

    r18724 r18745  
    22# portlivecheck.tcl
    33#
    4 # $Id: portlivecheck.tcl,v 1.8 2006/07/25 08:05:26 pguyot Exp $
     4# $Id: portlivecheck.tcl,v 1.9 2006/07/26 05:29:50 pguyot Exp $
    55#
    66# Copyright (c) 2005-2006 Paul Guyot <pguyot@kallisys.net>,
     
    4848# defaults
    4949default livecheck.url {$homepage}
    50 default livecheck.check freshmeat
     50default livecheck.check default
    5151default livecheck.md5 ""
    5252default livecheck.regex ""
    53 default livecheck.name {$name}
     53default livecheck.name default
    5454default livecheck.version {$version}
    5555
     
    5757        global livecheck.url livecheck.check livecheck.md5 livecheck.regex livecheck.name livecheck.version
    5858        global homepage portname portpath workpath
     59        global master_sites name
    5960       
    6061        set updated 0
     
    6768        ui_debug "Port (livecheck) version is ${livecheck.version}"
    6869
     70        # Determine the default type depending on the mirror.
     71        if {"${livecheck.check}" == "default"} {
     72                set sourceforge_projectname ${name}
     73                if {[regexp {sourceforge:(.+)} $master_sites tag]} {
     74                        if {"${livecheck.name}" == "default"} {
     75                                set livecheck.name $tag
     76                        }
     77                        set livecheck.check sourceforge
     78                } elseif {"$master_sites" == "sourceforge"} {
     79                        set livecheck.check sourceforge
     80                } else {
     81                        set livecheck.check freshmeat
     82                }
     83        }
     84        if {"${livecheck.name}" == "default"} {
     85                set livecheck.name $name
     86        }
     87
    6988        # Perform the check depending on the type.
    7089        if {"${livecheck.check}" == "freshmeat"} {
     
    7493                if {"${livecheck.regex}" == ""} {
    7594                        set livecheck.regex "<latest_release_version>(.*)</latest_release_version>"
     95                }
     96                set livecheck.check "regex"
     97        } elseif {"${livecheck.check}" == "sourceforge"} {
     98                if {![info exists homepage] || [string equal "${livecheck.url}" "${homepage}"]} {
     99                        set livecheck.url "http://sourceforge.net/export/rss2_projfiles.php?project=${livecheck.name}"
     100                }
     101                if {"${livecheck.regex}" == ""} {
     102                        set livecheck.regex "<title>${livecheck.name} (.*) released.*</title>"
    76103                }
    77104                set livecheck.check "regex"
Note: See TracChangeset for help on using the changeset viewer.