On 2010-04-18 10:26 , Ryan Schmidt wrote:
> My favorite livecheck which you've probably seen me add to many ports
> is:
> 
> livecheck.type regex livecheck.regex ${name}-(\[0-9.\]+)\\.tar
> 
> This checks the project's homepage (the default livecheck.url is
> ${homepage}); this works great if they always put a link to download
> the current version on their homepage. Usually I'll change it to
> check the master_sites:
> 
> livecheck.url [lindex ${master_sites} 0]

Attached is a "livecheck.type master_sites" implementation. It would be
helpful if you get test this, as in my opinion this would be a better
fallback than freshmeat in most cases. It requires a trunk build greater
or equal r66626 as I needed a new helper function to get the plain
mapped URLs from mirror sites and without tags.

Put this file into dports/_resources/port1.0/livecheck/ and add
"livecheck.type master_sites" to your Portfile.

For the livecheck.regex, I am using the current distname of the port and
replace the version string with a regular expression.

I began this some time ago but didn't tested it extensively, maybe
someone could pick this up and improve it. Note when testing, it does
not work with our sourceforge mirror list, but we have a special
sourceforge livecheck already.

Rainer
# $Id$
#
# This file checks the master_sites for new file releases

global version distname

if {${livecheck.name} eq "default"} {
    set livecheck.name ${name}
}
if {!$has_homepage || ${livecheck.url} eq ${homepage}} {
    set urls [portfetch::get_urls]
    set livecheck.url [lindex $urls 0]
}
if {${livecheck.regex} eq ""} {
    set livecheck.regex [list [strsed $distname "s/[quotemeta 
$version]/(\\\\d+(?:\\\\.\\\\d)+)/"]]
}
set livecheck.type "regex"
_______________________________________________
macports-dev mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macports-dev

Reply via email to