# # $Id: frontend.in,v 1.14 2003/09/25 18:08:01 jmmv Exp $ # Generate system wide cache files for bt_config. # # 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. # InFile="@DIR_CONF@/bt_config.conf.in" OutFile="@DIR_CONF@/bt_config.conf" TmpDir=/tmp/bt_swcgen.$$ usage() { local exitstat=$1 cat 1>&2 <&2 echo " ${InFile}" 1>&2 echo "To get started, copy and modify the sample file located in:" 1>&2 echo " @DIR_SHARE@/templates/bt_config.conf.in" 1>&2 btcmn_err "cannot open ${InFile}" fi echo "Input: ${InFile}" echo "Output: ${OutFile}" echo echo "${ProgName}: running bt_wizard to create temporary project skeleton" btcmn_run_module wizard -a -n bt_swcgen -v @VERSION@ -d ${TmpDir} echo "${ProgName}: generating configuration script and cache" generate_out_conf ${InFile} ${TmpDir}/conf.in generate_out_script ${InFile} ${TmpDir}/Config.bt ( cd ${TmpDir} && btcmn_run_module config --ignore-sw-config \ --dir-etc=@DIR_CONF@ --enable-developer ) if [ $? -ne 0 ]; then btcmn_err "configuration failed; check the ${TmpDir}/bt_config.log log file for details." # NOLINT fi echo "${ProgName}: creating system wide configuration file" ${TmpDir}/bt_output ${TmpDir}/conf cp ${TmpDir}/conf ${OutFile} echo "${ProgName}: ${OutFile} created" rm -rf ${TmpDir} cat << EOF =========================================================================== PLEASE NOTE THE FOLLOWING: Installed: ${OutFile} By using a system wide configuration file for bt_config that stores check results, you assume that they may get obsoleted with respect to your system, specially after software updates. Be careful to only store results that are unlikely to change with time. Anyway, you are encouraged to re-run this program periodically to regenerate the file with new results. If a third party program fails to configure after a check that shows the \`(cached)' string in it, try to pass the \`--ignore-sw-config' flag to bt_config before thinking it is a bug in your system or in the package. DO NOT DISTURB SOFTWARE AUTHORS BEFORE DOUBLE CHECKING THAT THERE IS A PROBLEM IN THEIR SOFTWARE. YOU HAVE BEEN WARNED. =========================================================================== EOF return 0 } # Local Variables: *** # mode: shell-script *** # End: *** # vim: syntax=sh