#! /bin/sh base=${PREFIX}/etc/cvsup variables="user group host host_crypto interval maxclients facility distribs" ask() { local question default answer question=$1 default=$2 if [ -z "${PACKAGE_BUILDING}" ]; then read -p "${question} [${default}]? " answer fi if [ x${answer} = x ]; then answer=${default} fi echo ${answer} } yesno() { local dflt question answer question=$1 dflt=$2 while :; do answer=$(ask "${question}" "${dflt}") case "${answer}" in [Yy]*) return 0;; [Nn]*) return 1;; esac echo "Please answer yes or no." done } ask_distrib() { local desc dflt link dir subdir link=$1 dflt=$2 subdir=$3 desc=$4 if yesno "Do you wish to mirror the ${desc}" y; then if [ "${subdir}" != "." ]; then cat </dev/null 2>&1; then break fi echo "Please answer with a number" done #------------------------------------------------------------------------------ echo "" echo -n "Building the \"config.sh\" file ... " for var in ${variables}; do eval echo ${var}=\\\"\${${var}}\\\" done > ${WRKSRC}/config.sh echo "Done."