Changeset 18724 for trunk/base
- Timestamp:
- Jul 25, 2006, 8:05:26 AM (18 years ago)
- Location:
- trunk/base
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/base/doc/portfile.7
r17563 r18724 908 908 .Em regex 909 909 (retrieve the version by applying a regex to some URL resource), 910 .Em regexm 911 (retrieve the version by applying a multi-line regex to some URL resource), 910 912 .Em md5 911 913 (compares the md5 sum of some URL resource) or -
trunk/base/src/port1.0/portlivecheck.tcl
r17563 r18724 2 2 # portlivecheck.tcl 3 3 # 4 # $Id: portlivecheck.tcl,v 1. 7 2006/04/17 21:49:19pguyot Exp $4 # $Id: portlivecheck.tcl,v 1.8 2006/07/25 08:05:26 pguyot Exp $ 5 5 # 6 6 # Copyright (c) 2005-2006 Paul Guyot <pguyot@kallisys.net>, … … 79 79 80 80 switch ${livecheck.check} { 81 "regex" { 81 "regex" - 82 "regexm" { 83 # single and multiline regex 82 84 if {[catch {curl fetch ${livecheck.url} $tempfile} error]} { 83 85 ui_error "cannot check if $portname was updated ($error)" … … 86 88 set chan [open $tempfile "r"] 87 89 set updated -1 88 while {1} { 89 if {[gets $chan line] < 0} { 90 break 91 } 92 set the_re [eval "concat ${livecheck.regex}"] 93 if {[regexp $the_re $line line updated_version]} { 90 set the_re [eval "concat ${livecheck.regex}"] 91 if {${livecheck.check} == "regexm"} { 92 set data [read $chan] 93 if {[regexp $the_re $data data updated_version]} { 94 94 if {$updated_version != ${livecheck.version}} { 95 95 set updated 1 … … 97 97 set updated 0 98 98 } 99 break 99 } 100 } else { 101 while {1} { 102 if {[gets $chan line] < 0} { 103 break 104 } 105 if {[regexp $the_re $line line updated_version]} { 106 if {$updated_version != ${livecheck.version}} { 107 set updated 1 108 } else { 109 set updated 0 110 } 111 break 112 } 100 113 } 101 114 } 115 close $chan 102 116 if {$updated < 0} { 103 117 ui_error "cannot check if $portname was updated (regex didn't match)"
Note: See TracChangeset
for help on using the changeset viewer.