# # $Id: frontend.in,v 1.18 2003/09/23 16:40:24 jmmv Exp $ # bt_dist's frontend. # # buildtool # Copyright (c) 2002, 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 curbase curdir fmt workcopy btcmn_req_runtime btcmn_req_project # Clean the source tree if [ -f ./bt_config.env ]; then echo "${ProgName}: cleaning tree (cleandir)" btcmn_run_module logic -s cleandir fi # Validate package first echo "${ProgName}: validating package" btcmn_run_module lint if [ $? -eq 1 ]; then btcmn_err "cannot continue; fix FATAL errors and retry" fi if [ -z "${BT_PKG_DISTFMTS}" ]; then BT_PKG_DISTFMTS=tar.gz else BT_PKG_DISTFMTS=$(echo ${BT_PKG_DISTFMTS} | swcase -l) fi curdir=$(pwd) curbase=${curdir##*/} workcopy=no if [ -d CVS ]; then workcopy=yes cd .. if [ -e ${curbase}.copy ]; then btcmn_err "../${curbase}.copy exists; cannot continue" fi echo "This package uses CVS; simulating \`cvs export'..." cp -rf ${curbase} ${curbase}.copy cd ${curbase}.copy find . -name CVS -exec rm -rf \{\} \; 2>/dev/null fi for fmt in ${BT_PKG_DISTFMTS}; do if is_compressed ${fmt}; then make_compressed ${fmt} else btcmn_warn "unrecognized ${fmt} dist format" fi done if [ ${workcopy} = yes ]; then cd .. rm -rf ${curbase}.copy fi return 0 } # Local Variables: *** # mode: shell-script *** # End: *** # vim: syntax=sh