Changeset 17563 for trunk/base


Ignore:
Timestamp:
Apr 17, 2006, 9:49:19 PM (14 years ago)
Author:
pguyot (Paul Guyot)
Message:

Split livecheck in distcheck and livecheck.

Location:
trunk/base
Files:
1 added
6 edited

Legend:

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

    r17375 r17563  
    871871.Em SystemStarter RCng
    872872.El
    873 .Sh LIVECHECK OPTIONS
     873.Sh DISTCHECK AND LIVECHECK OPTIONS
    874874Darwinports can automatically check if the software has been updated
    875875since the Portfile was modified and if some external changes require
     
    877877and working Portfiles.
    878878.br
    879 The check is two-fold. First, Darwinports checks that the distfile(s)
    880 are still downloadable. Second, a resource is queried to determine
    881 if a newer version of the software is available.
    882 .Bl -tag -width lc
    883 .It Ic livecheck.update_check
     879Two checks are available. With distcheck, Darwinports can check that the
     880distfile(s) are still downloadable and did not change since the portfile
     881was modified.
     882With livecheck, Darwinports can query a resource to determine if a newer
     883version of the software is available.
     884.Bl -tag -width lc
     885.It Ic distcheck.check
     886This option can be used to disable distcheck. It specifies what kind
     887of check should be performed on distfiles:
     888.Em moddate
     889(check if the Portfile is older than the distfile) or
     890.Em none
     891(no check).
     892.br
     893.Sy Type:
     894.Em optional
     895.br
     896.Sy Default:
     897.Em moddate
     898.br
     899.Sy Values:
     900.Em moddate none
     901.It Ic livecheck.check
    884902What kind of check to perform to figure out if the software has been updated.
    885903Can be
     
    934952.Sy Type:
    935953.Em optional
    936 .It Ic livecheck.distfiles_check
    937 What kind of check to perform on distfiles,
    938 .Em moddate
    939 (check if the Portfile is older than the distfile) or
    940 .Em none
    941 (no check).
    942 .br
    943 .Sy Type:
    944 .Em optional
    945 .br
    946 .Sy Default:
    947 .Em moddate
    948 .br
    949 .Sy Values:
    950 .Em moddate none
    951954.It Ic livecheck.md5
    952955md5 sum to use for md5 comparison.
  • trunk/base/src/port/port.1

    r17263 r17563  
    420420.Ar archive
    421421target is called explicitly.
     422.Ss distcheck
     423Check if the distfiles haven't changed and can be fetched.
    422424.Ss livecheck
    423 Check if the distfiles haven't changed and can be fetched, and if the software hasn't been
    424 updated since the Portfile was last modified.
     425Check if the software hasn't been updated since the Portfile was last modified.
    425426.Sh PACKAGING TARGETS
    426427There are also targets for producing installable packages of ports:
  • trunk/base/src/port/port.tcl

    r17207 r17563  
    33exec @TCLSH@ "$0" "$@"
    44# port.tcl
    5 # $Id: port.tcl,v 1.158 2006/03/28 06:50:37 jberry Exp $
     5# $Id: port.tcl,v 1.159 2006/04/17 21:49:18 pguyot Exp $
    66#
    77# Copyright (c) 2002-2006 DarwinPorts organization
     
    21232123        trace           action_target
    21242124        livecheck       action_target
     2125        distcheck       action_target
    21252126
    21262127        archive         action_target
  • trunk/base/src/port1.0/Makefile

    r14467 r17563  
    55        portinstall.tcl portdepends.tcl portdestroot.tcl \
    66        portclean.tcl porttest.tcl portactivate.tcl portsubmit.tcl \
    7         port_autoconf.tcl portstartupitem.tcl porttrace.tcl portlivecheck.tcl
     7        port_autoconf.tcl portstartupitem.tcl porttrace.tcl portlivecheck.tcl \
     8        portdistcheck.tcl
    89
    910SUBDIR=         resources
  • trunk/base/src/port1.0/port.tcl

    r13738 r17563  
    11# et:ts=4
    22# port.tcl
    3 # $Id: port.tcl,v 1.40 2005/08/27 00:07:30 pguyot Exp $
     3# $Id: port.tcl,v 1.41 2006/04/17 21:49:19 pguyot Exp $
    44#
    55# Copyright (c) 2002 Apple Computer, Inc.
     
    4949package require portsubmit 1.0
    5050package require porttrace 1.0
     51package require portdistcheck 1.0
    5152package require portlivecheck 1.0
  • trunk/base/src/port1.0/portlivecheck.tcl

    r17536 r17563  
    22# portlivecheck.tcl
    33#
    4 # $Id: portlivecheck.tcl,v 1.6 2006/04/17 07:06:51 pguyot Exp $
     4# $Id: portlivecheck.tcl,v 1.7 2006/04/17 21:49:19 pguyot Exp $
    55#
    66# Copyright (c) 2005-2006 Paul Guyot <pguyot@kallisys.net>,
     
    4444
    4545# define options
    46 options livecheck.distfiles_check livecheck.url livecheck.update_check livecheck.md5 livecheck.regex livecheck.name livecheck.version
     46options livecheck.url livecheck.check livecheck.md5 livecheck.regex livecheck.name livecheck.version
    4747
    4848# defaults
    49 default livecheck.distfiles_check moddate
    5049default livecheck.url {$homepage}
    51 default livecheck.update_check freshmeat
     50default livecheck.check freshmeat
    5251default livecheck.md5 ""
    5352default livecheck.regex ""
     
    5655
    5756proc livecheck_main {args} {
    58         global livecheck.distfiles_check livecheck.url livecheck.update_check livecheck.md5 livecheck.regex livecheck.name livecheck.version
    59         global fetch.type
     57        global livecheck.url livecheck.check livecheck.md5 livecheck.regex livecheck.name livecheck.version
    6058        global homepage portname portpath workpath
    6159       
     
    6967        ui_debug "Port (livecheck) version is ${livecheck.version}"
    7068
    71         # Check the distfiles if it's a regular fetch phase.
    72         if {"${livecheck.distfiles_check}" != "none"
    73                 && "${fetch.type}" == "standard"} {
    74                 # portfetch 1.0::checkfiles sets fetch_urls list.
    75                 global fetch_urls
    76                 checkfiles
    77                
    78                 # Check all the files.
    79                 foreach {url_var distfile} $fetch_urls {
    80                         global portfetch::$url_var
    81                         if {![info exists $url_var]} {
    82                                 ui_error [format [msgcat::mc "No defined site for tag: %s, using master_sites"] $url_var]
    83                                 set url_var master_sites
    84                                 global portfetch::$url_var
    85                         }
    86                         if {${livecheck.distfiles_check} == "moddate"} {
    87                                 set count 0
    88                                 foreach site [set $url_var] {
    89                                         ui_debug [format [msgcat::mc "Checking %s from %s"] $distfile $site]
    90                                         set file_url [portfetch::assemble_url $site $distfile]
    91                                         if {[catch {set urlnewer [curl isnewer $file_url $port_moddate]} error]} {
    92                                                 ui_warn "couldn't fetch $file_url for $portname ($error)"
    93                                         } else {
    94                                                 if {$urlnewer} {
    95                                                         ui_warn "port $portname: $file_url is newer than portfile"
    96                                                 }
    97                                                 incr count
    98                                         }
    99                                 }
    100                                 if {$count == 0} {
    101                                         ui_error "no mirror had $distfile for $portname"
    102                                 }
    103                         } else {
    104                                 ui_error "unknown livecheck.distfiles_check ${livecheck.distfiles_check}"
    105                                 break
    106                         }
    107                 }
    108         }
    109        
    11069        # Perform the check depending on the type.
    111         if {"${livecheck.update_check}" == "freshmeat"} {
     70        if {"${livecheck.check}" == "freshmeat"} {
    11271                if {![info exists homepage] || [string equal "${livecheck.url}" "${homepage}"]} {
    11372                        set livecheck.url "http://freshmeat.net/projects-xml/${livecheck.name}/${livecheck.name}.xml"
     
    11675                        set livecheck.regex "<latest_release_version>(.*)</latest_release_version>"
    11776                }
    118                 set livecheck.update_check "regex"
     77                set livecheck.check "regex"
    11978        }
    12079       
    121         switch ${livecheck.update_check} {
     80        switch ${livecheck.check} {
    12281                "regex" {
    12382                        if {[catch {curl fetch ${livecheck.url} $tempfile} error]} {
     
    13291                                        }
    13392                                        set the_re [eval "concat ${livecheck.regex}"]
    134                                         puts $the_re
    13593                                        if {[regexp $the_re $line line updated_version]} {
    13694                                                if {$updated_version != ${livecheck.version}} {
     
    172130                }
    173131                default {
    174                         ui_error "unknown livecheck.update_check ${livecheck.update_check}"
     132                        ui_error "unknown livecheck.check ${livecheck.check}"
    175133                }
    176134        }
     
    178136        file delete -force $tempfile
    179137
    180         if {${livecheck.update_check} != "none"} {
     138        if {${livecheck.check} != "none"} {
    181139                if {$updated > 0} {
    182140                        ui_msg "$portname seems to have been updated (port version: ${livecheck.version}, new version: $updated_version)"
Note: See TracChangeset for help on using the changeset viewer.