#!/bin/bash
# Time-stamp: <2001-11-18 09:34:08 ccurley buildscript>

script=$1

# If the actual script exists, and
if [ -e scripts/$script ]; then

    # echo "Target $script exists"

    # if it is newer than the "cooked" version, or the cooked version
    # does not exist, we add in the SGML source, producing the cooked
    # version.

    if [ scripts/$script -nt scripts/cooked/$script ] || [ ! -e scripts/cooked/$script ] ; then

	echo "rebuilding $script"
	echo -n '<![ CDATA [' > scripts/cooked/$script
	cat scripts/$script >> scripts/cooked/$script
	echo ']]>' >> scripts/cooked/$script

    fi
fi
