r2452 - jhalfs/branches/experimental/HLFS

georgeb at linuxfromscratch.org georgeb at linuxfromscratch.org
Wed Mar 29 06:31:03 PST 2006


Author: georgeb
Date: 2006-03-29 07:31:02 -0700 (Wed, 29 Mar 2006)
New Revision: 2452

Modified:
   jhalfs/branches/experimental/HLFS/master.sh
Log:
HLFS/master.sh,  remove us of _IS_ function

Modified: jhalfs/branches/experimental/HLFS/master.sh
===================================================================
--- jhalfs/branches/experimental/HLFS/master.sh	2006-03-29 14:01:38 UTC (rev 2451)
+++ jhalfs/branches/experimental/HLFS/master.sh	2006-03-29 14:31:02 UTC (rev 2452)
@@ -253,13 +253,17 @@
     # (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
-      wrt_remove_build_dirs "$name"
-      fi
+      case "${this_script}" in
+        *binutils*) : # do NOTHING
+          ;;
+        *) wrt_remove_build_dirs "$name"
+          ;;
+      esac
     fi
 
     # Remove the Binutils pass 1 sources after a successful Adjusting phase.
-    if [[ `_IS_ $this_script adjusting` ]] ; then
+    case "${this_script}" in
+     *adjusting*)
 (
 cat << EOF
 	@rm -r \`cat sources-dir\` && \\
@@ -267,7 +271,8 @@
 	rm sources-dir
 EOF
 ) >> $MKFILE.tmp
-    fi
+      ;;
+    esac
 
     # Include a touch of the target name so make can check if it's already been made.
     echo -e '\t at touch $@' >> $MKFILE.tmp
@@ -366,21 +371,23 @@
     esac
 
     # In the mount of kernel filesystems we need to set LFS and not to use chroot.
-    if [[ `_IS_ $this_script kernfs` ]] ; then
-      wrt_run_as_root "${this_script}" "${file}"
+    case "${this_script}" in
+      *kernfs*)
+        wrt_run_as_root "${this_script}" "${file}"
+        ;;
+      *)   # The rest of Chapter06
+        wrt_run_as_chroot1 "${this_script}" "${file}"
+       ;;
+    esac
     #
-    # The rest of Chapter06
-    else
-      wrt_run_as_chroot1 "${this_script}" "${file}"
-    fi
-    #
     # Remove the build directory(ies) except if the package build fails.
     if [ "$vrs" != "" ] ; then
       wrt_remove_build_dirs "$name"
     fi
     #
     # Remove the Binutils pass 2 sources after a successful Re-Adjusting phase.
-    if [[ `_IS_ $this_script readjusting` ]] ; then
+    case "${this_script}" in
+      *readjusting*)
 (
 cat << EOF
 	@rm -r \`cat sources-dir\` && \\
@@ -388,7 +395,8 @@
 	rm sources-dir
 EOF
 ) >> $MKFILE.tmp
-    fi
+      ;;
+    esac
 
     # Include a touch of the target name so make can check if it's already been made.
     echo -e '\t at touch $@' >> $MKFILE.tmp
@@ -443,24 +451,32 @@
     # as a dependency. Also call the echo_message function.
     wrt_target "$this_script" "$PREV"
 
-    if [[ `_IS_ $this_script bootscripts` ]] ; then
-      vrs=`grep "^lfs-bootscripts-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
-      FILE="lfs-bootscripts-$vrs.tar.*"
-      wrt_unpack2 "$FILE"
-      vrs=`grep "^blfs-bootscripts-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
-      echo -e "\t at echo \"\$(MOUNT_PT)\$(SRC)/blfs-bootscripts-$vrs\" >> sources-dir" >> $MKFILE.tmp
-    fi
+    case "${this_script}" in
+      *bootscripts*) 
+        vrs=`grep "^lfs-bootscripts-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
+        FILE="lfs-bootscripts-$vrs.tar.*"
+        wrt_unpack2 "$FILE"
+        vrs=`grep "^blfs-bootscripts-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
+        echo -e "\t at echo \"\$(MOUNT_PT)\$(SRC)/blfs-bootscripts-$vrs\" >> sources-dir" >> $MKFILE.tmp
+        ;;
+    esac
 
-    # Check if we have a real /etc/fstab file
-    if [[ `_IS_ $this_script fstab` ]] && [[ -n "$FSTAB" ]] ; then
-      wrt_copy_fstab "$this_script"
-    else
-      # Initialize the log and run the script
-      wrt_run_as_chroot2 "${this_script}" "${file}"
-    fi
+    case "${this_script}" in 
+      *fstab*) # Check if we have a real /etc/fstab file
+        if [[ -n "$FSTAB" ]] ; then
+          wrt_copy_fstab "$this_script"
+        else  # Initialize the log and run the script
+          wrt_run_as_chroot2 "${this_script}" "${file}"
+        fi
+        ;;
+      *)  # All other scripts
+        wrt_run_as_chroot2 "${this_script}" "${file}"
+        ;;
+    esac
 
     # Remove the build directory except if the package build fails.
-    if [[ `_IS_ $this_script bootscripts` ]]; then
+    case "${this_script}" in
+      *bootscripts*)
 (
 cat << EOF
 	@ROOT=\`head -n1 /tmp/unpacked | sed 's@^./@@;s@/.*@@'\` && \\
@@ -469,7 +485,8 @@
 	rm sources-dir
 EOF
 ) >> $MKFILE.tmp
-    fi
+       ;;
+    esac
 
     # Include a touch of the target name so make can check if it's already been made.
     echo -e '\t at touch $@' >> $MKFILE.tmp




More information about the alfs-log mailing list