r2729 - in jhalfs/trunk: CLFS HLFS LFS common

jhuntwork at linuxfromscratch.org jhuntwork at linuxfromscratch.org
Sat May 27 14:22:44 PDT 2006


Author: jhuntwork
Date: 2006-05-27 15:22:42 -0600 (Sat, 27 May 2006)
New Revision: 2729

Modified:
   jhalfs/trunk/CLFS/master.sh
   jhalfs/trunk/HLFS/master.sh
   jhalfs/trunk/LFS/master.sh
   jhalfs/trunk/common/common-functions
Log:
Added instructions to always remove source and -build directories before running specific package commands

Modified: jhalfs/trunk/CLFS/master.sh
===================================================================
--- jhalfs/trunk/CLFS/master.sh	2006-05-27 18:50:20 UTC (rev 2728)
+++ jhalfs/trunk/CLFS/master.sh	2006-05-27 21:22:42 UTC (rev 2729)
@@ -131,7 +131,7 @@
     #
     # If $vrs isn't empty, we've got a package...
     #
-    [[ "$vrs" != "" ]] && wrt_unpack "$name-$vrs.tar.*"
+    [[ "$vrs" != "" ]] && wrt_remove_build_dirs "${name}" && wrt_unpack "$name-$vrs.tar.*"
     #
     wrt_run_as_su "${this_script}" "${file}"
     #
@@ -183,7 +183,7 @@
     # If $vrs isn't empty, we've got a package...
     # Insert instructions for unpacking the package and to set the PKGDIR variable.
     #
-    [[ "$vrs" != "" ]] && wrt_unpack "$name-$vrs.tar.*"
+    [[ "$vrs" != "" ]] && wrt_remove_build_dirs "${name}" && wrt_unpack "$name-$vrs.tar.*"
     [[ "$vrs" != "" ]] && [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
     #
     wrt_run_as_su "${this_script}" "${file}"
@@ -255,7 +255,7 @@
     # If $vrs isn't empty, we've got a package...
     # Insert instructions for unpacking the package and changing directories
     #
-    [[ "$vrs" != "" ]] && wrt_unpack "$name-$vrs.tar.*"
+    [[ "$vrs" != "" ]] && wrt_remove_build_dirs "${name}" && wrt_unpack "$name-$vrs.tar.*"
     [[ "$vrs" != "" ]] && [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
     #
     # Select a script execution method
@@ -324,8 +324,8 @@
     #
     if [ "$vrs" != "" ] ; then
       case $this_script in
-        *util-linux)    wrt_unpack  "$name-$vrs.tar.*"  ;;
-        *)              wrt_unpack2 "$name-$vrs.tar.*"  ;;
+        *util-linux)    wrt_remove_build_dirs "${name}" && wrt_unpack  "$name-$vrs.tar.*"  ;;
+        *)              wrt_remove_build_dirs "${name}" && wrt_unpack2 "$name-$vrs.tar.*"  ;;
       esac
       [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
     fi
@@ -385,8 +385,8 @@
     wrt_target "${this_script}" "$PREV"
     #
     case $name in
-      tcl)    wrt_unpack2 "$name$vrs-src.tar.*" ;;
-      *)      wrt_unpack2 "$name-$vrs.tar.*"    ;;
+      tcl)    wrt_remove_build_dirs "${name}" && wrt_unpack2 "$name$vrs-src.tar.*" ;;
+      *)      wrt_remove_build_dirs "${name}" && wrt_unpack2 "$name-$vrs.tar.*"    ;;
     esac
     [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
     #
@@ -440,8 +440,8 @@
     wrt_target "${this_script}" "$PREV"
     #
     case $name in
-      tcl)    wrt_unpack3 "$name$vrs-src.tar.*" ;;
-      *)      wrt_unpack3 "$name-$vrs.tar.*"    ;;
+      tcl)    wrt_remove_build_dirs2 "${name}" && wrt_unpack3 "$name$vrs-src.tar.*" ;;
+      *)      wrt_remove_build_dirs2 "${name}" && wrt_unpack3 "$name-$vrs.tar.*"    ;;
     esac
     [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
     #
@@ -541,6 +541,7 @@
     # If $vrs isn't empty, we've got a package...
     if [ "$vrs" != "" ] ; then
       FILE="$name-$vrs.tar.*"
+      wrt_remove_build_dirs "${name}"
       wrt_unpack2 "$FILE"
       [[ "$OPTIMIZE" != "0" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
     fi
@@ -644,6 +645,7 @@
     # If $vrs isn't empty, we've got a package...
     if [ "$vrs" != "" ] ; then
       FILE="$name-$vrs.tar.*"
+      wrt_remove_build_dirs2 "${name}"
       wrt_unpack3 "$FILE"
       [[ "$OPTIMIZE" != "0" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
     fi
@@ -708,7 +710,7 @@
     #
     # If $vrs isn't empty, we've got a package...
     #
-    [[ "$vrs" != "" ]] && wrt_unpack2 "$name-$vrs.tar.*"
+    [[ "$vrs" != "" ]] && wrt_remove_build_dirs "${name}" && wrt_unpack2 "$name-$vrs.tar.*"
     #
     wrt_run_as_chroot1 "${this_script}" "${file}"
     #
@@ -769,7 +771,7 @@
     #
     # If $vrs isn't empty, we've got a package...
     #
-    [[ "$vrs" != "" ]] && wrt_unpack3 "$name-$vrs.tar.*"
+    [[ "$vrs" != "" ]] && wrt_remove_build_dirs2 "${name}" && wrt_unpack3 "$name-$vrs.tar.*"
     #
     wrt_run_as_root2 "${this_script}" "${file}"
     #
@@ -833,7 +835,7 @@
     # If $vrs isn't empty, we've got a package...
     # Insert instructions for unpacking the package and changing directories
     #
-    [[ "$vrs" != "" ]] && wrt_unpack2 "$name-$vrs.tar.*"
+    [[ "$vrs" != "" ]] && wrt_remove_build_dirs "${name}" && wrt_unpack2 "$name-$vrs.tar.*"
     #
     # Select a script execution method
     case $this_script in
@@ -911,7 +913,7 @@
     # If $vrs isn't empty, we've got a package...
     # Insert instructions for unpacking the package and changing directories
     #
-    [[ "$vrs" != "" ]] && wrt_unpack3 "$name-$vrs.tar.*"
+    [[ "$vrs" != "" ]] && wrt_remove_build_dirs2 "${name}" && wrt_unpack3 "$name-$vrs.tar.*"
     #
     # Select a script execution method
     case $this_script in

Modified: jhalfs/trunk/HLFS/master.sh
===================================================================
--- jhalfs/trunk/HLFS/master.sh	2006-05-27 18:50:20 UTC (rev 2728)
+++ jhalfs/trunk/HLFS/master.sh	2006-05-27 21:22:42 UTC (rev 2729)
@@ -140,6 +140,10 @@
         gcc)    FILE="gcc-core-$vrs.tar.*"  ;;
         *)      FILE="$name-$vrs.tar.*"     ;;
       esac
+      # Always remove possibly exiting unpacked source directories before beginning
+      # to build. This prevent build failures from fogetting to manually remove
+      # directories from previous runs of jhalfs.
+      wrt_remove_build_dirs "$name"
       # Insert instructions for unpacking the package and to set the PKGDIR variable.
       wrt_unpack "$FILE"
       [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
@@ -307,6 +311,10 @@
         gcc)    FILE="gcc-core-$vrs.tar.*" ;;
         *)      FILE="$name-$vrs.tar.*" ;;
       esac
+      # Always remove possibly exiting unpacked source directories before beginning
+      # to build. This prevent build failures from fogetting to manually remove
+      # directories from previous runs of jhalfs.
+      wrt_remove_build_dirs "$name"
       wrt_unpack2 "$FILE"
       wrt_target_vars
       [[ "$OPTIMIZE" != "0" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
@@ -571,6 +579,7 @@
 		userdel lfs; \\
 		rm -rf /home/lfs; \\
 	fi;
+	-rm -f /tmp/unpacked
 	
 EOF
 ) >> $MKFILE

Modified: jhalfs/trunk/LFS/master.sh
===================================================================
--- jhalfs/trunk/LFS/master.sh	2006-05-27 18:50:20 UTC (rev 2728)
+++ jhalfs/trunk/LFS/master.sh	2006-05-27 21:22:42 UTC (rev 2729)
@@ -109,7 +109,10 @@
       else
         FILE="$name-$vrs.tar.*"
       fi
-
+      # Always remove possibly exiting unpacked source directories before beginning
+      # to build. This prevent build failures from fogetting to manually remove
+      # directories from previous runs of jhalfs.
+      wrt_remove_build_dirs "$name"
       # Insert instructions for unpacking the package and to set the PKGDIR variable.
       wrt_unpack "$FILE"
       [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
@@ -215,6 +218,10 @@
     # Insert instructions for unpacking the package and changing directories
     if [ "$vrs" != "" ] ; then
       FILE="$name-$vrs.tar.*"
+      # Always remove possibly exiting unpacked source directories before beginning
+      # to build. This prevent build failures from fogetting to manually remove
+      # directories from previous runs of jhalfs.
+      wrt_remove_build_dirs "$name"
       wrt_unpack2 "$FILE"
       [[ "$OPTIMIZE" != "0" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
     fi
@@ -442,6 +449,7 @@
 		userdel lfs; \\
 		rm -rf /home/lfs; \\
 	fi;
+	-rm -f /tmp/unpacked
 	
 EOF
 ) >> $MKFILE

Modified: jhalfs/trunk/common/common-functions
===================================================================
--- jhalfs/trunk/common/common-functions	2006-05-27 18:50:20 UTC (rev 2728)
+++ jhalfs/trunk/common/common-functions	2006-05-27 21:22:42 UTC (rev 2729)
@@ -211,6 +211,7 @@
 wrt_unpack() {                     # Unpack and set 'ROOT' var
 #----------------------------------#
   local FILE=$1
+  local file=$2
 (
 cat << EOF
 	@\$(call unpack,$FILE)
@@ -363,9 +364,11 @@
   local name=$1
 (
 cat << EOF
-	@ROOT=\`head -n1 /tmp/unpacked | sed 's@^./@@;s@/.*@@'\` && \\
-	rm -r \$(MOUNT_PT)\$(SRC)/\$\$ROOT && \\
-	if [ -e \$(MOUNT_PT)\$(SRC)/$name-build ]; then \\
+	@if [ -f /tmp/unpacked ] ; then \\
+	 	ROOT=\`head -n1 /tmp/unpacked | sed 's@^./@@;s@/.*@@'\` && \\
+	 	if [ "x" != "x\$\$ROOT" ] ; then rm -r \$(MOUNT_PT)\$(SRC)/\$\$ROOT; fi; \\
+	fi;
+	@if [ -e \$(MOUNT_PT)\$(SRC)/$name-build ]; then \\
 		rm -r \$(MOUNT_PT)\$(SRC)/$name-build; \\
 	fi;
 EOF
@@ -379,9 +382,11 @@
   local name=$1
 (
 cat << EOF
-	@ROOT=\`head -n1 /tmp/unpacked | sed 's@^./@@;s@/.*@@'\` && \\
-	rm -r \$(SRC)/\$\$ROOT && \\
-	if [ -e \$(SRC)/$name-build ]; then \\
+	@if [ -f /tmp/unpacked ] ; then \\
+		ROOT=\`head -n1 /tmp/unpacked | sed 's@^./@@;s@/.*@@'\` && \\
+		if [ "x" != "x\$\$ROOT" ] ; then rm -r \$(SRC)/\$\$ROOT; fi; \\
+	fi;
+	@if [ -e \$(SRC)/$name-build ]; then \\
 		rm -r \$(SRC)/$name-build; \\
 	fi;
 EOF




More information about the alfs-log mailing list