r2339 - jhalfs/branches/experimental

manuel at linuxfromscratch.org manuel at linuxfromscratch.org
Sun Mar 12 03:28:16 PST 2006


Author: manuel
Date: 2006-03-12 04:28:15 -0700 (Sun, 12 Mar 2006)
New Revision: 2339

Modified:
   jhalfs/branches/experimental/master.sh
Log:
Run check_version and validate_config before to perform any other task.
Asking user confirmation for confuguration options.

Modified: jhalfs/branches/experimental/master.sh
===================================================================
--- jhalfs/branches/experimental/master.sh	2006-03-12 10:37:29 UTC (rev 2338)
+++ jhalfs/branches/experimental/master.sh	2006-03-12 11:28:15 UTC (rev 2339)
@@ -54,7 +54,7 @@
 
 echo -n "Loading masterscript conf..."
 source $COMMON_DIR/config
-[[ $? > 0 ]] && echo "$COMMON_DIR/conf did not load.." && exit 
+[[ $? > 0 ]] && echo "$COMMON_DIR/conf did not load.." && exit
 echo "OK"
 #
 echo -n "Loading config module <$MODULE_CONFIG>..."
@@ -232,24 +232,6 @@
   shift
 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.
 
 if [ -z $DL ] ; then
@@ -264,24 +246,59 @@
 
 #===================================================
 # Set the document location...
-# BOOK is either defined in 
+# BOOK is either defined in
 #   xxx.config
 #   comand line
-#   default 
+#   default
 # If set by conf file leave or cmd line leave it
 # alone otherwise load the default version
 #===================================================
 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
   mkdir -pv $JHALFSDIR
 fi
 
-if [[ "$PWD" != "$JHALFSDIR" ]]; then 
+if [[ "$PWD" != "$JHALFSDIR" ]]; then
   cp -v $COMMON_DIR/makefile-functions $JHALFSDIR/
   if [[ -n "$FILES" ]]; then
-    cp -v $PACKAGE_DIR/$FILES $JHALFSDIR/ 
+    cp -v $PACKAGE_DIR/$FILES $JHALFSDIR/
   fi
   sed 's,FAKEDIR,'$BOOK',' $PACKAGE_DIR/$XSL > $JHALFSDIR/${XSL}
   export XSL=$JHALFSDIR/${XSL}
@@ -293,17 +310,6 @@
 >$LOGDIR/$LOG
 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
 echo "---------------${nl_}"
 




More information about the alfs-log mailing list