Forum OpenACS Development: Re: Proposal to make slight adjustments to config.tcl

Collapse
Posted by Joel Aufrecht on
Looks good with one caveat: shouldn't this be part of a changeset that includes the code to load tdom in AOLserver4?
Collapse
Posted by Jeff Davis on
I think we should add the following to 0-acs-init.tcl
if {[string equal {} [info commands domNode]]} { 
    if {[ns_info version] == 3} {
        ns_log Error "0-acs-init.tcl: domNode command not found -- libtdom.so not loaded?"
    } elseif {[ns_info version] > 3} {
        if {[catch {set version [package require tdom]} errmsg]} { 
            ns_log Error "0-acs-init.tcl: error loading tdom: $errmsg" 
        } else {
            foreach {major minor point} [split $version .] { break }
            if {$major == 0 
                && ( $minor < 7 || ($minor == 7 && $point < 8))} { 
                ns_log Error "0-acs-init.tcl: please use tdom version 0.7.8 or greater (you have version $version)"
            }
        }
    }
}
Collapse
Posted by Alfred Werner on
the only thing that would concern me about adding that is that if the next version of tdom was (e.g) 0.8 you would probably get an error that point is unset... I think a little layer of either catches or use regsub to count the dots and then an if branch is necessary.