[48265] trunk/base/src/port1.0/portlivecheck.tcl

Bryan Blackburn blb at macports.org
Tue Mar 17 19:07:30 PDT 2009


On Tue, Mar 17, 2009 at 06:06:46PM -0700, Perry Lee said:
> On Mar 17, 2009, at 5:49 PM, David Evans wrote:
>> livecheck.name GIMP
>> livecheck.name XVid
>> livecheck.name XSane
>>
>> But it would be more elegant if it could be done automatically.
>
> Index: src/port1.0/portlivecheck.tcl
> ===================================================================
> --- src/port1.0/portlivecheck.tcl       (revision 48265)
> +++ src/port1.0/portlivecheck.tcl       (working copy)
> @@ -199,7 +199,7 @@
>                     set updated_version 0
>                     set foundmatch 0
>                     while {[gets $chan line] >= 0} {
> -                        if {[regexp $the_re $line matched upver]} {
> +                        if {[regexp -nocase $the_re $line matched  
> upver]} {
>                             set foundmatch 1
>                             if {$updated_version == 0 || [rpm-vercomp  
> $upver $updated_version] > 0} {
>                                 set updated_version $upver
>
> With the above change, livecheck works with the examples you've listed  
> (i.e., you don't need to change their livecheck.names). Are there any  
> negative repercussions for ignoring case in livecheck, though?

So the main problem is that freshmeat changed the format such that we now
have to look for "<title>${livecheck.name}</title>" instead of simply
<latest_release_version>, hence livecheck.name now being a big issue?

If so, we can limit the case-insensitivity to just the freshmeat regex by
instead using


@@ -126,7 +126,7 @@
                 set livecheck.url "http://freshmeat.net/projects/${livecheck.name}/releases.atom"
             }
             if {${livecheck.regex} eq ""} {
-                set livecheck.regex [list "<title>${livecheck.name} (.*)</title>"]
+                set livecheck.regex [list "(?i)<title>${livecheck.name} (.*)</title>"]
             }
             set livecheck.check "regex"
         }


For long-term, I've filed #18889 to push some of this into dports/_resources
so it wouldn't require a complete MacPorts release to update:

<http://trac.macports.org/ticket/18889>

Bryan



More information about the macports-dev mailing list