Run check_version and validate_config before to perform any other task.

Asking user confirmation for confuguration options.
This commit is contained in:
Manuel Canales Esparcia 2006-03-12 11:28:15 +00:00
parent 0a7e5d0ebe
commit 13e816f9fc

View file

@ -232,24 +232,6 @@ while test $# -gt 0 ; do
shift shift
done done
# Prevents setting "-d /" by mistake.
if [ $BUILDDIR = / ] ; then
echo -ne "\nThe root directory can't be used to build LFS.\n\n"
exit 1
fi
# If $BUILDDIR has subdirectories like tools/ or bin/, stop the run
# and notify the user about that.
if [ -d $BUILDDIR/tools -o -d $BUILDDIR/bin ] && [ -z $CLEAN ] ; then
eval "$no_empty_builddir"
fi
# If requested, clean the build directory
clean_builddir
# Find the download client to use, if not already specified. # Find the download client to use, if not already specified.
if [ -z $DL ] ; then if [ -z $DL ] ; then
@ -274,6 +256,41 @@ fi
BOOK=${BOOK:=$PROGNAME-$LFSVRS} BOOK=${BOOK:=$PROGNAME-$LFSVRS}
#=================================================== #===================================================
# Check for minumum gcc and kernel versions
#check_requirements 1 # 0/1 0-do not display values.
check_version "2.6.2" "`uname -r`" "KERNEL"
check_version "3.0" "$BASH_VERSION" "BASH"
check_version "3.0" "`gcc -dumpversion`" "GCC"
echo "---------------${nl_}"
validate_config 1 # 0/1 0-do not display values
echo "---------------${nl_}"
echo -n "Are yoy happy with that settings (yes/no) (no): "
read ANSWER
if [ x$ANSWER != "xyes" ] ; then
echo "${nl_}Fix the configuration options and rerun the script.${nl_}"
exit 1
fi
# Prevents setting "-d /" by mistake.
if [ $BUILDDIR = / ] ; then
echo -ne "\nThe root directory can't be used to build LFS.\n\n"
exit 1
fi
# If $BUILDDIR has subdirectories like tools/ or bin/, stop the run
# and notify the user about that.
if [ -d $BUILDDIR/tools -o -d $BUILDDIR/bin ] && [ -z $CLEAN ] ; then
eval "$no_empty_builddir"
fi
# If requested, clean the build directory
clean_builddir
if [[ ! -d $JHALFSDIR ]]; then if [[ ! -d $JHALFSDIR ]]; then
mkdir -pv $JHALFSDIR mkdir -pv $JHALFSDIR
fi fi
@ -293,17 +310,6 @@ fi
>$LOGDIR/$LOG >$LOGDIR/$LOG
echo "---------------${nl_}" echo "---------------${nl_}"
# Check for minumum gcc and kernel versions
#check_requirements 1 # 0/1 0-do not display values.
check_version "2.6.2" "`uname -r`" "KERNEL"
check_version "3.0" "$BASH_VERSION" "BASH"
check_version "3.0" "`gcc -dumpversion`" "GCC"
echo "---------------${nl_}"
validate_config 1 # 0/1 0-do not display values
echo "---------------${nl_}"
get_book get_book
echo "---------------${nl_}" echo "---------------${nl_}"