set SCO_CONVERTCF_MSGS(@catalog@) {convertcf.cat@mail 1}
set SCO_CONVERTCF_MSGS(ERR_USAGE) {1 {Usage: convertcf <file>\n This script converts the sendmail configuration file,\n pathname specified by argument <file>, to the latest\n version.}}
set SCO_CONVERTCF_MSGS(ERR_DETERMINE) {2 {Error: unable to determine version of %1$s}}
set SCO_CONVERTCF_MSGS(ERR_FILENAME) {3 {Error: %1$s non-existent, non-regular, or unreadable}}
set SCO_CONVERTCF_MSGS(ERR_ERROR) {4 {Error: %1$s}}
set SCO_CONVERTCF_MSGS(ERR_UNSUPPORTED) {5 {Error: cannot convert %1$s: %2$s is not a supported version}}
set LATEST "UW7.0.1"
set VALIDVERS [list SCO5 $LATEST]
proc \
usage {} \
{
puts [intlerr USAGE]
_exit 1
}
proc \
cleanup {} \
{
global catHandle
if {"$catHandle" != ""} {
catclose $catHandle
}
return
}
proc \
_exit { exitval } \
{
cleanup
exit $exitval
}
proc \
getmsg {messageId argList} \
{
global catHandle
set msgSepIdx [string first _MSG_ $messageId]
set errSepIdx [string first _ERR_ $messageId]
if {$msgSepIdx < 0} {
set sepIdx $errSepIdx
} else {
if {$errSepIdx < 0} {
set sepIdx $msgSepIdx
} else {
set sepIdx [min $msgSepIdx $errSepIdx]
}
}
if {$sepIdx <= 0} {
error "Invalid message ID `$messageId'"
}
set modId [csubstr $messageId 0 $sepIdx]
set msgName [csubstr $messageId [expr $sepIdx+1] end]
upvar #0 "${modId}_MSGS" moduleDecls
if {![info exists moduleDecls]} {
auto_load "${modId}_MSGS"
}
append msgEntryVar moduleDecls "(" $msgName ")"
if {![info exists $msgEntryVar]} {
error "Unknown message ID `$messageId'"
}
append msgCatalogVar moduleDecls "(@catalog@)"
set msgEntry [concat [set $msgCatalogVar] [set $msgEntryVar]]
if { "$catHandle" == "" } {
set catHandle [catopen [lindex $msgEntry 0]]
}
set str [catgets $catHandle [lindex $msgEntry 1] \
[lindex $msgEntry 2] [lindex $msgEntry 3]]
return [eval format [list [cexpand $str]] $argList]