livecheck not finding latest version

Rainer Müller raimue at macports.org
Sun Mar 9 17:07:07 PDT 2008


Simon Ruderich wrote:
> I found another small problem with the livecheck. I have a port in my local
> repository which uses ${name}-${version} as livecheck.version. With the
> current version it gives me the following. First it says it matched and then
> it doesn't.

I can also reproduce the issue with e.g. enblend from the macports port 
tree.

[...]

> I looked into this and the problem is that [rpm-vercomp $upver
> $updated_version] returns -1 if $updated_version is 0 and $upver is something
> like fdm-1.5 which is true before any version is found. It works fine for
> $upvar 1.5.

Hm, you are right. rpm-vercomp just skips any alphabetic characters at 
the begin of the string if they appear in both versions.

> The following patch fixes the problem for me but I'm not sure if it causes any
> other problems. Please check if it works fine.
> 
> --- src/port1.0/portlivecheck.tcl	(revision 34864)
> +++ src/port1.0/portlivecheck.tcl	(working copy)
> @@ -187,7 +187,7 @@
>                      while {[gets $chan line] >= 0} {
>                          if {[regexp $the_re $line matched upver]} {
>                              set foundmatch 1
> -                            if {[rpm-vercomp $upver $updated_version] > 0} {
> +                            if {[rpm-vercomp $upver $updated_version] > 0 || $updated_version == 0} {
>                                  set updated_version $upver
>                              }
>                              ui_debug "The regex matched \"$matched\", extracted \"$upver\""

I committed a similar fix in r34874.

Rainer


More information about the macports-dev mailing list