Added instructions to always remove source and -build directories before running specific package commands

This commit is contained in:
Jeremy Huntwork 2006-05-27 21:22:42 +00:00
parent f358747c6a
commit ab7bac5dc2
4 changed files with 44 additions and 20 deletions

View file

@ -131,7 +131,7 @@ cross_tools_Makefiles() { #
# #
# If $vrs isn't empty, we've got a package... # 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}" wrt_run_as_su "${this_script}" "${file}"
# #
@ -183,7 +183,7 @@ temptools_Makefiles() { #
# If $vrs isn't empty, we've got a package... # If $vrs isn't empty, we've got a package...
# Insert instructions for unpacking the package and to set the PKGDIR variable. # 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" [[ "$vrs" != "" ]] && [[ "$OPTIMIZE" = "2" ]] && wrt_optimize "$name" && wrt_makeflags "$name"
# #
wrt_run_as_su "${this_script}" "${file}" wrt_run_as_su "${this_script}" "${file}"
@ -255,7 +255,7 @@ boot_Makefiles() { #
# If $vrs isn't empty, we've got a package... # If $vrs isn't empty, we've got a package...
# Insert instructions for unpacking the package and changing directories # 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" [[ "$vrs" != "" ]] && [[ "$OPTIMIZE" = "2" ]] && wrt_optimize "$name" && wrt_makeflags "$name"
# #
# Select a script execution method # Select a script execution method
@ -324,8 +324,8 @@ chroot_Makefiles() { #
# #
if [ "$vrs" != "" ] ; then if [ "$vrs" != "" ] ; then
case $this_script in case $this_script in
*util-linux) wrt_unpack "$name-$vrs.tar.*" ;; *util-linux) wrt_remove_build_dirs "${name}" && wrt_unpack "$name-$vrs.tar.*" ;;
*) wrt_unpack2 "$name-$vrs.tar.*" ;; *) wrt_remove_build_dirs "${name}" && wrt_unpack2 "$name-$vrs.tar.*" ;;
esac esac
[[ "$OPTIMIZE" = "2" ]] && wrt_optimize "$name" && wrt_makeflags "$name" [[ "$OPTIMIZE" = "2" ]] && wrt_optimize "$name" && wrt_makeflags "$name"
fi fi
@ -385,8 +385,8 @@ testsuite_tools_Makefiles() { #
wrt_target "${this_script}" "$PREV" wrt_target "${this_script}" "$PREV"
# #
case $name in case $name in
tcl) wrt_unpack2 "$name$vrs-src.tar.*" ;; tcl) wrt_remove_build_dirs "${name}" && wrt_unpack2 "$name$vrs-src.tar.*" ;;
*) wrt_unpack2 "$name-$vrs.tar.*" ;; *) wrt_remove_build_dirs "${name}" && wrt_unpack2 "$name-$vrs.tar.*" ;;
esac esac
[[ "$OPTIMIZE" = "2" ]] && wrt_optimize "$name" && wrt_makeflags "$name" [[ "$OPTIMIZE" = "2" ]] && wrt_optimize "$name" && wrt_makeflags "$name"
# #
@ -440,8 +440,8 @@ bm_testsuite_tools_Makefiles() { #
wrt_target "${this_script}" "$PREV" wrt_target "${this_script}" "$PREV"
# #
case $name in case $name in
tcl) wrt_unpack3 "$name$vrs-src.tar.*" ;; tcl) wrt_remove_build_dirs2 "${name}" && wrt_unpack3 "$name$vrs-src.tar.*" ;;
*) wrt_unpack3 "$name-$vrs.tar.*" ;; *) wrt_remove_build_dirs2 "${name}" && wrt_unpack3 "$name-$vrs.tar.*" ;;
esac esac
[[ "$OPTIMIZE" = "2" ]] && wrt_optimize "$name" && wrt_makeflags "$name" [[ "$OPTIMIZE" = "2" ]] && wrt_optimize "$name" && wrt_makeflags "$name"
# #
@ -541,6 +541,7 @@ final_system_Makefiles() { #
# If $vrs isn't empty, we've got a package... # If $vrs isn't empty, we've got a package...
if [ "$vrs" != "" ] ; then if [ "$vrs" != "" ] ; then
FILE="$name-$vrs.tar.*" FILE="$name-$vrs.tar.*"
wrt_remove_build_dirs "${name}"
wrt_unpack2 "$FILE" wrt_unpack2 "$FILE"
[[ "$OPTIMIZE" != "0" ]] && wrt_optimize "$name" && wrt_makeflags "$name" [[ "$OPTIMIZE" != "0" ]] && wrt_optimize "$name" && wrt_makeflags "$name"
fi fi
@ -644,6 +645,7 @@ bm_final_system_Makefiles() { #
# If $vrs isn't empty, we've got a package... # If $vrs isn't empty, we've got a package...
if [ "$vrs" != "" ] ; then if [ "$vrs" != "" ] ; then
FILE="$name-$vrs.tar.*" FILE="$name-$vrs.tar.*"
wrt_remove_build_dirs2 "${name}"
wrt_unpack3 "$FILE" wrt_unpack3 "$FILE"
[[ "$OPTIMIZE" != "0" ]] && wrt_optimize "$name" && wrt_makeflags "$name" [[ "$OPTIMIZE" != "0" ]] && wrt_optimize "$name" && wrt_makeflags "$name"
fi fi
@ -708,7 +710,7 @@ bootscripts_Makefiles() { #
# #
# If $vrs isn't empty, we've got a package... # 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}" wrt_run_as_chroot1 "${this_script}" "${file}"
# #
@ -769,7 +771,7 @@ bm_bootscripts_Makefiles() { #
# #
# If $vrs isn't empty, we've got a package... # 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}" wrt_run_as_root2 "${this_script}" "${file}"
# #
@ -833,7 +835,7 @@ bootable_Makefiles() { #
# If $vrs isn't empty, we've got a package... # If $vrs isn't empty, we've got a package...
# Insert instructions for unpacking the package and changing directories # 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 # Select a script execution method
case $this_script in case $this_script in
@ -911,7 +913,7 @@ bm_bootable_Makefiles() { #
# If $vrs isn't empty, we've got a package... # If $vrs isn't empty, we've got a package...
# Insert instructions for unpacking the package and changing directories # 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 # Select a script execution method
case $this_script in case $this_script in

View file

@ -140,6 +140,10 @@ chapter5_Makefiles() { # Bootstrap or temptools phase
gcc) FILE="gcc-core-$vrs.tar.*" ;; gcc) FILE="gcc-core-$vrs.tar.*" ;;
*) FILE="$name-$vrs.tar.*" ;; *) FILE="$name-$vrs.tar.*" ;;
esac 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. # Insert instructions for unpacking the package and to set the PKGDIR variable.
wrt_unpack "$FILE" wrt_unpack "$FILE"
[[ "$OPTIMIZE" = "2" ]] && wrt_optimize "$name" && wrt_makeflags "$name" [[ "$OPTIMIZE" = "2" ]] && wrt_optimize "$name" && wrt_makeflags "$name"
@ -307,6 +311,10 @@ chapter6_Makefiles() { # sysroot or chroot build phase
gcc) FILE="gcc-core-$vrs.tar.*" ;; gcc) FILE="gcc-core-$vrs.tar.*" ;;
*) FILE="$name-$vrs.tar.*" ;; *) FILE="$name-$vrs.tar.*" ;;
esac 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_unpack2 "$FILE"
wrt_target_vars wrt_target_vars
[[ "$OPTIMIZE" != "0" ]] && wrt_optimize "$name" && wrt_makeflags "$name" [[ "$OPTIMIZE" != "0" ]] && wrt_optimize "$name" && wrt_makeflags "$name"
@ -571,6 +579,7 @@ do-housekeeping:
userdel lfs; \\ userdel lfs; \\
rm -rf /home/lfs; \\ rm -rf /home/lfs; \\
fi; fi;
-rm -f /tmp/unpacked
EOF EOF
) >> $MKFILE ) >> $MKFILE

View file

@ -109,7 +109,10 @@ chapter5_Makefiles() {
else else
FILE="$name-$vrs.tar.*" FILE="$name-$vrs.tar.*"
fi 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. # Insert instructions for unpacking the package and to set the PKGDIR variable.
wrt_unpack "$FILE" wrt_unpack "$FILE"
[[ "$OPTIMIZE" = "2" ]] && wrt_optimize "$name" && wrt_makeflags "$name" [[ "$OPTIMIZE" = "2" ]] && wrt_optimize "$name" && wrt_makeflags "$name"
@ -215,6 +218,10 @@ chapter6_Makefiles() {
# Insert instructions for unpacking the package and changing directories # Insert instructions for unpacking the package and changing directories
if [ "$vrs" != "" ] ; then if [ "$vrs" != "" ] ; then
FILE="$name-$vrs.tar.*" 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" wrt_unpack2 "$FILE"
[[ "$OPTIMIZE" != "0" ]] && wrt_optimize "$name" && wrt_makeflags "$name" [[ "$OPTIMIZE" != "0" ]] && wrt_optimize "$name" && wrt_makeflags "$name"
fi fi
@ -442,6 +449,7 @@ do_housekeeping:
userdel lfs; \\ userdel lfs; \\
rm -rf /home/lfs; \\ rm -rf /home/lfs; \\
fi; fi;
-rm -f /tmp/unpacked
EOF EOF
) >> $MKFILE ) >> $MKFILE

View file

@ -211,6 +211,7 @@ EOF
wrt_unpack() { # Unpack and set 'ROOT' var wrt_unpack() { # Unpack and set 'ROOT' var
#----------------------------------# #----------------------------------#
local FILE=$1 local FILE=$1
local file=$2
( (
cat << EOF cat << EOF
@\$(call unpack,$FILE) @\$(call unpack,$FILE)
@ -363,9 +364,11 @@ wrt_remove_build_dirs() { #
local name=$1 local name=$1
( (
cat << EOF cat << EOF
@ROOT=\`head -n1 /tmp/unpacked | sed 's@^./@@;s@/.*@@'\` && \\ @if [ -f /tmp/unpacked ] ; then \\
rm -r \$(MOUNT_PT)\$(SRC)/\$\$ROOT && \\ ROOT=\`head -n1 /tmp/unpacked | sed 's@^./@@;s@/.*@@'\` && \\
if [ -e \$(MOUNT_PT)\$(SRC)/$name-build ]; then \\ 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; \\ rm -r \$(MOUNT_PT)\$(SRC)/$name-build; \\
fi; fi;
EOF EOF
@ -379,9 +382,11 @@ wrt_remove_build_dirs2() { #
local name=$1 local name=$1
( (
cat << EOF cat << EOF
@ROOT=\`head -n1 /tmp/unpacked | sed 's@^./@@;s@/.*@@'\` && \\ @if [ -f /tmp/unpacked ] ; then \\
rm -r \$(SRC)/\$\$ROOT && \\ ROOT=\`head -n1 /tmp/unpacked | sed 's@^./@@;s@/.*@@'\` && \\
if [ -e \$(SRC)/$name-build ]; then \\ if [ "x" != "x\$\$ROOT" ] ; then rm -r \$(SRC)/\$\$ROOT; fi; \\
fi;
@if [ -e \$(SRC)/$name-build ]; then \\
rm -r \$(SRC)/$name-build; \\ rm -r \$(SRC)/$name-build; \\
fi; fi;
EOF EOF