# Copyright for the Uniform Repository Service (c) 1995 - 2001, # by Gerald Banon. All rights reserved. # Version 2.1 # checkchange.tcl # Example: # http://$site/checkchange.cgi/$currentRep?lastchange=$lastChange # http://banon-pc.dpi.inpe.br:1905/checkchange.cgi/dpi.inpe.br/banon/1995/09.18.18.50?lastchange=946820050 # PATH_INFO = /dpi.inpe.br/banon/1995/09.18.18.50 proc CheckChange {} { if [catch { global env global referenceTable ;# used by CreateCitedRepositoryList global loCoInRep ;# used by CreateCitedRepositoryList global mirrorHomePageRep ;# defined in FindLanguage (utilities1.tcl) global homePath puts {Content-Type: text/html} puts {} set col ../../../../.. set URLibServiceRepository dpi.inpe.br/banon/1998/08.02.08.56 source ../$col/$URLibServiceRepository/doc/utilities1.tcl source ../$col/$URLibServiceRepository/doc/cgi/mirrorfind-.tcl source $env(DOCUMENT_ROOT)/col/$URLibServiceRepository/auxdoc/.referenceTable.tcl set loCoInRep $env(LOCOINREP) ;# used by CreateCitedRepositoryList # homePath (used in FindLanguage) set homePath $env(DOCUMENT_ROOT) set pathInfo [file split $env(PATH_INFO)] # currentRep regsub -all { } [lrange $pathInfo 1 4] {/} currentRep # Find the language and the language repository foreach {language languageRep1 languageRep2} [FindLanguage $env(LOBIMIREP)] {break} # Find the language and the language repository - end # bgColor, background and bgProperties foreach {bgColor background bgProperties fontTag fontTag2} [GetBg $languageRep1 $language] {break} source ../$col/$languageRep2/doc/mirror/${language}Check.tcl if [info exists env(QUERY_STRING)] { foreach {name value} [split $env(QUERY_STRING) &=] { set cgi([DecodeURL $name]) [DecodeURL $value] } } set lastChange1 $cgi(lastchange) # set seconds [DirectoryMTime $env(DOCUMENT_ROOT)/col/$currentRep/doc] set seconds [RepositoryMTime $currentRep $env(DOCUMENT_ROOT)] set lastChange2 [clock format $seconds -format %Y:%m.%d.%H.%M.%S -gmt 1] if {$lastChange1 == "$lastChange2"} { puts [subst [subst [set ${languageRep2}::warning1]]] } else { puts [subst [subst [set ${languageRep2}::warning2]]] } } m] {puts $m; if 0 {global errorInfo; puts $errorInfo}} }