r2285 - jhalfs/trunk/HLFS

georgeb at linuxfromscratch.org georgeb at linuxfromscratch.org
Mon Jan 30 20:23:56 PST 2006


Author: georgeb
Date: 2006-01-30 21:23:56 -0700 (Mon, 30 Jan 2006)
New Revision: 2285

Modified:
   jhalfs/trunk/HLFS/jhahlfs
Log:
Adjust script coding style

Modified: jhalfs/trunk/HLFS/jhahlfs
===================================================================
--- jhalfs/trunk/HLFS/jhahlfs	2006-01-30 20:08:04 UTC (rev 2284)
+++ jhalfs/trunk/HLFS/jhahlfs	2006-01-31 04:23:56 UTC (rev 2285)
@@ -1,7 +1,7 @@
 #!/bin/sh
-set -e	# Enable error trapping
-set -u	# Trap undefined variables.. Forces the programmer
-		# to define a variable before using it
+set -e  # Enable error trapping
+set -u  # Trap undefined variables.. Forces the programmer
+        # to define a variable before using it
 
 #
 # Load the configuration file
@@ -43,9 +43,9 @@
   # to a working doc.. set WC=1, else 'null'
 WC=${BOOK:+1}
 
-CLEAN=0		# Clean out build dir?
-DL=			# The download app to use
-PREV=		# name of previous script processed
+CLEAN=0  # Clean out build dir?
+DL=      # The download app to use
+PREV=    # name of previous script processed
 chapter5=
 chapter6=
 chapter7=
@@ -54,8 +54,8 @@
 
 _inline_doc="
 ${GREEN}
-     This script, jhahlfs, strives to generate an accurate makefile
-   directly from the xml files used to generated the Hardened Linux From
+     This script, jhahlfs, strives to create an accurate makefile
+   directly from the xml files used to generate the Hardened Linux From
    Scratch document.
      The usage of this script assumes you have read and are familiar with
    the book and therefore the configuration variables found in jhahlfs.conf
@@ -127,7 +127,7 @@
 ${CYAN}        run make on the generated Makefile
 ${DD_BORDER}
 -EOF-
-	exit
+  exit
 }
 
 
@@ -135,7 +135,7 @@
 Try '$0 --help' for more information."
 
 no_empty_builddir() {
-	'clear'
+  'clear'
 cat <<- -EOF-
 ${DD_BORDER}
 
@@ -149,7 +149,7 @@
 ${OFF}
 ${DD_BORDER}
 -EOF-
-	exit
+  exit
 }
 
 exit_missing_arg="\
@@ -170,25 +170,25 @@
 #-----------------------#
 simple_error() {        # Basic error trap.... JUST DIE
 #-----------------------#
-    # If +e then disable text output
-    if [[ "$-" =~ "e" ]]; then
-	echo -e "\n${RED}ERROR:${GREEN} basic error trapped!${OFF}\n" >&2
-    fi
+  # If +e then disable text output
+  if [[ "$-" =~ "e" ]]; then
+    echo -e "\n${RED}ERROR:${GREEN} basic error trapped!${OFF}\n" >&2
+  fi
 }
 
 see_ya() {
     echo -e "\n\t${BOLD}${WHITE}Goodbye and thank you for choosing ${YELLOW}JHAHLFS\n${OFF}"
 }
-#####	Simple error TRAPS
-#	ctrl-c   SIGINT
-#	ctrl-y
-#	ctrl-z   SIGTSTP
-#	SIGHUP   1 HANGUP
-#	SIGINT   2 INTRERRUPT FROM KEYBOARD Ctrl-C
-#	SIGQUIT  3
-#	SIGKILL  9 KILL
-#	SIGTERM 15 TERMINATION
-#	SIGSTOP 17,18,23 STOP THE PROCESS
+##### Simple error TRAPS
+# ctrl-c   SIGINT
+# ctrl-y
+# ctrl-z   SIGTSTP
+# SIGHUP   1 HANGUP
+# SIGINT   2 INTRERRUPT FROM KEYBOARD Ctrl-C
+# SIGQUIT  3
+# SIGKILL  9 KILL
+# SIGTERM 15 TERMINATION
+# SIGSTOP 17,18,23 STOP THE PROCESS
 #####
 set -e
 trap see_ya 0
@@ -204,175 +204,177 @@
 #----------------------------#
 check_requirements() {       # Simple routine to validate gcc and kernel versions against requirements
 #----------------------------#
-	# Minimum values acceptable
-	#   bash	3.0>
-	#    gcc	3.0>
-	# kernel	2.6.2>
+  # Minimum values acceptable
+  #   bash  3.0>
+  #    gcc  3.0>
+  # kernel  2.6.2>
 
-	[[ $1 = "1" ]] && echo "${nl_}BASH: ${L_arrow}${GREEN}${BASH_VERSION}${R_arrow}"
-	case $BASH_VERSION in
-		[3-9].*) ;;
-		*) 'clear'
-			echo -e "
+  [[ $1 = "1" ]] && echo "${nl_}BASH: ${L_arrow}${GREEN}${BASH_VERSION}${R_arrow}"
+  case $BASH_VERSION in
+    [3-9].*) ;;
+    *) 'clear'
+        echo -e "
 $DD_BORDER
 \t\t${OFF}${RED}BASH version ${BOLD}${YELLOW}-->${WHITE} $BASH_VERSION ${YELLOW}<--${OFF}${RED} is too old.
 \t\t    This script requires 3.0${OFF}${RED} or greater
 $DD_BORDER"
-			exit 1
-			;;
-	esac
+        exit 1
+      ;;
+  esac
 
-	[[ $1 = "1" ]] && echo "GCC: ${L_arrow}${GREEN}`gcc -dumpversion`${R_arrow}"
+  [[ $1 = "1" ]] && echo "GCC: ${L_arrow}${GREEN}`gcc -dumpversion`${R_arrow}"
     case `gcc -dumpversion` in
-		[3-9].[0-9].* ) ;;
-		*)  'clear'
-			echo -e "
+      [3-9].[0-9].* ) ;;
+      *)  'clear'
+           echo -e "
 $DD_BORDER
 \t\t${OFF}${RED}GCC version ${BOLD}${YELLOW}-->${WHITE} $(gcc -dumpversion) ${YELLOW}<--${OFF}${RED} is too old.
 \t\t This script requires ${BOLD}${WHITE}3.0${OFF}${RED} or greater
 $DD_BORDER"
-			exit 1
-		;;
+           exit 1
+      ;;
     esac
 
-	#
-	# >>>> Check kernel version against the minimum acceptable level <<<<
-	#
-	[[ $1 = "1" ]] && echo "LINUX: ${L_arrow}${GREEN}`uname -r`${R_arrow}"
+  #
+  # >>>> Check kernel version against the minimum acceptable level <<<<
+  #
+  [[ $1 = "1" ]] && echo "LINUX: ${L_arrow}${GREEN}`uname -r`${R_arrow}"
 
-	local IFS
-	declare -i major minor revision change
-	min_kernel_vers=2.6.2
+  local IFS
+  declare -i major minor revision change
+  min_kernel_vers=2.6.2
 
-	IFS=".-"   # Split up w.x.y.z as well as w.x.y-rc  (catch release candidates)
-	set -- $min_kernel_vers # set postional parameters to minimum ver values
-	major=$1; minor=$2; revision=$3
-	#
-	set -- `uname -r` # Set postional parameters to user kernel version
-	#Compare against minimum acceptable kernel version..
-	(( $1  > major )) && return
-	(( $1 == major )) && (((  $2 >  minor )) ||
-						 ((( $2 == minor )) && (( $3 >= revision )))) && return
+  IFS=".-"   # Split up w.x.y.z as well as w.x.y-rc  (catch release candidates)
+  set -- $min_kernel_vers # set postional parameters to minimum ver values
+  major=$1; minor=$2; revision=$3
+  #
+  set -- `uname -r` # Set postional parameters to user kernel version
+  #Compare against minimum acceptable kernel version..
+  (( $1  > major )) && return
+  (( $1 == major )) && (((  $2 >  minor )) ||
+                       ((( $2 == minor )) && (( $3 >= revision )))) && return
 
-	# oops.. write error msg and die
-	echo -e "
+  # oops.. write error msg and die
+  echo -e "
 $DD_BORDER
 \t\t${OFF}${RED}The kernel version ${BOLD}${YELLOW}-->${WHITE} $(uname -r) ${YELLOW}<--${OFF}${RED} is too old.
 \t\tThis script requires version ${BOLD}${WHITE}$min_kernel_vers${OFF}${RED} or greater
 $DD_BORDER"
-	exit 1
+  exit 1
 }
 
 
 #----------------------------#
 validate_config()    {       # Are the config values sane (within reason)
 #----------------------------#
-	local -r PARAM_LIST="BUILDDIR HPKG MODEL TEST TOOLCHAINTEST STRIP VIMLANG PAGE GRSECURITY_HOST RUNMAKE"
-	local -r ERROR_MSG='${OFF}${RED}The variable \"${GREEN}${config_param}${RED}\" value ${BOLD}${YELLOW}--\>${WHITE}${!config_param}${YELLOW}\<--${OFF}${RED} is invalid, check the config file ${GREEN}\<jhahlfs.conf\>${OFF}'
-	local -r PARAM_VALS='${WHITE}${config_param}: ${L_arrow}${GREEN}${!config_param}${R_arrow}'
-	local config_param
-	local validation_str
+  local -r PARAM_LIST="BUILDDIR HPKG MODEL TEST TOOLCHAINTEST STRIP VIMLANG PAGE GRSECURITY_HOST RUNMAKE"
+  local -r ERROR_MSG='${OFF}${RED}The variable \"${GREEN}${config_param}${RED}\" value ${BOLD}${YELLOW}--\>${WHITE}${!config_param}${YELLOW}\<--${OFF}${RED} is invalid, check the config file ${GREEN}\<jhahlfs.conf\>${OFF}'
+  local -r PARAM_VALS='${WHITE}${config_param}: ${L_arrow}${GREEN}${!config_param}${R_arrow}'
+  local config_param
+  local validation_str
 
-	write_error_and_die() {
-		echo -e "\n${DD_BORDER}"
-		   echo "`eval echo ${ERROR_MSG}`" >&2
-		echo -e "${DD_BORDER}\n"
-		exit 1
-	}
-	set +e
-	for config_param in $PARAM_LIST; do
-		[[ $1 = "1" ]] && echo -e "`eval echo $PARAM_VALS`"
-		case $config_param in
-			BUILDDIR)	# We cannot have an <empty> or </> root mount point
-						if [[ "xx x/x" =~ "x${!config_param}x" ]]; then
-							write_error_and_die
-						fi
-						continue	;;
-			HPKG)			validation_str="x0x x1x"	;;
-			RUNMAKE)		validation_str="x0x x1x"	;;
-			TEST)			validation_str="x0x x1x"	;;
-			STRIP)			validation_str="x0x x1x"	;;
-			VIMLANG)		validation_str="x0x x1x"	;;
-			TOOLCHAINTEST)	validation_str="x0x x1x"	;;
-			GRSECURITY_HOST)	validation_str="x0x x1x"	;;
+  write_error_and_die() {
+    echo -e "\n${DD_BORDER}"
+    echo "`eval echo ${ERROR_MSG}`" >&2
+    echo -e "${DD_BORDER}\n"
+    exit 1
+  }
 
-			MODEL)		validation_str="xglibcx xuclibcx"	;;
-			PAGE)		validation_str="xletterx xA4x" 	;;
-			*)
-				echo "WHAT PARAMETER IS THIS.. <<${config_param}>>"
-				exit
-			;;
-		esac
-		# This is the 'regexp' test available in bash-3.0..
-		# using it as a poor man's test for substring
-		if [[ ! "${validation_str}" =~ "x${!config_param}x" ]] ; then
-			# parameter value entered is no good
-			write_error_and_die
-		fi
-	done # for loop
+  set +e
 
-	for config_param in LC_ALL LANG; do
-		[[ $1 = "1" ]] && echo "`eval echo $PARAM_VALS`"
-		[[ -z "${!config_param}" ]] && continue
-		# See it the locale values exist on this machine
-		[[ "`locale -a | grep -c ${!config_param}`" > 0 ]] && continue
+  for config_param in $PARAM_LIST; do
+    [[ $1 = "1" ]] && echo -e "`eval echo $PARAM_VALS`"
+    case $config_param in
+      BUILDDIR) # We cannot have an <empty> or </> root mount point
+            if [[ "xx x/x" =~ "x${!config_param}x" ]]; then
+              write_error_and_die
+            fi
+            continue  ;;
+      HPKG)       validation_str="x0x x1x"  ;;
+      RUNMAKE)    validation_str="x0x x1x"  ;;
+      TEST)       validation_str="x0x x1x"  ;;
+      STRIP)      validation_str="x0x x1x"  ;;
+      VIMLANG)    validation_str="x0x x1x"  ;;
+      TOOLCHAINTEST)  validation_str="x0x x1x"  ;;
+      GRSECURITY_HOST)  validation_str="x0x x1x"  ;;
 
-		# If you make it this far then there is a problem
-		write_error_and_die
-	done
+      MODEL)     validation_str="xglibcx xuclibcx" ;;
+      PAGE)      validation_str="xletterx xA4x"  ;;
+      *)
+        echo "WHAT PARAMETER IS THIS.. <<${config_param}>>"
+        exit
+      ;;
+    esac
+    # This is the 'regexp' test available in bash-3.0..
+    # using it as a poor man's test for substring
+    if [[ ! "${validation_str}" =~ "x${!config_param}x" ]] ; then
+      # parameter value entered is no good
+      write_error_and_die
+    fi
+  done # for loop
 
-	for config_param in FSTAB CONFIG KEYMAP BOOK; do
-		[[ $1 = "1" ]] && echo "`eval echo $PARAM_VALS`"
-		# If this is not a working copy, ie the default book, then skip
-		[[ -z $WC ]] && continue
-		[[ -z "${!config_param}" ]] && continue
-		[[ -e "${!config_param}" ]] && [[ -s "${!config_param}" ]] && continue
+  for config_param in LC_ALL LANG; do
+    [[ $1 = "1" ]] && echo "`eval echo $PARAM_VALS`"
+    [[ -z "${!config_param}" ]] && continue
+    # See it the locale values exist on this machine
+    [[ "`locale -a | grep -c ${!config_param}`" > 0 ]] && continue
 
-		# If you make it this far then there is a problem
-		write_error_and_die
-	done
+    # If you make it this far then there is a problem
+    write_error_and_die
+  done
 
-	set -e
-	echo "$tab_${BOLD}${YELLOW} Config parameters look good${OFF}${nl_}"
+  for config_param in FSTAB CONFIG KEYMAP BOOK; do
+    [[ $1 = "1" ]] && echo "`eval echo $PARAM_VALS`"
+    # If this is not a working copy, ie the default book, then skip
+    [[ -z $WC ]] && continue
+    [[ -z "${!config_param}" ]] && continue
+    [[ -e "${!config_param}" ]] && [[ -s "${!config_param}" ]] && continue
+
+    # If you make it this far then there is a problem
+    write_error_and_die
+  done
+
+  set -e
+  echo "$tab_${BOLD}${YELLOW} Config parameters look good${OFF}${nl_}"
 }
 
 
 #----------------------------#
 build_patches_file() {       # Supply a suitably formated list of patches.
 #----------------------------#
-    local saveIFS=$IFS
+  local saveIFS=$IFS
 
-    LOC_add_patches_entry() {
-	for f in `grep "/$1-" patcheslist_.wget`; do
-	    basename $f | sed "s|${2}|\&${1}-version;|" >> patches
-	done
-    }
+  LOC_add_patches_entry() {
+    for f in `grep "/$1-" patcheslist_.wget`; do
+      basename $f | sed "s|${2}|\&${1}-version;|" >> patches
+    done
+  }
 
-    xsltproc --nonet \
-			 --xinclude \
-			 -o patcheslist_.wget \
-			 hlfs-patcheslist_.xsl \
-			$BOOK/index.xml > /dev/null 2>&1
+  xsltproc --nonet \
+           --xinclude \
+           -o patcheslist_.wget \
+           hlfs-patcheslist_.xsl \
+           $BOOK/index.xml > /dev/null 2>&1
 
-    rm -f patches
+  rm -f patches
 
-    IFS=$'\x0A'  # Modify the 'internal field separator' to break on 'LF' only
-    for f in `cat packages`; do
-	IFS=$saveIFS
-	LOC_add_patches_entry \
-		`echo $f | sed -e 's/-version//' \
-					   -e 's/-file.*//' \
-					   -e 's/"//g' \
-					   -e 's/uclibc/uClibc/'`
-    done
+  IFS=$'\x0A'  # Modify the 'internal field separator' to break on 'LF' only
+  for f in `cat packages`; do
+    IFS=$saveIFS
+    LOC_add_patches_entry \
+    `echo $f | sed -e 's/-version//' \
+                   -e 's/-file.*//' \
+                   -e 's/"//g' \
+                   -e 's/uclibc/uClibc/'`
+  done
 
-	# .... U G L Y .... what to do with the grsecurity patch to the kernel..
-	for f in `grep "/grsecurity-" patcheslist_.wget`; do
-	    basename $f >> patches
-	done
+  # .... U G L Y .... what to do with the grsecurity patch to the kernel..
+  for f in `grep "/grsecurity-" patcheslist_.wget`; do
+      basename $f >> patches
+  done
 
-    IFS=$saveIFS
-    rm -f patcheslist_.wget
+  IFS=$saveIFS
+  rm -f patcheslist_.wget
 }
 
 
@@ -414,89 +416,88 @@
     exit 1"
 
     echo -n "Downloading the HLFS Book, version $HLFSVRS... "
-	# Grab a fresh HLFS book if it's missing, otherwise, update it from the
-	# repo. If we've already extracted the commands, move on to getting the
-	# sources.
-	if [ -d hlfs-$HLFSVRS ] ; then
-	    cd hlfs-$HLFSVRS
-	    if LC_ALL=C svn up | grep -q At && \
-		test -d $JHAHLFSDIR/commands && \
-		test -f $JHAHLFSDIR/packages && \
-		test -f $JHAHLFSDIR/patches ; then
-		echo -ne "done\n"
-    		# Set the canonical book version
-		cd $JHAHLFSDIR
-		VERSION=`grep "ENTITY version " $BOOK/general.ent | sed 's@<!ENTITY version "@@;s@">@@'`
-		get_sources
-	    else
-    		echo -ne "done\n"
-    		extract_commands
-	    fi
-	else
-	    case $HLFSVRS in
-		development)
-	           svn co $SVN/HLFS/trunk/BOOK hlfs-$HLFSVRS >>$LOGDIR/$LOG 2>&1
-		    ;;
-		*) echo -e "${RED}Invalid document version selected${OFF}"
-		    ;;
-	    esac
-	    echo -ne "done\n"
-	    extract_commands
-	fi
+    # Grab a fresh HLFS book if it's missing, otherwise, update it from the
+    # repo. If we've already extracted the commands, move on to getting the
+    # sources.
+    if [ -d hlfs-$HLFSVRS ] ; then
+      cd hlfs-$HLFSVRS
+      if LC_ALL=C svn up | grep -q At && \
+        test -d $JHAHLFSDIR/commands && \
+        test -f $JHAHLFSDIR/packages && \
+        test -f $JHAHLFSDIR/patches ; then
+        echo -ne "done\n"
+        # Set the canonical book version
+        cd $JHAHLFSDIR
+        VERSION=`grep "ENTITY version " $BOOK/general.ent | sed 's@<!ENTITY version "@@;s@">@@'`
+        get_sources
+      else
+        echo -ne "done\n"
+        extract_commands
+      fi
+    else
+      case $HLFSVRS in
+        development)
+             svn co $SVN/HLFS/trunk/BOOK hlfs-$HLFSVRS >>$LOGDIR/$LOG 2>&1
+          ;;
+        *) echo -e "${RED}Invalid document version selected${OFF}"
+          ;;
+      esac
+      echo -ne "done\n"
+      extract_commands
+    fi
   else
-	echo -ne "Using $BOOK as book's sources ...\n"
-        extract_commands
+    echo -ne "Using $BOOK as book's sources ...\n"
+    extract_commands
   fi
 }
 
 #----------------------------#
 extract_commands() {         #
 #----------------------------#
-	# Check for libxslt instead of just letting the script hit 'xsltproc' and fail.
-	test `type -p xsltproc` || eval "echo \"This feature requires libxslt.\"
-	exit 1"
+  # Check for libxslt instead of just letting the script hit 'xsltproc' and fail.
+  test `type -p xsltproc` || eval "echo \"This feature requires libxslt.\"
+  exit 1"
 
-	cd $JHAHLFSDIR
-	VERSION=`grep "ENTITY version " $BOOK/general.ent | sed 's@<!ENTITY version "@@;s@">@@'`
+  cd $JHAHLFSDIR
+  VERSION=`grep "ENTITY version " $BOOK/general.ent | sed 's@<!ENTITY version "@@;s@">@@'`
 
-	# Start clean
-	if [ -d commands ]; then
-		rm -rf commands
-		mkdir -v commands
-	fi
-	echo -n "Extracting commands..."
+  # Start clean
+  if [ -d commands ]; then
+    rm -rf commands
+    mkdir -v commands
+  fi
+  echo -n "Extracting commands..."
 
-	# Dump the commands in shell script form from the HLFS book.
-	xsltproc  --nonet \
-			  --xinclude \
-			  --stringparam model $MODEL \
-			  --stringparam testsuite $TEST \
-			  --stringparam toolchaintest $TOOLCHAINTEST \
-			  --stringparam vim-lang $VIMLANG \
-			  -o ./commands/ $XSL $BOOK/index.xml >>$LOGDIR/$LOG 2>&1
+  # Dump the commands in shell script form from the HLFS book.
+  xsltproc  --nonet \
+            --xinclude \
+            --stringparam model $MODEL \
+            --stringparam testsuite $TEST \
+            --stringparam toolchaintest $TOOLCHAINTEST \
+            --stringparam vim-lang $VIMLANG \
+            -o ./commands/ $XSL $BOOK/index.xml >>$LOGDIR/$LOG 2>&1
 
-	# Make the scripts executable.
-	chmod -R +x $JHAHLFSDIR/commands
+  # Make the scripts executable.
+  chmod -R +x $JHAHLFSDIR/commands
 
-	# Grab the patches and package names.
-	cd $JHAHLFSDIR
-	for i in patches packages ; do rm -f $i ; done
-	grep "\-version" $BOOK/general.ent | sed -e 's@<!ENTITY @@' -e 's@">@"@' \
-	-e '/generic/d' >> packages
+  # Grab the patches and package names.
+  cd $JHAHLFSDIR
+  for i in patches packages ; do rm -f $i ; done
+  grep "\-version" $BOOK/general.ent | sed -e 's@<!ENTITY @@' -e 's@">@"@' \
+  -e '/generic/d' >> packages
 
-	# Download the vim-lang package if it must be installed
-	if [ "$VIMLANG" = "1" ] ; then
-		echo `grep "vim" packages | sed 's at vim@&-lang@'` >> packages
-	fi
-	echo `grep "udev-config-file" $BOOK/general.ent | sed -e 's@<!ENTITY @@' -e 's@">@"@'` >> packages
+  # Download the vim-lang package if it must be installed
+  if [ "$VIMLANG" = "1" ] ; then
+    echo `grep "vim" packages | sed 's at vim@&-lang@'` >> packages
+  fi
+  echo `grep "udev-config-file" $BOOK/general.ent | sed -e 's@<!ENTITY @@' -e 's@">@"@'` >> packages
 
-	# There is no HLFS patches.ent file so we will create one.
-	build_patches_file
-#  grep "ENTITY" $BOOK/patches.ent | sed -e 's/.* "//' -e 's/">//' >> patches
+  # There is no HLFS patches.ent file so we will create one.
+  build_patches_file
 
-	# Done. Moving on...
-	echo -ne "done\n"
-	get_sources
+  # Done. Moving on...
+  echo -ne "done\n"
+  get_sources
 }
 
 #----------------------------#
@@ -504,126 +505,126 @@
 #----------------------------#
   cd $BUILDDIR/sources
 
-	# Hackish fix for the bash-doc, glibc-{linuxthreads,libidn} and
-	# module-init-tools-testsuite packages that don't conform to
-	# norms in the URL scheme.
-	DIR=`echo $1 | sed 's at -doc@@;s at -linuxthreads@@;s at -libidn@@;s at -testsuite@@'`
+  # Hackish fix for the bash-doc, glibc-{linuxthreads,libidn} and
+  # module-init-tools-testsuite packages that don't conform to
+  # norms in the URL scheme.
+  DIR=`echo $1 | sed 's at -doc@@;s at -linuxthreads@@;s at -libidn@@;s at -testsuite@@'`
 
-	# Find the md5 sum for this package.
-	if [ $2 != MD5SUMS ] ; then
-		set +e
-		MD5=`grep "  $2" MD5SUMS`
-		if [ $? -ne 0 ]; then
-			set -e
-			echo "${RED}$2 not found in MD5SUMS${OFF}"
-			echo "$2 not found in MD5SUMS" >> MISSING_FILES.DMP
-			return
-	    fi
-    	set -e
-	fi
+  # Find the md5 sum for this package.
+  if [ $2 != MD5SUMS ] ; then
+    set +e
+    MD5=`grep "  $2" MD5SUMS`
+    if [ $? -ne 0 ]; then
+      set -e
+      echo "${RED}$2 not found in MD5SUMS${OFF}"
+      echo "$2 not found in MD5SUMS" >> MISSING_FILES.DMP
+      return
+      fi
+      set -e
+  fi
 
-	if [ ! -f $2 ] ; then
-		case $DL in
-			wget )  wget $HTTP/$DIR/$2						;;
-			curl )  `curl -# $HTTP/$DIR/$2 -o $2`			;;
-			* )     echo "$DL not supported at this time."	;;
-		esac
-	elif ! echo "$MD5" | md5sum -c - >/dev/null 2>/dev/null ; then
-		case $DL in
-			wget )	wget -c $HTTP/$DIR/$2					;;
-			curl )	`curl -# -C - $HTTP/$DIR/$2 -o $2`		;;
-			* )		echo "$DL not supported at this time."	;;
-		esac
-	fi
+  if [ ! -f $2 ] ; then
+    case $DL in
+      wget )  wget $HTTP/$DIR/$2            ;;
+      curl )  `curl -# $HTTP/$DIR/$2 -o $2`     ;;
+      * )     echo "$DL not supported at this time."  ;;
+    esac
+  elif ! echo "$MD5" | md5sum -c - >/dev/null 2>/dev/null ; then
+    case $DL in
+      wget )  wget -c $HTTP/$DIR/$2         ;;
+      curl )  `curl -# -C - $HTTP/$DIR/$2 -o $2`    ;;
+      * )     echo "$DL not supported at this time."  ;;
+    esac
+  fi
 
-	if [ $2 != MD5SUMS ] && ! echo "$MD5" | md5sum -c - ; then
-		exit 1
-	fi
-	if [ $2 != MD5SUMS ] ; then
-		echo `grep "$MD5" MD5SUMS` >> MD5SUMS-$VERSION
-	fi
+  if [ $2 != MD5SUMS ] && ! echo "$MD5" | md5sum -c - ; then
+    exit 1
+  fi
+  if [ $2 != MD5SUMS ] ; then
+    echo `grep "$MD5" MD5SUMS` >> MD5SUMS-$VERSION
+  fi
 }
 
 
 #----------------------------#
 get_sources() {              #
 #----------------------------#
-    local IFS
+  local IFS
 
-	# Test if the packages must be downloaded
-	if [ ! "$HPKG" = "1" ] ; then
-  		return
-	fi
+  # Test if the packages must be downloaded
+  if [ ! "$HPKG" = "1" ] ; then
+    return
+  fi
 
-    # Modify the 'internal field separator' to break on 'LF' only
-	IFS=$'\x0A'
+  # Modify the 'internal field separator' to break on 'LF' only
+  IFS=$'\x0A'
 
-	if [ ! -d $BUILDDIR/sources ] ; then mkdir $BUILDDIR/sources ; fi
-	cd $BUILDDIR/sources
+  if [ ! -d $BUILDDIR/sources ] ; then mkdir $BUILDDIR/sources ; fi
+  cd $BUILDDIR/sources
 
-	> MISSING_FILES.DMP  # Files not in md5sum end up here
+  > MISSING_FILES.DMP  # Files not in md5sum end up here
 
-	if [ -f MD5SUMS ] ; then rm MD5SUMS ; fi
-	if [ -f MD5SUMS-$VERSION ] ; then rm MD5SUMS-$VERSION ; fi
+  if [ -f MD5SUMS ] ; then rm MD5SUMS ; fi
+  if [ -f MD5SUMS-$VERSION ] ; then rm MD5SUMS-$VERSION ; fi
 
-	# Retrieve the master md5sum file
-	download "" MD5SUMS
+  # Retrieve the master md5sum file
+  download "" MD5SUMS
 
-	# Iterate through each package and grab it, along with any patches it needs.
-	for i in `cat $JHAHLFSDIR/packages` ; do
-      PKG=`echo $i | sed -e 's/-version.*//' \
-						 -e 's/-file.*//' \
-						 -e 's/uclibc/uClibc/' `
+  # Iterate through each package and grab it, along with any patches it needs.
+  for i in `cat $JHAHLFSDIR/packages` ; do
+    PKG=`echo $i | sed -e 's/-version.*//' \
+                       -e 's/-file.*//' \
+                       -e 's/uclibc/uClibc/' `
 
-	  # Needed for Groff patchlevel patch on UTF-8 branch
-	  GROFFLEVEL=`grep "groff-patchlevel" $JHAHLFSDIR/packages | sed -e 's/groff-patchlevel //' -e 's/"//g'`
+    # Needed for Groff patchlevel patch on UTF-8 branch
+    GROFFLEVEL=`grep "groff-patchlevel" $JHAHLFSDIR/packages | sed -e 's/groff-patchlevel //' -e 's/"//g'`
 
-	  #
-	  # How to deal with orphan packages..??
-	  #
-	  VRS=`echo $i | sed -e 's/.* //' -e 's/"//g'`
-	  case "$PKG" in
-		"expect-lib" )			continue ;; # not valid packages
-		"linux-dl" )			continue ;;
-		"groff-patchlevel" )	continue ;;
-		"uClibc-patch" )		continue ;;
+    #
+    # How to deal with orphan packages..??
+    #
+    VRS=`echo $i | sed -e 's/.* //' -e 's/"//g'`
+    case "$PKG" in
+      "expect-lib" )        continue ;; # not valid packages
+      "linux-dl" )          continue ;;
+      "groff-patchlevel" )  continue ;;
+      "uClibc-patch" )      continue ;;
 
-		"tcl" )			FILE="$PKG$VRS-src.tar.bz2" 			; download $PKG $FILE	;;
-		"vim-lang" )	FILE="vim-$VRS-lang.tar.bz2"; PKG="vim"	; download $PKG $FILE	;;
-		"udev-config" )	FILE="$VRS" ; PKG="udev" 				; download $PKG $FILE	;;
+      "tcl" )           FILE="$PKG$VRS-src.tar.bz2"       ; download $PKG $FILE ;;
+      "vim-lang" )      FILE="vim-$VRS-lang.tar.bz2"; PKG="vim" ; download $PKG $FILE ;;
+      "udev-config" )   FILE="$VRS" ; PKG="udev"        ; download $PKG $FILE ;;
 
-		"uClibc-locale" ) FILE="$PKG-$VRS.tar.bz2" ; PKG="uClibc"
-						  download $PKG $FILE
-						  # There can be no patches for this file
-						  continue ;;
+      "uClibc-locale" ) FILE="$PKG-$VRS.tar.bz2" ; PKG="uClibc"
+                download $PKG $FILE
+                # There can be no patches for this file
+                continue ;;
 
-		"gcc" )		download $PKG "gcc-core-$VRS.tar.bz2"
-					download $PKG "gcc-g++-$VRS.tar.bz2"
-			;;
-		"glibc")	download $PKG "$PKG-$VRS.tar.bz2"
-					download $PKG "$PKG-libidn-$VRS.tar.bz2"
-			;;
-		* )			FILE="$PKG-$VRS.tar.bz2"
-					download $PKG $FILE
-			;;
-      esac
+      "gcc" )   download $PKG "gcc-core-$VRS.tar.bz2"
+                download $PKG "gcc-g++-$VRS.tar.bz2"
+        ;;
+      "glibc")  download $PKG "$PKG-$VRS.tar.bz2"
+                download $PKG "$PKG-libidn-$VRS.tar.bz2"
+        ;;
+      * )     FILE="$PKG-$VRS.tar.bz2"
+              download $PKG $FILE
+        ;;
+    esac
 
-      for patch in `grep "$PKG-&$PKG" $JHAHLFSDIR/patches` ; do
-        PATCH=`echo $patch | sed 's@&'$PKG'-version;@'$VRS'@'`
-        download $PKG $PATCH
-      done
-
+    for patch in `grep "$PKG-&$PKG" $JHAHLFSDIR/patches` ; do
+      PATCH=`echo $patch | sed 's@&'$PKG'-version;@'$VRS'@'`
+      download $PKG $PATCH
     done
 
-	# .... U G L Y .... what to do with the grsecurity patch to the kernel..
-	download grsecurity `grep grsecurity $JHAHLFSDIR/patches`
+  done
 
-	# .... U G L Y .... deal with uClibc-locale-xxxxx.tar.bz2 format issue.
-	bzcat uClibc-locale-030818.tar.bz2 | gzip > uClibc-locale-030818.tgz
+  # .... U G L Y .... what to do with the grsecurity patch to the kernel..
+  download grsecurity `grep grsecurity $JHAHLFSDIR/patches`
 
-	if [[ -s $BUILDDIR/sources/MISSING_FILES.DMP ]]; then
-		echo  -e "\n\n${tab_}${RED} One or more files were not retrieved.\n${tab_} Check <MISSING_FILES.DMP> for names ${OFF}\n\n"
-	fi
+  # .... U G L Y .... deal with uClibc-locale-xxxxx.tar.bz2 format issue.
+  bzcat uClibc-locale-030818.tar.bz2 | gzip > uClibc-locale-030818.tgz
+
+  if [[ -s $BUILDDIR/sources/MISSING_FILES.DMP ]]; then
+    echo  -e "\n\n${tab_}${RED} One or more files were not retrieved.\n${tab_} Check <MISSING_FILES.DMP> for names ${OFF}\n\n"
+  fi
 }
 
 
@@ -641,21 +642,21 @@
 #----------------------------#
 chapter4_Makefiles() {       # Initialization of the system
 #----------------------------#
-    local TARGET LOADER
+  local TARGET LOADER
 
-    echo  "${YELLOW}	Processing Chapter-4 scripts ${OFF}"
+  echo  "${YELLOW}  Processing Chapter-4 scripts ${OFF}"
 
-	# Define a few model dependant variables
-	if [[ ${MODEL} = "uclibc" ]]; then
-	  TARGET="tools-linux-uclibc"; LOADER="ld-uClibc.so.0"
-	else
-	  TARGET="tools-linux-gnu";    LOADER="ld-linux.so.2"
+  # Define a few model dependant variables
+  if [[ ${MODEL} = "uclibc" ]]; then
+    TARGET="tools-linux-uclibc"; LOADER="ld-uClibc.so.0"
+  else
+    TARGET="tools-linux-gnu";    LOADER="ld-linux.so.2"
     fi
 
-	# 022-
-	# If /home/hlfs is already present in the host, we asume that the
-	# hlfs user and group are also presents in the host, and a backup
-	# of their bash init files is made.
+  # 022-
+  # If /home/hlfs is already present in the host, we asume that the
+  # hlfs user and group are also presents in the host, and a backup
+  # of their bash init files is made.
 (
 cat << EOF
 020-creatingtoolsdir:
@@ -712,73 +713,73 @@
 chapter5_Makefiles() {       # Bootstrap or temptools phase
 #----------------------------#
 
-	echo "${YELLOW}	Processing Chapter-5 scripts${OFF}"
+  echo "${YELLOW} Processing Chapter-5 scripts${OFF}"
 
   for file in chapter05/* ; do
     # Keep the script file name
     this_script=`basename $file`
 
     # Skip this script depending on jhahlfs.conf flags set.
-	case $this_script in
-	    	# If no testsuites will be run, then TCL, Expect and DejaGNU aren't needed
-		*tcl* )		[[ "$TOOLCHAINTEST" = "0" ]] && continue; ;;
-		*expect* )	[[ "$TOOLCHAINTEST" = "0" ]] && continue; ;;
-		*dejagnu* )	[[ "$TOOLCHAINTEST" = "0" ]] && continue; ;;
-			# Test if the stripping phase must be skipped
-		*stripping* )	[[ "$STRIP" = "0" ]] && continue ;;
-			# Select the appropriate library
-		*glibc*)		[[ ${MODEL} = "uclibc" ]] && continue ;;
-		*uclibc*)		[[ ${MODEL} = "glibc" ]]  && continue ;;
-		*) ;;
-	esac
+    case $this_script in
+      # If no testsuites will be run, then TCL, Expect and DejaGNU aren't needed
+      *tcl* )   [[ "$TOOLCHAINTEST" = "0" ]] && continue; ;;
+      *expect* )  [[ "$TOOLCHAINTEST" = "0" ]] && continue; ;;
+      *dejagnu* ) [[ "$TOOLCHAINTEST" = "0" ]] && continue; ;;
+        # Test if the stripping phase must be skipped
+      *stripping* ) [[ "$STRIP" = "0" ]] && continue ;;
+        # Select the appropriate library
+      *glibc*)    [[ ${MODEL} = "uclibc" ]] && continue ;;
+      *uclibc*)   [[ ${MODEL} = "glibc" ]]  && continue ;;
+      *) ;;
+    esac
 
-	# First append each name of the script files to a list (this will become
-	# the names of the targets in the Makefile
-	chapter5="$chapter5 $this_script"
+    # First append each name of the script files to a list (this will become
+    # the names of the targets in the Makefile
+    chapter5="$chapter5 $this_script"
 
-	# Grab the name of the target (minus the -headers or -cross in the case of gcc
-	# and binutils in chapter 5)
-	name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@' -e 's at -cross@@' -e 's at -headers@@'`
+    # Grab the name of the target (minus the -headers or -cross in the case of gcc
+    # and binutils in chapter 5)
+    name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@' -e 's at -cross@@' -e 's at -headers@@'`
 
-	# >>>>>>>>>> U G L Y <<<<<<<<<
-	# Adjust 'name' and patch a few scripts on the fly..
-	case $name in
-	linux-libc) name=linux-libc-headers
-	 	;;
-	uclibc) # this sucks as method to deal with gettext/libint inside uClibc
-		sed 's@^cd gettext-runtime at cd ../gettext-*/gettext-runtime@' -i chapter05/$this_script
-		;;
-	gcc) # to compensate for the compiler test inside gcc (which fails), disable error trap
-		sed 's@^gcc -o test test.c at set +e; gcc -o test test.c@' -i chapter05/$this_script
-		;;
-	esac
+    # >>>>>>>>>> U G L Y <<<<<<<<<
+    # Adjust 'name' and patch a few scripts on the fly..
+    case $name in
+      linux-libc) name=linux-libc-headers
+      ;;
+      uclibc) # this sucks as method to deal with gettext/libint inside uClibc
+        sed 's@^cd gettext-runtime at cd ../gettext-*/gettext-runtime@' -i chapter05/$this_script
+      ;;
+     gcc) # to compensate for the compiler test inside gcc (which fails), disable error trap
+        sed 's@^gcc -o test test.c at set +e; gcc -o test test.c@' -i chapter05/$this_script
+      ;;
+    esac
 
-	# Set the dependency for the first target.
-	if [ -z $PREV ] ; then PREV=022-settingenvironment ; fi
+    # Set the dependency for the first target.
+    if [ -z $PREV ] ; then PREV=022-settingenvironment ; fi
 
 
-	#--------------------------------------------------------------------#
-	#         >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<<          #
-	#--------------------------------------------------------------------#
-	#
-	# Drop in the name of the target on a new line, and the previous target
-	# as a dependency. Also call the echo_message function.
-	echo -e "\n$this_script:  $PREV
+    #--------------------------------------------------------------------#
+    #         >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<<          #
+    #--------------------------------------------------------------------#
+    #
+    # Drop in the name of the target on a new line, and the previous target
+    # as a dependency. Also call the echo_message function.
+    echo -e "\n$this_script:  $PREV
 	@\$(call echo_message, Building)" >> $MKFILE.tmp
 
-	# Find the version of the command files, if it corresponds with the building of
-	# a specific package
-	vrs=`grep "^$name-version" $JHAHLFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
-	# If $vrs isn't empty, we've got a package...
-	if [ "$vrs" != "" ] ; then
-		# Deal with non-standard names
-		case $name in
-			tcl)	FILE="$name$vrs-src.tar"	;;
-		    uclibc)	FILE="uClibc-$vrs.tar"		;;
-			gcc)	FILE=gcc-core-$vrs.tar		;;
-	    	*)		FILE="$name-$vrs.tar"		;;
-		esac
-		# Insert instructions for unpacking the package and to set the PKGDIR variable.
+    # Find the version of the command files, if it corresponds with the building of
+    # a specific package
+    vrs=`grep "^$name-version" $JHAHLFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
+    # If $vrs isn't empty, we've got a package...
+    if [ "$vrs" != "" ] ; then
+      # Deal with non-standard names
+      case $name in
+        tcl)    FILE="$name$vrs-src.tar"  ;;
+        uclibc) FILE="uClibc-$vrs.tar"    ;;
+        gcc)    FILE=gcc-core-$vrs.tar    ;;
+        *)      FILE="$name-$vrs.tar"     ;;
+      esac
+     # Insert instructions for unpacking the package and to set the PKGDIR variable.
 (
 cat << EOF
 	@\$(call unpack,$FILE)
@@ -787,22 +788,22 @@
 	echo "export PKGDIR=\$(HLFS)\$(SRC)/\$\$ROOT" > envars && \\
 EOF
 ) >> $MKFILE.tmp
-	fi
+  fi
 
     case $this_script in
-		*binutils* )  # Dump the path to sources directory for later removal
-			echo -e '\techo "$(HLFS)$(SRC)/$$ROOT" >> sources-dir' >> $MKFILE.tmp
-			;;
-		*adjusting* )  # For the Adjusting phase we must to cd to the binutils-build directory.
-			echo -e '\t at echo "export PKGDIR=$(HLFS)$(SRC)/binutils-build" > envars' >> $MKFILE.tmp
-			;;
-		* )  # Everything else, add a true statment so we don't confuse make
-			echo -e '\ttrue' >> $MKFILE.tmp
-			;;
+      *binutils* )  # Dump the path to sources directory for later removal
+        echo -e '\techo "$(HLFS)$(SRC)/$$ROOT" >> sources-dir' >> $MKFILE.tmp
+        ;;
+      *adjusting* )  # For the Adjusting phase we must to cd to the binutils-build directory.
+        echo -e '\t at echo "export PKGDIR=$(HLFS)$(SRC)/binutils-build" > envars' >> $MKFILE.tmp
+        ;;
+      * )  # Everything else, add a true statment so we don't confuse make
+        echo -e '\ttrue' >> $MKFILE.tmp
+        ;;
     esac
 
-	# Insert date and disk usage at the top of the log file, the script run
-	# and date and disk usage again at the bottom of the log file.
+    # Insert date and disk usage at the top of the log file, the script run
+    # and date and disk usage again at the bottom of the log file.
 (
 cat << EOF
 	@echo -e "\n\`date\`\n\nKB: \`du -sk --exclude={0,1}??-* \$(HLFS)\`\n" >logs/$this_script && \\
@@ -811,11 +812,11 @@
 EOF
 ) >> $MKFILE.tmp
 
-	# Remove the build directory(ies) except if the package build fails
-	# (so we can review config.cache, config.log, etc.)
-	# For Binutils the sources must be retained for some time.
-	if [ "$vrs" != "" ] ; then
-		if [[ ! `_IS_ $this_script binutils` ]]; then
+    # Remove the build directory(ies) except if the package build fails
+    # (so we can review config.cache, config.log, etc.)
+    # For Binutils the sources must be retained for some time.
+    if [ "$vrs" != "" ] ; then
+      if [[ ! `_IS_ $this_script binutils` ]]; then
 (
 cat << EOF
 	@ROOT=\`head -n1 /tmp/unpacked | sed 's@^./@@;s@/.*@@'\` && \\
@@ -825,11 +826,11 @@
 	fi;
 EOF
 ) >> $MKFILE.tmp
-		fi
-	fi
+      fi
+    fi
 
     # Remove the Binutils pass 1 sources after a successful Adjusting phase.
-	if [[ `_IS_ $this_script adjusting` ]] ; then
+    if [[ `_IS_ $this_script adjusting` ]] ; then
 (
 cat << EOF
 	@rm -r \`cat sources-dir\` && \\
@@ -855,33 +856,33 @@
 #----------------------------#
 chapter6_Makefiles() {       # sysroot or chroot build phase
 #----------------------------#
-    local TARGET LOADER
+  local TARGET LOADER
 
-    #
-    # Set these definitions early and only once
-    #
-    if [[ ${MODEL} = "uclibc" ]]; then
-        TARGET="pc-linux-uclibc"; LOADER="ld-uClibc.so.0"
-    else
-        TARGET="pc-linux-gnu";    LOADER="ld-linux.so.2"
-    fi
+  #
+  # Set these definitions early and only once
+  #
+  if [[ ${MODEL} = "uclibc" ]]; then
+    TARGET="pc-linux-uclibc"; LOADER="ld-uClibc.so.0"
+  else
+    TARGET="pc-linux-gnu";    LOADER="ld-linux.so.2"
+  fi
 
-	echo -e "${YELLOW}	Processing Chapter-6 scripts ${OFF}"
+  echo -e "${YELLOW}  Processing Chapter-6 scripts ${OFF}"
   for file in chapter06/* ; do
     # Keep the script file name
     this_script=`basename $file`
 
     # Skip this script depending on jhahlfs.conf flags set.
-	case $this_script in
-			# We'll run the chroot commands differently than the others, so skip them in the
-			# dependencies and target creation.
-		*chroot* )	continue ;;
-		    # Test if the stripping phase must be skipped
-		*-stripping* )	[[ "$STRIP" = "0" ]] && continue ;;
-			# Select the appropriate library
-		*glibc*)		[[ ${MODEL} = "uclibc" ]] && continue ;;
-		*uclibc*)		[[ ${MODEL} = "glibc" ]]  && continue ;;
-		*) ;;
+    case $this_script in
+        # We'll run the chroot commands differently than the others, so skip them in the
+        # dependencies and target creation.
+      *chroot* )  continue ;;
+        # Test if the stripping phase must be skipped
+      *-stripping* )  [[ "$STRIP" = "0" ]] && continue ;;
+        # Select the appropriate library
+      *glibc*)    [[ ${MODEL} = "uclibc" ]] && continue ;;
+      *uclibc*)   [[ ${MODEL} = "glibc" ]]  && continue ;;
+      *) ;;
     esac
 
     # First append each name of the script files to a list (this will become
@@ -891,57 +892,57 @@
     # Grab the name of the target
     name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@'`
 
-	#
-	# Sed replacement for 'nodump' tag in xml scripts until Manuel has a chance to fix them
-	#
+    #
+    # Sed replacement for 'nodump' tag in xml scripts until Manuel has a chance to fix them
+    #
     case $name in
-		kernfs) # Remove sysctl code if host does not have grsecurity enabled
-			if [[ "$GRSECURITY_HOST" = "0" ]]; then
-			    sed '/sysctl/d' -i chapter06/$this_script
-			fi
-			;;
-		module-init-tools)
-				if [[ "$TEST" = "0" ]]; then  # This needs rework....
-				  sed '/make distclean/d' -i chapter06/$this_script
-				fi
-			;;
-		glibc)	# PATCH.. Turn off error trapping for the remainder of the script.
-				sed 's|^make install|make install; set +e|'  -i chapter06/$this_script
-			;;
-		uclibc)	# PATCH..
-				sed 's/EST5EDT/${TIMEZONE}/' -i chapter06/$this_script
-				# PATCH.. Cannot use interactive programs/scripts.
-				sed 's/make menuconfig/make oldconfig/' -i chapter06/$this_script
-				sed 's@^cd gettext-runtime at cd ../gettext-*/gettext-runtime@' -i chapter06/$this_script
-			;;
-		gcc)	# PATCH..
-				sed 's/rm /rm -f /' -i chapter06/$this_script
- 			;;
+      kernfs) # Remove sysctl code if host does not have grsecurity enabled
+        if [[ "$GRSECURITY_HOST" = "0" ]]; then
+            sed '/sysctl/d' -i chapter06/$this_script
+        fi 
+        ;;
+      module-init-tools)
+          if [[ "$TEST" = "0" ]]; then  # This needs rework....
+            sed '/make distclean/d' -i chapter06/$this_script
+          fi
+        ;;
+      glibc)  # PATCH.. Turn off error trapping for the remainder of the script.
+          sed 's|^make install|make install; set +e|'  -i chapter06/$this_script
+        ;;
+      uclibc) # PATCH..
+          sed 's/EST5EDT/${TIMEZONE}/' -i chapter06/$this_script
+          # PATCH.. Cannot use interactive programs/scripts.
+          sed 's/make menuconfig/make oldconfig/' -i chapter06/$this_script
+          sed 's@^cd gettext-runtime at cd ../gettext-*/gettext-runtime@' -i chapter06/$this_script
+        ;;
+      gcc)  # PATCH..
+          sed 's/rm /rm -f /' -i chapter06/$this_script
+        ;;
     esac
 
-	#--------------------------------------------------------------------#
-	#         >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<<          #
-	#--------------------------------------------------------------------#
-	#
-	# Drop in the name of the target on a new line, and the previous target
-	# as a dependency. Also call the echo_message function.
-	echo -e "\n$this_script:  $PREV
+    #--------------------------------------------------------------------#
+    #         >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<<          #
+    #--------------------------------------------------------------------#
+    #
+    # Drop in the name of the target on a new line, and the previous target
+    # as a dependency. Also call the echo_message function.
+    echo -e "\n$this_script:  $PREV
 	@\$(call echo_message, Building)" >> $MKFILE.tmp
 
     # Find the version of the command files, if it corresponds with the building of
     # a specific package
     vrs=`grep "^$name-version" $JHAHLFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
 
-	# If $vrs isn't empty, we've got a package...
-	# Insert instructions for unpacking the package and changing directories
-	if [ "$vrs" != "" ] ; then
-	# Deal with non-standard names
-	case $name in
-		tcl)	FILE="$name$vrs-src.tar.*" ;;
-		uclibc)	FILE="uClibc-$vrs.tar.*" ;;
-		gcc)	FILE="gcc-core-$vrs.tar.*" ;;
-		*)		FILE="$name-$vrs.tar.*" ;;
-	esac
+    # If $vrs isn't empty, we've got a package...
+    # Insert instructions for unpacking the package and changing directories
+    if [ "$vrs" != "" ] ; then
+      # Deal with non-standard names
+      case $name in
+        tcl)  FILE="$name$vrs-src.tar.*" ;;
+        uclibc) FILE="uClibc-$vrs.tar.*" ;;
+        gcc)  FILE="gcc-core-$vrs.tar.*" ;;
+        *)    FILE="$name-$vrs.tar.*" ;;
+      esac
 (
 cat  << EOF
 	@\$(call unpack2,$FILE)
@@ -954,16 +955,16 @@
     fi
 
     case $this_script in
-		*readjusting*) # For the Re-Adjusting phase we must to cd to the binutils-build directory.
-			echo -e '\t at echo "export PKGDIR=$(SRC)/binutils-build" > envars' >> $MKFILE.tmp
-			;;
-		*glibc* | *uclibc* ) # For glibc and uClibc we need to set TIMEZONE envar.
-			echo -e '\t at echo "export TIMEZONE=$(TIMEZONE)" >> envars' >> $MKFILE.tmp
-			;;
-		*groff* ) # For Groff we need to set PAGE envar.
-			echo -e '\t at echo "export PAGE=$(PAGE)" >> envars' >> $MKFILE.tmp
-			;;
-	esac
+      *readjusting*) # For the Re-Adjusting phase we must to cd to the binutils-build directory.
+        echo -e '\t at echo "export PKGDIR=$(SRC)/binutils-build" > envars' >> $MKFILE.tmp
+        ;;
+      *glibc* | *uclibc* ) # For glibc and uClibc we need to set TIMEZONE envar.
+        echo -e '\t at echo "export TIMEZONE=$(TIMEZONE)" >> envars' >> $MKFILE.tmp
+        ;;
+      *groff* ) # For Groff we need to set PAGE envar.
+        echo -e '\t at echo "export PAGE=$(PAGE)" >> envars' >> $MKFILE.tmp
+        ;;
+    esac
 
 
     # In the mount of kernel filesystems we need to set HLFS and not to use chroot.
@@ -1028,7 +1029,7 @@
 chapter7_Makefiles() {       # Create a bootable system.. kernel, bootscripts..etc
 #----------------------------#
 
-    echo  "${YELLOW}	Processing Chapter-7 scripts ${OFF}"
+  echo  "${YELLOW}  Processing Chapter-7 scripts ${OFF}"
   for file in chapter07/*; do
     # Keep the script file name
     this_script=`basename $file`
@@ -1038,57 +1039,57 @@
     # should enter the chroot environment to create the root
     # password, edit several files and setup Grub.
     case $this_script in
-	*grub)	  continue	;;
-	*reboot)  continue	;;
-	*console) continue	;; # Use the file generated by lfs-bootscripts
+      *grub)    continue  ;;
+      *reboot)  continue  ;;
+      *console) continue  ;; # Use the file generated by lfs-bootscripts
 
-	*kernel)	# How does Manuel add this string to the file..
-			  sed 's|cd \$PKGDIR.*||'					-i chapter07/$this_script
-				# You cannot run menuconfig from within the makefile
-    		  sed 's|make menuconfig|make oldconfig|'	-i chapter07/$this_script
-				# The files in the conglomeration dir are xxx.bz2
-			  sed 's|.patch.gz|.patch.bz2|'				-i chapter07/$this_script
-			  sed 's|gunzip|bunzip2|'					-i chapter07/$this_script
-				# If defined include the keymap in the kernel
-			  if [[ -n "$KEYMAP" ]]; then
-				sed "s|^loadkeys -m.*>|loadkeys -m $KEYMAP >|" -i chapter07/$this_script
-			  else
-				sed '/loadkeys -m/d'					-i chapter07/$this_script
-				sed '/drivers\/char/d'					-i chapter07/$this_script
-			  fi
-				# If no .config file is supplied, the kernel build is skipped
-			  [[ -z $CONFIG ]] && continue
-		;;
-	*usage)   # The script bombs, disable error trapping
-			  sed 's|set -e|set +e|'  -i chapter07/$this_script
-		;;
-	*profile) # Add the config values to the script
-			  sed "s|LC_ALL=\*\*EDITME.*EDITME\*\*|LC_ALL=$LC_ALL|" -i chapter07/$this_script
-			  sed "s|LANG=\*\*EDITME.*EDITME\*\*|LANG=$LANG|"       -i chapter07/$this_script
-		;;
+      *kernel)  # How does Manuel add this string to the file..
+        sed 's|cd \$PKGDIR.*||'         -i chapter07/$this_script
+        # You cannot run menuconfig from within the makefile
+          sed 's|make menuconfig|make oldconfig|' -i chapter07/$this_script
+        # The files in the conglomeration dir are xxx.bz2
+        sed 's|.patch.gz|.patch.bz2|'       -i chapter07/$this_script
+        sed 's|gunzip|bunzip2|'         -i chapter07/$this_script
+        # If defined include the keymap in the kernel
+        if [[ -n "$KEYMAP" ]]; then
+        sed "s|^loadkeys -m.*>|loadkeys -m $KEYMAP >|" -i chapter07/$this_script
+        else
+        sed '/loadkeys -m/d'          -i chapter07/$this_script
+        sed '/drivers\/char/d'          -i chapter07/$this_script
+        fi
+        # If no .config file is supplied, the kernel build is skipped
+        [[ -z $CONFIG ]] && continue
+         ;;
+      *usage)   # The script bombs, disable error trapping
+        sed 's|set -e|set +e|'  -i chapter07/$this_script
+         ;;
+      *profile) # Add the config values to the script
+        sed "s|LC_ALL=\*\*EDITME.*EDITME\*\*|LC_ALL=$LC_ALL|" -i chapter07/$this_script
+        sed "s|LANG=\*\*EDITME.*EDITME\*\*|LANG=$LANG|"       -i chapter07/$this_script
+         ;;
     esac
 
-	# First append then name of the script file to a list (this will become
-	# the names of the targets in the Makefile
-	chapter7="$chapter7 $this_script"
+    # First append then name of the script file to a list (this will become
+    # the names of the targets in the Makefile
+    chapter7="$chapter7 $this_script"
 
-	#--------------------------------------------------------------------#
-	#         >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<<          #
-	#--------------------------------------------------------------------#
-	#
-	# Drop in the name of the target on a new line, and the previous target
-	# as a dependency. Also call the echo_message function.
-	echo -e "\n$this_script:  $PREV
+    #--------------------------------------------------------------------#
+    #         >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<<          #
+    #--------------------------------------------------------------------#
+    #
+    # Drop in the name of the target on a new line, and the previous target
+    # as a dependency. Also call the echo_message function.
+    echo -e "\n$this_script:  $PREV
 	@\$(call echo_message, Building)" >> $MKFILE.tmp
 
-	if [[ `_IS_ $this_script bootscripts` ]] ; then
-    	vrs=`grep "^lfs-bootscripts-version" $JHAHLFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
-        FILE="lfs-bootscripts-$vrs.tar.*"
-		# The bootscript pkg references both lfs AND blfs bootscripts...
-		#  see XML script for other additions to bootscripts file
-		# PATCH
-        vrs=`grep "^blfs-bootscripts-version" $JHAHLFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
-		sed "s|make install$|make install; cd ../blfs-bootscripts-$vrs|" -i chapter07/$this_script
+    if [[ `_IS_ $this_script bootscripts` ]] ; then
+      vrs=`grep "^lfs-bootscripts-version" $JHAHLFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
+      FILE="lfs-bootscripts-$vrs.tar.*"
+      # The bootscript pkg references both lfs AND blfs bootscripts...
+      #  see XML script for other additions to bootscripts file
+      # PATCH
+      vrs=`grep "^blfs-bootscripts-version" $JHAHLFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
+      sed "s|make install$|make install; cd ../blfs-bootscripts-$vrs|" -i chapter07/$this_script
 (
 cat  << EOF
 	@\$(call unpack2,$FILE)
@@ -1097,12 +1098,12 @@
 	echo "\$(HLFS)\$(SRC)/blfs-bootscripts-$vrs" > sources-dir
 EOF
 ) >> $MKFILE.tmp
-	fi
+    fi
 
-	if [[ `_IS_ $this_script kernel` ]] ; then
-		# not much really, script does everything..
-		echo -e "\t at cp -f $CONFIG \$(HLFS)/sources/kernel-config" >> $MKFILE.tmp
-          fi
+    if [[ `_IS_ $this_script kernel` ]] ; then
+      # not much really, script does everything..
+      echo -e "\t at cp -f $CONFIG \$(HLFS)/sources/kernel-config" >> $MKFILE.tmp
+    fi
 
     # Check if we have a real /etc/fstab file
     if [[ `_IS_ $this_script fstab` ]] && [[ -n "$FSTAB" ]] ; then
@@ -1114,7 +1115,7 @@
 EOF
 ) >> $MKFILE.tmp
     else
-    # Initialize the log and run the script
+      # Initialize the log and run the script
 (
 cat << EOF
 	@echo -e "\n\`date\`\n\nKB: \`du -skx --exclude={0,1}??-* \$(HLFS)\`\n" >logs/$this_script && \\
@@ -1153,19 +1154,19 @@
 #----------------------------#
 build_Makefile() {           # Construct a Makefile from the book scripts
 #----------------------------#
-    echo -e "${GREEN}Creating Makefile... ${OFF}"
+  echo -e "${GREEN}Creating Makefile... ${OFF}"
 
-    cd $JHAHLFSDIR/commands
-    # Start with a clean Makefile.tmp file
-    >$MKFILE.tmp
+  cd $JHAHLFSDIR/commands
+  # Start with a clean Makefile.tmp file
+  >$MKFILE.tmp
 
-    chapter4_Makefiles
-    chapter5_Makefiles
-    chapter6_Makefiles
-    chapter7_Makefiles
+  chapter4_Makefiles
+  chapter5_Makefiles
+  chapter6_Makefiles
+  chapter7_Makefiles
 
-    # Add a header, some variables and include the function file
-    # to the top of the real Makefile.
+  # Add a header, some variables and include the function file
+  # to the top of the real Makefile.
 (
     cat << EOF
 $HEADER
@@ -1185,14 +1186,14 @@
   i=1
   for file in chapter06/*chroot* ; do
     chroot=`cat $file | sed -e '/#!\/bin\/sh/d' \
-			    -e '/^export/d' \
-			    -e '/^logout/d' \
-			    -e 's@ \\\@ @g' | tr -d '\n' |  sed -e 's/  */ /g' \
-													-e 's|\\$|&&|g' \
-													-e 's|exit||g' \
-													-e 's|$| -c|' \
-													-e 's|"$$HLFS"|$(HLFS)|'\
-													-e 's|set -e||'`
+          -e '/^export/d' \
+          -e '/^logout/d' \
+          -e 's@ \\\@ @g' | tr -d '\n' |  sed -e 's/  */ /g' \
+                                              -e 's|\\$|&&|g' \
+                                              -e 's|exit||g' \
+                                              -e 's|$| -c|' \
+                                              -e 's|"$$HLFS"|$(HLFS)|'\
+                                              -e 's|set -e||'`
     echo -e "CHROOT$i= $chroot\n" >> $MKFILE
     i=`expr $i + 1`
   done
@@ -1200,7 +1201,7 @@
   # Drop in the main target 'all:' and the chapter targets with each sub-target
   # as a dependency.
 (
-	cat << EOF
+  cat << EOF
 all:  chapter4 chapter5 chapter6 chapter7
 	@\$(call echo_finished,$VERSION)
 
@@ -1213,7 +1214,7 @@
 chapter7:  chapter6 $chapter7
 
 clean-all:  clean
-	rm -rf ./{commands,logs,Makefile,dump-hlfs-scripts.xsl,functions,packages,patches}
+	 rm -rf ./{commands,logs,Makefile,dump-hlfs-scripts.xsl,functions,packages,patches}
 
 clean:  clean-chapter7 clean-chapter6 clean-chapter5 clean-chapter4
 
@@ -1260,29 +1261,29 @@
 EOF
 ) >> $MKFILE
 
-	# Bring over the items from the Makefile.tmp
-	cat $MKFILE.tmp >> $MKFILE
-	rm $MKFILE.tmp
-	echo -ne "${GREEN}done\n${OFF}"
+  # Bring over the items from the Makefile.tmp
+  cat $MKFILE.tmp >> $MKFILE
+  rm $MKFILE.tmp
+  echo -ne "${GREEN}done\n${OFF}"
 }
 
 #----------------------------#
 run_make() {                 # Execute the newly constructed Makefile
 #----------------------------#
-	# Test if make must be run.
-	if [ "$RUNMAKE" = "1" ] ; then
-		# Test to make sure we're running the build as root
-		if [ "$UID" != "0" ] ; then
-			echo "You must be logged in as root to successfully build HLFS."
-			exit 1
-		fi
-		# Build the system
-		if [ -e $MKFILE ] ; then
-			echo -ne "Building the HLFS system...\n"
-			cd $JHAHLFSDIR && make
-			echo -ne "done\n"
-		fi
-	fi
+  # Test if make must be run.
+  if [ "$RUNMAKE" = "1" ] ; then
+    # Test to make sure we're running the build as root
+    if [ "$UID" != "0" ] ; then
+      echo "You must be logged in as root to successfully build HLFS."
+      exit 1
+    fi
+    # Build the system
+    if [ -e $MKFILE ] ; then
+      echo -ne "Building the HLFS system...\n"
+      cd $JHAHLFSDIR && make
+      echo -ne "done\n"
+    fi
+  fi
 }
 
 
@@ -1297,16 +1298,16 @@
   case $1 in
     --version | -V ) 'clear'; echo "$version" ; exit 0; ;;
     --help | -h )  usage | less
-				  'clear' ; exit 0
-		;;
+          'clear' ; exit 0
+    ;;
 
     --HLFS-version | -L )
       test $# = 1 && eval "$exit_missing_arg"
       shift
       case $1 in
         dev* | SVN | trunk )
-		  BOOK=""	# necessary to overide any value set inside jhahlfs.conf
-		  WC=
+      BOOK="" # necessary to overide any value set inside jhahlfs.conf
+      WC=
           HLFSVRS=development
           ;;
         * )
@@ -1338,15 +1339,15 @@
       fi
       ;;
 
-    --get-packages | -P )	HPKG=1 ;;
-    --run-make | -M )		RUNMAKE=1 ;;
-    --rebuild )				CLEAN=1 ;;
+    --get-packages | -P ) HPKG=1 ;;
+    --run-make | -M )   RUNMAKE=1 ;;
+    --rebuild )       CLEAN=1 ;;
 
     --readme )
-		'clear'
-		echo "$_inline_doc" | less
-		'clear'; exit
-		;;
+    'clear'
+    echo "$_inline_doc" | less
+    'clear'; exit
+    ;;
 
     --fstab )
       test $# = 1 && eval "$exit_missing_arg"
@@ -1379,14 +1380,14 @@
 
 # Prevents setting "-d /" by mistake.
 if [ $BUILDDIR = / ] ; then
-    echo -ne "\nThe root directory can't be used to build HLFS.\n\n"
-    exit 1
+   echo -ne "\nThe root directory can't be used to build HLFS.\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
-	no_empty_builddir
+  no_empty_builddir
 fi
 
 # If requested, clean the build directory
@@ -1407,20 +1408,20 @@
 # if set by conf file leave it alone otherwise load the specified version
 BOOK=${BOOK:=hlfs-$HLFSVRS}
 
-[[ ! -d $JHAHLFSDIR ]]	&& mkdir -pv $JHAHLFSDIR
-[[ ! -d $LOGDIR ]]		&& mkdir -v $LOGDIR
+[[ ! -d $JHAHLFSDIR ]]  && mkdir -pv $JHAHLFSDIR
+[[ ! -d $LOGDIR ]]    && mkdir -v $LOGDIR
 if [[ "$PWD" != "$JHAHLFSDIR" ]]; then
-	cp -v $FILES $JHAHLFSDIR/
-	sed 's,FAKEDIR,'$BOOK',' $XSL > $JHAHLFSDIR/dump-hlfs-scripts.xsl
-	export XSL=$JHAHLFSDIR/dump-hlfs-scripts.xsl
+  cp -v $FILES $JHAHLFSDIR/
+  sed 's,FAKEDIR,'$BOOK',' $XSL > $JHAHLFSDIR/dump-hlfs-scripts.xsl
+  export XSL=$JHAHLFSDIR/dump-hlfs-scripts.xsl
 fi
 
 >$LOGDIR/$LOG
 
 
 # Check for minumum gcc and kernel versions
-check_requirements	1	# 0/1  0-do not display values.
-validate_config		1	# 0/1  0-do not display values
+check_requirements  1 # 0/1  0-do not display values.
+validate_config     1 # 0/1  0-do not display values
 get_book
 build_Makefile
 run_make




More information about the alfs-log mailing list