#!/usr/lib/buildtool/bt_sh
# $Id: sh_head.in,v 1.29 2004/05/08 20:05:19 jmmv Exp $
# Common header for shell scripts, including shared functions.
#
# buildtool
# Copyright (c) 2003, 2004 Julio M. Merino Vidal.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in
#    the documentation and/or other materials provided with the
#    distribution.
# 3. Neither the name of the author nor the names of contributors may
#    be used to endorse or promote products derived from this software
#    without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS''
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
# PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#

ProgName=${0##*/}
LogName=

ConfigFile=
DefsFile=
DocsFile=
LogicFile=

# -------------------------------------------------------------------------

#
# btcmn_err message
#   Show error message on stderr and exit with error status.
#
btcmn_err() {
    local spaces="$(echo ${ProgName} | sed -e 's/./ /g')"

    echo "${ProgName}: $1" 1>&2
    shift
    while [ $# -gt 0 ]; do
        echo "${spaces}  $1" 1>&2
        shift
    done
    exit 1
}

# -------------------------------------------------------------------------

#
# btcmn_warn message
#   Show warning message on stderr.
#
btcmn_warn() {
    local spaces="$(echo ${ProgName} | sed -e 's/./ /g')"

    echo "${ProgName}: $1" 1>&2
    shift
    while [ $# -gt 0 ]; do
        echo "${spaces}  $1" 1>&2
        shift
    done
}

# -------------------------------------------------------------------------

#
# btcmn_log_start name
#    Open the given log file and add a header to it for the current
#    session.
#
btcmn_log_start() {
    LogName=$1
    [ -f ${LogName} ] && echo >> ${LogName}
    echo "-------------------------------------------------------------------------" >> ${LogName} # NOLINT
    echo "LOG STARTED FOR MODULE ${ProgName} ON $(date)" >> ${LogName}
    echo >> ${LogName}
}

# -------------------------------------------------------------------------

#
# btcmn_log_name
#    Get the current log name.
#
btcmn_log_name() {
    echo ${LogName}
}

# -------------------------------------------------------------------------

#
# btcmn_log_msg text
#    Append the given message to the log file.
#
btcmn_log_msg() {
    echo $* >> ${LogName}
}

# -------------------------------------------------------------------------

#
# btcmn_req_project
#   Check if we are executing Buildtool inside a buildtoolized project.
#   If so, set BT_TOPDIR to its top directory, set all *File variables
#   pointing to the right script, check if the current Buildtool version
#   is enough to work with this project and automatically source the defs
#   block.  The function does not return if the check fails.
#
btcmn_req_project() {
    local major minor oldpwd

    config() {
        btcmn_err "no config() function defined; cannot continue."
    }

    defs() {
        btcmn_err "no defs() function defined; cannot continue."
    }

    docs() {
        btcmn_err "no docs() function defined; cannot continue."
    }

    oldpwd=$(pwd)
    BT_TOPDIR=
    while [ -z "${BT_TOPDIR}" -a $(pwd) != / ]; do
        if [ -f Generic.bt -o -f Defs.bt ]; then
            BT_TOPDIR=$(pwd)
        else
            cd ..
        fi
    done
    [ -z "${BT_TOPDIR}" ] &&
        btcmn_err \
            "this module needs to be run from inside a Buildtool project"

    if [ -f Config.bt ]; then
        ConfigFile=${BT_TOPDIR}/Config.bt
    else
        ConfigFile=${BT_TOPDIR}/Generic.bt
    fi

    if [ -f Defs.bt ]; then
        DefsFile=${BT_TOPDIR}/Defs.bt
    else
        DefsFile=${BT_TOPDIR}/Generic.bt
    fi

    if [ -f Docs.bt ]; then
        DocsFile=${BT_TOPDIR}/Docs.bt
    else
        DocsFile=${BT_TOPDIR}/Generic.bt
    fi

    if [ -f Logic.bt ]; then
        LogicFile=${BT_TOPDIR}/Logic.bt
    else
        LogicFile=${BT_TOPDIR}/Generic.bt
    fi

    cd ${oldpwd}

    [ -f Logic.bt ] && LogicFile=$(pwd)/Logic.bt

    BT_REQUIRE=
    . ${DefsFile}
    defs
    if [ -z "${BT_REQUIRE}" ]; then
        btcmn_err "broken package; does not define BT_REQUIRE"
    fi

    major=$(echo ${BT_REQUIRE} | cut -d . -f 1)
    minor=$(echo ${BT_REQUIRE} | cut -d . -f 2)

    [ ${major} -ne 0 -a ${major} -ne 0 ] && \
        btcmn_err "this package requires the Buildtool ${major}.x branch"
    [ ${minor} -gt 16 ] && \
        btcmn_err "this package requires Buildtool ${BT_REQUIRE}"
}

# -------------------------------------------------------------------------

#
# btcmn_req_config
#   Check for the presence of the config script and source it if found.
#   Does not return if the file is not found.
#
btcmn_req_config() {
    [ ! -f ${ConfigFile} ] && btcmn_err "cannot open ${ConfigFile}"
    config_init() { return 0; }
    config() { return 0; }
    . ${ConfigFile}
}

# -------------------------------------------------------------------------

#
# btcmn_req_defs
#   Check for the presence of the defs script and source it if found.
#   Does not return if the file is not found.
#
btcmn_req_defs() {
    [ ! -f ${DefsFile} ] && btcmn_err "cannot open ${DefsFile}"
    defs() { return 0; }
    . ${DefsFile}
}

# -------------------------------------------------------------------------

#
# btcmn_req_docs
#   Check for the presence of the docs script and source it if found.
#   Does not return if the file is not found.
#
btcmn_req_docs() {
    [ ! -f ${DocsFile} ] && btcmn_err "cannot open ${DocsFile}"
    docs() { return 0; }
    . ${DocsFile}
}

# -------------------------------------------------------------------------

#
# btcmn_req_logic
#   Check for the presence of the logic script and source it if found.
#   Does not return if the file is not found.
#
btcmn_req_logic() {
    [ ! -f ${LogicFile} ] && btcmn_err "cannot open ${LogicFile}"
    logic() { return 0; }
    . ${LogicFile}
}

# -------------------------------------------------------------------------

#
# btcmn_req_runtime
#   Check if we were executed by the main buildtool wrapper program.
#
btcmn_req_runtime() {
    if [ ${__BUILDTOOL:-no} != yes ]; then
        btcmn_err "this program must be run through Buildtool"
    fi
}

# -------------------------------------------------------------------------

#
# btcmn_run_module module [args]
#   Execute the given module passing all extra arguments to it.
#
btcmn_run_module() {
    local module="$1"; shift

    case ${module} in
        config)
            btcmn_req_project
            __BUILDTOOL=yes /usr/lib/buildtool/bt_sh ${BT_SH_FLAGS} \
                /usr/lib/buildtool/bt_config ${BT_PKG_CONFIG_FLAGS} "$@"
            ;;
        dist)
            btcmn_req_project
            __BUILDTOOL=yes /usr/lib/buildtool/bt_sh ${BT_SH_FLAGS} \
                /usr/lib/buildtool/bt_dist ${BT_PKG_DIST_FLAGS} "$@"
            ;;
        doc)
            btcmn_req_project
            __BUILDTOOL=yes /usr/lib/buildtool/bt_sh ${BT_SH_FLAGS} \
                /usr/lib/buildtool/bt_doc ${BT_PKG_DOC_FLAGS} "$@"
            ;;
        lint)
            btcmn_req_project
            __BUILDTOOL=yes /usr/lib/buildtool/bt_sh ${BT_SH_FLAGS} \
                /usr/lib/buildtool/bt_lint ${BT_PKG_LINT_FLAGS} "$@"
            ;;
        logic)
            btcmn_req_project
            __BUILDTOOL=yes /usr/lib/buildtool/bt_sh ${BT_SH_FLAGS} \
                /usr/lib/buildtool/bt_logic ${BT_PKG_LOGIC_FLAGS} "$@"
            ;;
        pkgflags)
            __BUILDTOOL=yes /usr/lib/buildtool/bt_sh ${BT_SH_FLAGS} \
                /usr/lib/buildtool/bt_pkgflags "$@"
            ;;
        swcgen)
            __BUILDTOOL=yes /usr/lib/buildtool/bt_sh ${BT_SH_FLAGS} \
                /usr/lib/buildtool/bt_swcgen "$@"
            ;;
        wizard)
            __BUILDTOOL=yes /usr/lib/buildtool/bt_sh ${BT_SH_FLAGS} \
                /usr/lib/buildtool/bt_wizard "$@"
            ;;
        *)
            btcmn_err "no such module \`${module}' (internal error)"
            ;;
    esac
}

# -------------------------------------------------------------------------

# Local Variables: ***
# mode: shell-script ***
# End: ***
# vim: syntax=sh
#
# $Id: frontend.in,v 1.23 2004/02/03 22:59:11 jmmv Exp $
# bt_wizard's frontend.
#
# buildtool
# Copyright (c) 2003, 2004 Julio M. Merino Vidal.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in
#    the documentation and/or other materials provided with the
#    distribution.
# 3. Neither the name of the author nor the names of contributors may
#    be used to endorse or promote products derived from this software
#    without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS''
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
# PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#

usage() {
    local exitstat=$1

    cat 1>&2 <<EOF
buildtool version 0.16 - ${ProgName} module
usage: ${ProgName} [options]

Available options:
    {-a,--automatic}         Run in non-interactive mode.
    {-d ,--dir=}value        Directory where files are created (${AnsDir}).
    {-h,--help}              Show this help message.
    {-n ,--name=}value       Set project name to \`name' (${AnsName}).
    {-v ,--version=}value    Set project version to \`version' (${AnsVersion}).
EOF

    exit ${exitstat}
}

question() {
    local var="$1" msg="$2"
    local default tmp

    eval default=\"\$${var}\"
    echo -n "${msg} [${default}]? "
    read tmp
    eval ${var}=\"${tmp:-${default}}\"
}

createfile() {
    local name="$1"
    echo -n "Creating $1..."
    rm -f $1
    touch $1
    [ ${AnsCVS} = y ] && echo "# \$Id\$" >> $1 # NOLINT
}

interactive() {
    clear
    cat <<EOF
Welcome to Buildtool's Wizard
-----------------------------

This module will help you to set up a basic directory structure
for your project, based on your choices.

Each question has associated a default answer, shown inside the
brackets.  If you hit [RETURN] leaving a question in blank, it
will take the default value.

EOF

    echo "Project definitions:"
    question AnsName "- Unix name"
    question AnsVersion "- Initial version"
    question AnsLicense "- License"
    question AnsMaintainer "- Maintainer's email"
    question AnsHomepage "- Homepage (if any)"
    question AnsComment "- Short comment"

    echo
    echo "Code details:"
    question AnsIsProg "- Will this package provide one or more programs"
    question AnsIsLib "- Will this package provide one or more libraries"
    question AnsC "- Will you use the C language"
    question AnsCXX "- Will you use the C++ language"
    question AnsCVS "- Will you use CVS"

    echo
    echo "Dependancies:"
    question AnsPkgconfig "- Do you need pkgconfig (not bt_pkgflags)"
    question AnsThreads "- Do you need threads"
    question AnsX11 "- Do you need an X Window System"
    question AnsAwk "- Do you need awk"
    question AnsLex "- Do you need a lexical analyzer"
    question AnsYacc "- Do you need a LARL parser generator"

    echo
    echo "Begin process:"
    question AnsDir "- Where should files be created"

    echo
}

main() {
    local automatic blankline dirs

    btcmn_req_runtime

    # ------------------------------------------------------------------------
    # Set default values
    # ------------------------------------------------------------------------

    : ${AnsName:=foobar}
    : ${AnsVersion:=0.1}
    : ${AnsLicense:=bsd}
    : ${AnsMaintainer:=foo@bar.net}
    : ${AnsHomepage:=}
    : ${AnsComment:=Sample package}

    : ${AnsIsProg:=y}
    : ${AnsIsLib:=n}
    : ${AnsC:=y}
    : ${AnsCXX:=n}
    : ${AnsCVS:=y}

    : ${AnsPkgconfig:=n}
    : ${AnsThreads:=n}
    : ${AnsX11:=n}
    : ${AnsAwk:=n}
    : ${AnsLex:=n}
    : ${AnsYacc:=n}

    : ${AnsDir:=.}

    # ------------------------------------------------------------------------
    # Command line parsing
    # ------------------------------------------------------------------------

    automatic=no

    while [ $# -gt 0 ]; do
        case $1 in
            -a|--automatic)
                automatic=yes
                ;;
            -d)
                if [ -z "$2" ]; then
                    btcmn_warn "missing argument for \`-d' option"
                    usage 1
                fi
                AnsDir="$2"; shift
                ;;
            --dir=*)
                AnsDir=$(echo $1 | sed -e 's/--dir=//')
                ;;
            -h|--help)
                usage 0
                ;;
            -n)
                if [ -z "$2" ]; then
                    btcmn_warn "missing argument for \`-n' option"
                    usage 1
                fi
                AnsName="$2"; shift
                ;;
            --name=*)
                AnsName=$(echo $1 | sed -e 's/--name=//')
                ;;
            -v)
                if [ -z "$2" ]; then
                    btcmn_warn "missing argument for \`-v' option"
                    usage 1
                fi
                AnsVersion="$2"; shift
                ;;
            --version=*)
                AnsVersion=$(echo $1 | sed -e 's/--version=//')
                ;;
            --)
                shift; break
                ;;
            *)
                if echo $1 | grep ^- >/dev/null; then
                    btcmn_warn "unknown option \`$1'"
                else
                    btcmn_warn "extra argument \`$1'"
                fi
                usage 1
                ;;
        esac
        shift
    done

    [ ${automatic} = no ] && interactive

    # ------------------------------------------------------------------------
    # Create directories
    # ------------------------------------------------------------------------

    if [ ${AnsDir} != . ]; then
        echo -n "Entering directory ${AnsDir}..."
        mkdir -p ${AnsDir}
        cd ${AnsDir}
        echo " done."
    fi

    echo -n "Creating directories..."

    if [ ${AnsIsProg} != n ]; then
        echo -n " src"
        mkdir -p src
    fi
    if [ ${AnsIsLib} != n ]; then
        echo -n " data"
        mkdir -p data
        echo -n " lib"
        mkdir -p lib
    fi

    echo

    # ------------------------------------------------------------------------
    # Create definitions file
    # ------------------------------------------------------------------------

    createfile Generic.bt

    cat >> Generic.bt <<EOF
#
# Buildtool Generic Script
#

defs() {
    BT_REQUIRE="0.16"

    BT_PKG_NAME="${AnsName}"
    BT_PKG_VERSION="${AnsVersion}"
    BT_PKG_LICENSE="${AnsLicense}"

    BT_PKG_MAINTAINER="${AnsMaintainer}"
EOF

    if [ -n "${AnsHomepage}" ]; then
        echo "    BT_PKG_HOMEPAGE=\"${AnsHomepage}\"" >> Generic.bt
    fi

    cat >> Generic.bt <<EOF
    BT_PKG_COMMENT="${AnsComment}"
}
EOF

    # ------------------------------------------------------------------------
    # Create configuration script
    # ------------------------------------------------------------------------

    echo >> Generic.bt
    echo "config_init() {" >> Generic.bt

    [ ${AnsPkgconfig} = y ] && echo "    bt_subrload pkgconfig" >> Generic.bt
    [ ${AnsThreads} = y ] && echo "    bt_subrload pthread" >> Generic.bt
    [ ${AnsX11} = y ] && echo "    bt_subrload x11" >> Generic.bt

    echo "}" >> Generic.bt
    echo >> Generic.bt
    echo "config() {" >> Generic.bt

    [ ${AnsC} = y ] && echo "    bt_check_env_c" >> Generic.bt
    [ ${AnsCXX} = y ] && echo "    bt_check_env_cxx" >> Generic.bt

    echo >> Generic.bt

    blankline=no
    if [ ${AnsAwk} = y ]; then
        echo "    bt_check_prog_awk" >> Generic.bt
        blankline=yes
    fi
    if [ ${AnsLex} = y ]; then
        echo "    bt_check_prog_lex" >> Generic.bt
        blankline=yes
    fi
    if [ ${AnsYacc} = y ]; then
        echo "    bt_check_prog_yacc" >> Generic.bt
        blankline=yes
    fi
    if [ ${blankline} = yes ]; then
        echo >> Generic.bt
    fi

    if [ ${AnsThreads} = y ]; then
        echo "    pthread_check" >> Generic.bt
        echo >> Generic.bt
    fi

    if [ ${AnsIsLib} = y ]; then
        echo "    bt_generate_output data/${AnsName}.bpf" >> Generic.bt
    fi
    if [ ${AnsC} = y -o ${AnsCXX} = y ]; then
        echo "    bt_generate_configh" >> Generic.bt
    fi

    echo "}" >> Generic.bt

    # ------------------------------------------------------------------------
    # Create documentation
    # ------------------------------------------------------------------------

    cat >> Generic.bt <<EOF

docs() {
    bt_doc CHANGES "Major changes between package versions"
    bt_doc PEOPLE "Authors and contributors"
    bt_doc README "General documentation"
    bt_doc TODO "Missing things"
}
EOF

    # ------------------------------------------------------------------------
    # Top directory logic
    # ------------------------------------------------------------------------

    dirs=
    [ ${AnsIsLib} = y ] && dirs="${dirs} lib data"
    [ ${AnsIsProg} = y ] && dirs="${dirs} src"

    cat >> Generic.bt <<EOF

logic() {
    bt_target ${dirs}
}
EOF

    echo " done."

    echo -n "Creating README.bt..."
    cp /usr/share/buildtool/templates/README.bt .
    echo " done."

    # ------------------------------------------------------------------------
    # Program directory.
    # ------------------------------------------------------------------------

    if [ ${AnsIsProg} = y ]; then
        createfile src/Logic.bt

        cat >> src/Logic.bt <<EOF

logic() {
    bt_target ${AnsName}

    target_${AnsName}() {
        BT_MANPAGES="${AnsName}.1"
        BT_SOURCES=main.c
        BT_TYPE=program
    }
}
EOF

        echo " done."
    fi

    # ------------------------------------------------------------------------
    # Library directory.
    # ------------------------------------------------------------------------

    if [ ${AnsIsLib} = y ]; then
        createfile lib/Logic.bt

        cat >> lib/Logic.bt <<EOF

logic() {
    bt_target ${AnsName}

    target_${AnsName}() {
        BT_LIB_MAJOR=0
        BT_LIB_MINOR=1
        BT_MANPAGES="${AnsName}.1"
        BT_SOURCES=func1.c
        BT_TYPE=library

        BT_INCLUDESDIR="\${BT_DIR_INC}/${AnsName}"
        BT_INCLUDESDIR_${AnsName}_h="\${BT_DIR_INC}"
        BT_INCLUDES="${AnsName}.h"
    }
}
EOF

        echo " done."
    fi

    # ------------------------------------------------------------------------
    # Fill data directory.
    # ------------------------------------------------------------------------

    if [ ${AnsIsLib} = y ]; then
        echo -n "Creating data/${AnsName}.bpf.in..."
        cp /usr/share/buildtool/templates/pkgflags data/${AnsName}.bpf.in
        echo " done."

        createfile data/Logic.bt
        cat >> data/Logic.bt <<EOF

logic() {
    bt_target ${AnsName}.bpf

    target_${AnsName}.bpf_install() {
        bt_install_dir \${BT_DIR_PKGFLAGS}
        bt_install_data ${AnsName}.bpf \${BT_DIR_PKGFLAGS}
    }

    target_${AnsName}.bpf_deinstall() {
        bt_remove \${BT_DIR_PKGFLAGS}/${AnsName}.bpf
        rmdir \${BT_DIR_PKGFLAGS} >/dev/null 2>&1 || true
    }
}
EOF
        echo " done."
    fi

    return 0
}

# Local Variables: ***
# mode: shell-script ***
# End: ***
# vim: syntax=sh
#
# $Id: sh_tail.in,v 1.3 2003/09/23 16:40:23 jmmv Exp $
# Common footer for shell scripts.
#
# buildtool
# Copyright (c) 2003 Julio M. Merino Vidal.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in
#    the documentation and/or other materials provided with the
#    distribution.
# 3. Neither the name of the author nor the names of contributors may
#    be used to endorse or promote products derived from this software
#    without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS''
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
# PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#

main "$@"

# Local Variables: ***
# mode: shell-script ***
# End: ***
# vim: syntax=sh
