Index: BLFS/TODO
===================================================================
--- BLFS/TODO	(revision 00f4966aa31511c31e5fbddd84388cf436cb4eb9)
+++ BLFS/TODO	(revision 2fedf493f4421b58d048954d6a714857dd3178a6)
@@ -12,26 +12,20 @@
 What remains to do:
 
-1. - To make the top-level blfs script functional. That script should to create
-       the working directory (selected at command line)
-     a. Copy all BLFS/* files to it,
-     b. Fetch the BLFS sources (output directory selected at command line or
-          based on the book version),
-     c. Run the packages.sh script.
+--   To review the XSL code needed to create the build scripts.
+     A lot of book-versus-scripts and testing is needed.
+     We need yet to figure out if we can to to handle Perl modules installation
+     and other pages that have commands to install more that one package
+     (e.g., Gnat in GCC Java-bin in Java, sane-backends and sane-frontends
+     in Sane, etc) or not-estandart installations, like Xorg7
 
-2. - To develop the XSL code needed to create the build scripts.
-     Almost done. A lot of book-versus-scripts and testing is needed.
-     We need yet to figure out how to handle Perl modules installation and
-     other pages that have commands to install more that one package
-     (e.g., Gnat in GCC Java-bin in Java, sane-backends and sane-frontends
-     in Sane, etc)
+--   Test the method used to track already installed packages by previous runs.
+     See if the packages version can be watched also.
 
-3. - To develop the code to create the Makefile.
-     Should be a separate script to be run manually after the user has
-     review and edited the target build scripts.
-     Must make the build scripts executables and set the SRC_ARCHIVE and
-     FTP_SERVER envars.
-     Work in progress.
+--   Integrate the menuconfig based package selection, trying to make use of the
+     installed packages traking system.
 
-4. - To find a way to track already installed packages by previous runs, to can
-       skip them when creating the book/scripts/Makefile for a new target.
+--   Bugs hunting.
 
+--   Improve README.BLFS.
+
+--   Develop a script to make cofee.
Index: BLFS/envars.conf
===================================================================
--- BLFS/envars.conf	(revision 2fedf493f4421b58d048954d6a714857dd3178a6)
+++ BLFS/envars.conf	(revision 2fedf493f4421b58d048954d6a714857dd3178a6)
@@ -0,0 +1,28 @@
+#####
+#
+# Configuration file for the BLFS module
+#
+# $Id$
+#
+# Set default envars used in the build scripts
+#
+#####
+
+
+#--- The local repository for packages/file
+#    Any missing file will be downloaded and archived here,
+#    if the user has the right priviledges.
+export SRC_ARCHIVE=$SRC_ARCHIVE
+
+#--- Server used if the file isn't found in SRC_ARCHIVE.
+# As a last resort, the file will dowloaded from upstream, if possible.
+#
+# The server path MUST be set as listed in
+# http://www.linuxfromscratch.org/blfs/download.html
+export FTP_SERVER=ftp://anduin.linuxfromscratch.org/BLFS/
+
+
+#--- The sources directory.
+#    Full path to the top level directory where packages will be stored,
+#    unpacked, and compiled.
+export SRC_DIR=$HOME/sources
Index: BLFS/gen-makefile.sh
===================================================================
--- BLFS/gen-makefile.sh	(revision 00f4966aa31511c31e5fbddd84388cf436cb4eb9)
+++ BLFS/gen-makefile.sh	(revision 2fedf493f4421b58d048954d6a714857dd3178a6)
@@ -41,5 +41,5 @@
 (
 cat << EOF
-	@source ../makefile.conf && ${BUILD_SCRIPTS}/\$@ >logs/\$@ 2>&1
+	@source ../envars.conf && ${BUILD_SCRIPTS}/\$@ >logs/\$@ 2>&1
 EOF
 ) >> $MKFILE.tmp
Index: BLFS/libs/scripts.xsl
===================================================================
--- BLFS/libs/scripts.xsl	(revision 00f4966aa31511c31e5fbddd84388cf436cb4eb9)
+++ BLFS/libs/scripts.xsl	(revision 2fedf493f4421b58d048954d6a714857dd3178a6)
@@ -98,5 +98,5 @@
             <xsl:text>&#xA;PKG_DIR=</xsl:text>
             <xsl:value-of select="$ftpdir"/>
-            <xsl:text>&#xA;&#xA;</xsl:text>
+            <xsl:text>&#xA;SRC_DIR=$SRC_DIR&#xA;&#xA;</xsl:text>
             <!-- Download code and build commands -->
             <xsl:apply-templates select="sect2">
@@ -105,5 +105,5 @@
             </xsl:apply-templates>
             <!-- Clean-up -->
-            <xsl:text>cd ~/sources/$PKG_DIR&#xA;</xsl:text>
+            <xsl:text>cd $SRC_DIR/$PKG_DIR&#xA;</xsl:text>
             <xsl:text>rm -rf $UNPACKDIR unpacked&#xA;&#xA;</xsl:text>
           </xsl:when>
@@ -126,6 +126,6 @@
     <xsl:choose>
       <xsl:when test="@role = 'package'">
-        <xsl:text>mkdir -p ~/sources/$PKG_DIR&#xA;</xsl:text>
-        <xsl:text>cd ~/sources/$PKG_DIR&#xA;</xsl:text>
+        <xsl:text>mkdir -p $SRC_DIR/$PKG_DIR&#xA;</xsl:text>
+        <xsl:text>cd $SRC_DIR/$PKG_DIR&#xA;</xsl:text>
         <xsl:apply-templates select="itemizedlist/listitem/para">
           <xsl:with-param name="package" select="$package"/>
Index: FS/makefile.conf
===================================================================
--- BLFS/makefile.conf	(revision 00f4966aa31511c31e5fbddd84388cf436cb4eb9)
+++ 	(revision )
@@ -1,22 +1,0 @@
-#####
-#
-# Configuration file for the BLFS module
-#
-# $Id$
-#
-# Set default SRC_ARCHIVE and FTP_DIR
-#
-#####
-
-
-#--- The local repository for packages/file
-#    Any missing file will be downloaded and archived here,
-#    if the user has the right priviledges.
-export SRC_ARCHIVE=$SRC_ARCHIVE
-
-# --- Server used if the file isn't found in SRC_ARCHIVE.
-# As a last resort, the file will dowloaded from upstream, if possible.
-#
-# The server path MUST be set as listed in
-# http://www.linuxfromscratch.org/blfs/download.html
-export FTP_SERVER=ftp://anduin.linuxfromscratch.org/BLFS/
Index: README.BLFS
===================================================================
--- README.BLFS	(revision 00f4966aa31511c31e5fbddd84388cf436cb4eb9)
+++ README.BLFS	(revision 2fedf493f4421b58d048954d6a714857dd3178a6)
@@ -15,5 +15,5 @@
   the book.
 
-  NOTE:: The code is yet under development a may contains several bugs
+  NOTE:: The code is still under development and may contains several bugs
 
 
@@ -38,5 +38,5 @@
     packages           auto-generated file with packages info
     alternatives.conf  configuration files for alternative packages
-    makefile.conf      envars needed when running the generated Makefile
+    envars.conf        envars needed when running the build scripts
     update_book.sh     update the XML book sources and regenerate packages file
                        and GNOME and KDE dependencies tree
@@ -55,5 +55,5 @@
        Next step is to create a book and build scripts in dependencies build order
     for a target package. A target package can be any of the ones listed in the
-    packages file. That is done using the blfs-parser.sh script, but we are triying
+    packages file. That is done using the blfs-parser.sh script, but we are trying
     to make a menuconfig based system.
 
@@ -61,8 +61,9 @@
 
     package name         as listed in packages file
-    dependencies level   1 for required, 2 for required an recommendedand,
+    dependencies level   1 for required,
+                         2 for required an recommended
                          3 for required, recommended, and optional
-    sudo usage           y if sudo will be used (you will build as normal user)
-                         n if sudo isn't needed (you will build as root)
+    sudo usage           y if sudo will be used (you want build as a normal user)
+                         n if sudo isn't needed (you want build as root)
 
        For example:
@@ -83,10 +84,10 @@
 
   2.4  CREATING THE MAKEFILE
-       When the build scripts will be ready to be run, the Makefile can be
-  created. Be sure that you are into the "package" directory and run
+       When the build scripts are ready to be run, the Makefile can be
+    created. Be sure that you cd into the "package" directory and run
 
-      ../gen_makefile.sh
+       ../gen_makefile.sh
 
-  Review the Makefile and if all look sane, start the build.
+    Review the Makefile and if all look sane, start the build.
 
 
Index: blfs
===================================================================
--- blfs	(revision 00f4966aa31511c31e5fbddd84388cf436cb4eb9)
+++ blfs	(revision 2fedf493f4421b58d048954d6a714857dd3178a6)
@@ -3,4 +3,33 @@
 
 set -e
+
+# From common/common-functions
+# VT100 colors
+declare -r  BLACK=$'\e[1;30m'
+declare -r  DK_GRAY=$'\e[0;30m'
+
+declare -r  RED=$'\e[31m'
+declare -r  GREEN=$'\e[32m'
+declare -r  YELLOW=$'\e[33m'
+declare -r  BLUE=$'\e[34m'
+declare -r  MAGENTA=$'\e[35m'
+declare -r  CYAN=$'\e[36m'
+declare -r  WHITE=$'\e[37m'
+
+declare -r  OFF=$'\e[0m'
+declare -r  BOLD=$'\e[1m'
+declare -r  REVERSE=$'\e[7m'
+declare -r  HIDDEN=$'\e[8m'
+
+declare -r  tab_=$'\t'
+declare -r  nl_=$'\n'
+
+declare -r   DD_BORDER="${BOLD}==============================================================================${OFF}"
+declare -r   SD_BORDER="${BOLD}------------------------------------------------------------------------------${OFF}"
+declare -r STAR_BORDER="${BOLD}******************************************************************************${OFF}"
+
+# bold yellow > <  pair
+declare -r R_arrow=$'\e[1;33m>\e[0m'
+declare -r L_arrow=$'\e[1;33m<\e[0m'
 
 
@@ -35,5 +64,8 @@
 #>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
 
-VERBOSITY=1
+# envars not sourced from configuration file
+  PROGNAME=$(basename $0)
+COMMON_DIR="common"
+ VERBOSITY=1
 
 [[ $VERBOSITY > 0 ]] && echo -n "Loading config params from <configuration>..."
@@ -42,28 +74,64 @@
 [[ $VERBOSITY > 0 ]] && echo "OK"
 
+[[ $VERBOSITY > 0 ]] && echo -n "Loading function <func_validate_configs.sh>..."
+source $COMMON_DIR/func_validate_configs.sh
+[[ $? > 0 ]] && echo " function module did not load.." && exit 2
+[[ $VERBOSITY > 0 ]] && echo "OK"
+[[ $VERBOSITY > 0 ]] && echo "${SD_BORDER}${nl_}"
+
+# Be sure that we have a configuration file
 [[ -z $BOOK_BLFS ]] && echo -e "\nNo BLFS configuration found. Please configure it." && exit 1
 
-TREE=trunk/BOOK
+# Set default book version
+BRANCH_ID=${BRANCH_ID:=development}
 
-if [[ ! -z ${BRANCH_ID} ]]; then
-  case $BRANCH_ID in
-    dev* | SVN | trunk )  TREE=trunk/BOOK ;;
-              branch-* )  TREE=branches/${BRANCH_ID#branch-}/BOOK ;;
-                     * )  TREE=tags/${BRANCH_ID}/BOOK ;;
-  esac
+# Set the SVN tree
+case $BRANCH_ID in
+  dev* | SVN | trunk )  TREE=trunk/BOOK ;;
+              *EDIT* )  echo " You forgot to set the branch or stable book version."
+                        echo " Please rerun make and fix the configuration."
+                        exit 2
+                        ;;
+            branch-* )  TREE=branches/${BRANCH_ID#branch-}/BOOK ;;
+                   * )  TREE=tags/${BRANCH_ID}/BOOK ;;
+esac
+
+# For consistency with other books
+validate_config
+echo "${SD_BORDER}${nl_}"
+echo -n "Are you happy with these 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
+echo "${nl_}${SD_BORDER}${nl_}"
 
+# Install the files
 [[ ! -d $BLFS_ROOT ]] && mkdir -p $BLFS_ROOT
 
 cp -r BLFS/* $BLFS_ROOT
-cp common/progress_bar.sh $BLFS_ROOT
+cp $COMMON_DIR/progress_bar.sh $BLFS_ROOT
 # cp -r menu $BLFS_ROOT
 
+# Start the work
 cd $BLFS_ROOT
 
+# Clean-up
+rm -rf libs/.svn
+
+# Fix BLFS_XML harcoded values
 sed -i 's,blfs-xml,'$BLFS_XML',' update_book.sh
 sed -i 's,blfs-xml,'$BLFS_XML',' libs/book.xsl
 
-./update_book.sh $BLFS_XML get $TREE
+# Fetch book sources and create packages and GNOME/KDE dependencies files
+if [[ -d $BLFS_XML ]] ; then
+  ./update_book.sh
+else
+  ./update_book.sh $BLFS_XML get $TREE
+fi
+
+# Generate Config.in and run the menuconfig interfaz
+# ./gen_config.sh
 # make
 
Index: common/func_validate_configs.sh
===================================================================
--- common/func_validate_configs.sh	(revision 00f4966aa31511c31e5fbddd84388cf436cb4eb9)
+++ common/func_validate_configs.sh	(revision 2fedf493f4421b58d048954d6a714857dd3178a6)
@@ -93,4 +93,5 @@
   local -r clfs2_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE         ARCH  TARGET                 OPTIMIZE REPORT                                      STRIP FSTAB             CONFIG GETKERNEL KEYMAP VIMLANG PAGE TIMEZONE LANG        LUSER LGROUP"
   local -r   lfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE                       TEST BOMB_TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB             CONFIG GETKERNEL        VIMLANG PAGE TIMEZONE LANG        LUSER LGROUP"
+  local -r  blfs_PARAM_LIST="BRANCH_ID BLFS_ROOT BLFS_XML"
 
   local -r ERROR_MSG_pt1='The variable \"${L_arrow}${config_param}${R_arrow}\" value ${L_arrow}${BOLD}${!config_param}${R_arrow} is invalid,'
@@ -265,4 +266,8 @@
                KEYMAP=${save_param}
                ;;
+
+      # BLFS params. No validation is required/allowed, IMHO
+      BRANCH_ID | BLFS_ROOT | BLFS_XML)  echo "`eval echo $PARAM_VALS`" ;;
+
     esac
   done
