Index: LFS/master.sh
===================================================================
--- LFS/master.sh	(revision c6506aea235ba3a7260861a77d4aea9bdce475d2)
+++ LFS/master.sh	(revision 2758d9421e479d9a91bbae7a91cff4b4019fa76c)
@@ -117,6 +117,6 @@
     #
     # Find the name of the tarball and the version of the package
-    pkg_tarball=$(get_package_tarball_name $name)
-    pkg_version=$(get_package_version $pkg_tarball)
+    pkg_tarball=$(sed -n 's/tar -xf \(.*\)/\1/p' $file)
+    pkg_version=$(sed -n 's/VERSION=\(.*\)/\1/p' $file)
 
     # Drop in the name of the target on a new line, and the previous target
@@ -126,6 +126,4 @@
     # If $pkg_tarball isn't empty, we've got a package...
     if [ "$pkg_tarball" != "" ] ; then
-      # Insert instructions for unpacking the package and to set the PKGDIR variable.
-      LUSER_wrt_unpack "$pkg_tarball"
       # Always initialize the log file, since the test instructions may be
       # "uncommented" by the user
@@ -146,13 +144,4 @@
       *)               LUSER_wrt_RunAsUser "$file" "$pkg_version" ;;
     esac
-
-    # Remove the build directory(ies) except if the package build fails
-    # (so we can review config.cache, config.log, etc.)
-    if [ "$pkg_tarball" != "" ] ; then
-	case "${name}" in
-	*xz-utils) LUSER_RemoveBuildDirs "xz" ;;
-	*) LUSER_RemoveBuildDirs "$name" ;;
-	esac
-    fi
 
     # Include a touch of the target name so make can check
@@ -217,6 +206,6 @@
     # Find the tarball corresponding to our script.
     # If it doesn't, we skip it in iterations rebuilds (except stripping).
-    pkg_tarball=$(get_package_tarball_name $name)
-    pkg_version=$(get_package_version $pkg_tarball)
+    pkg_tarball=$(sed -n 's/tar -xf \(.*\)/\1/p' $file)
+    pkg_version=$(sed -n 's/VERSION=\(.*\)/\1/p' $file)
 
     if [[ "$pkg_tarball" = "" ]] && [[ -n "$N" ]] ; then
@@ -256,5 +245,4 @@
         CHROOT_wrt_TouchTimestamp
       fi
-      CHROOT_Unpack "$pkg_tarball"
       # Always initialize the log file, so that the use may reinstate a
       # commented out test
@@ -274,8 +262,4 @@
     # except if the package build fails.
     if [ "$pkg_tarball" != "" ] ; then
-      case "${name}" in
-	*xz-utils) CHROOT_wrt_RemoveBuildDirs "xz" ;;
-	*) CHROOT_wrt_RemoveBuildDirs "$name" ;;
-      esac
       if [ "${INSTALL_LOG}" = "y" ] && [ "x${N}" = "x" ] ; then
         CHROOT_wrt_LogNewFiles "$name"
@@ -337,25 +321,19 @@
       *bootscripts)
             name="lfs-bootscripts"
-            pkg_tarball=$(get_package_tarball_name $name)
             if [ "${INSTALL_LOG}" = "y" ] ; then
               CHROOT_wrt_TouchTimestamp
             fi
-            CHROOT_Unpack "$pkg_tarball"
         ;;
       *network-scripts)
             name="lfs-network-scripts"
-            pkg_tarball=$(get_package_tarball_name $name)
             if [ "${INSTALL_LOG}" = "y" ] ; then
               CHROOT_wrt_TouchTimestamp
             fi
-            CHROOT_Unpack "$pkg_tarball"
         ;;
       *kernel)
             name="linux"
-            pkg_tarball=$(get_package_tarball_name $name)
             if [ "${INSTALL_LOG}" = "y" ] ; then
               CHROOT_wrt_TouchTimestamp
             fi
-            CHROOT_Unpack "$pkg_tarball"
             # If using optimizations, use MAKEFLAGS (unless blacklisted)
             # no setting of CFLAGS and friends.
@@ -377,18 +355,9 @@
 
     case "${this_script}" in
-      *bootscripts)      CHROOT_wrt_RemoveBuildDirs "dummy"
+      *bootscripts|*network-scripts|*kernel)
                          if [ "${INSTALL_LOG}" = "y" ] ; then
                            CHROOT_wrt_LogNewFiles "$name"
                          fi ;;
-      *network-scripts)  CHROOT_wrt_RemoveBuildDirs "dummy"
-                         if [ "${INSTALL_LOG}" = "y" ] ; then
-                           CHROOT_wrt_LogNewFiles "$name"
-                         fi ;;
-      *kernel)           CHROOT_wrt_RemoveBuildDirs "dummy"
-                         if [ "${INSTALL_LOG}" = "y" ] ; then
-                           CHROOT_wrt_LogNewFiles "$name"
-                         fi ;;
-    esac
-
+    esac
     # Include a touch of the target name so make can check
     # if it's already been made.
