#!/bin/sh  
# \
exec oagtclsh "$0" "$@"

#
# $Log: not supported by cvs2svn $
#
# 

set auto_path [linsert $auto_path 0  /usr/local/oag/apps/lib/$env(HOST_ARCH)]
set auto_path [linsert $auto_path 0 /usr/local/oag/lib_patch/$env(HOST_ARCH)]

APSStandardSetup

set args $argv
if {$argc != 2} {
    puts stderr "usage: $argv0 -installDirectory <dir>"
    exit 1
}
set installDirectory .
APSParseArguments {installDirectory}

#
# Submit a log message with users installation comments
#
proc logInstall {destDir comments} {
    global env argv0
    global apsScriptUser
    set sourceId appInstallComments

    set logCmd "logMessage -sourceId=$sourceId -tag=installDirectory $destDir -tag=user $apsScriptUser -tag=Comments \"$comments\""

    if {[catch "exec $logCmd" res]} {
	puts stderr " *** Error: Can't log install comments: $res"
	return -1
    } 
    return 0
}

# 
# Prompt user for comments
#
puts "Please enter the purpose of your install (or return for none):"
set comment [gets stdin]

if [string length $comment] {
    logInstall $installDirectory $comment
}


exit 0



