Added instructions to always remove source and -build directories before running specific package commands
This commit is contained in:
parent
f358747c6a
commit
ab7bac5dc2
4 changed files with 44 additions and 20 deletions
|
@ -131,7 +131,7 @@ cross_tools_Makefiles() { #
|
|||
#
|
||||
# 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 @@ temptools_Makefiles() { #
|
|||
# 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 @@ boot_Makefiles() { #
|
|||
# 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 @@ chroot_Makefiles() { #
|
|||
#
|
||||
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 @@ testsuite_tools_Makefiles() { #
|
|||
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 @@ bm_testsuite_tools_Makefiles() { #
|
|||
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 @@ final_system_Makefiles() { #
|
|||
# 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 @@ bm_final_system_Makefiles() { #
|
|||
# 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 @@ bootscripts_Makefiles() { #
|
|||
#
|
||||
# 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 @@ bm_bootscripts_Makefiles() { #
|
|||
#
|
||||
# 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 @@ bootable_Makefiles() { #
|
|||
# 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 @@ bm_bootable_Makefiles() { #
|
|||
# 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
|
||||
|
|
|
@ -140,6 +140,10 @@ chapter5_Makefiles() { # Bootstrap or temptools phase
|
|||
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 @@ chapter6_Makefiles() { # sysroot or chroot build phase
|
|||
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 @@ do-housekeeping:
|
|||
userdel lfs; \\
|
||||
rm -rf /home/lfs; \\
|
||||
fi;
|
||||
-rm -f /tmp/unpacked
|
||||
|
||||
EOF
|
||||
) >> $MKFILE
|
||||
|
|
|
@ -109,7 +109,10 @@ chapter5_Makefiles() {
|
|||
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 @@ chapter6_Makefiles() {
|
|||
# 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 @@ do_housekeeping:
|
|||
userdel lfs; \\
|
||||
rm -rf /home/lfs; \\
|
||||
fi;
|
||||
-rm -f /tmp/unpacked
|
||||
|
||||
EOF
|
||||
) >> $MKFILE
|
||||
|
|
|
@ -211,6 +211,7 @@ EOF
|
|||
wrt_unpack() { # Unpack and set 'ROOT' var
|
||||
#----------------------------------#
|
||||
local FILE=$1
|
||||
local file=$2
|
||||
(
|
||||
cat << EOF
|
||||
@\$(call unpack,$FILE)
|
||||
|
@ -363,9 +364,11 @@ wrt_remove_build_dirs() { #
|
|||
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 @@ wrt_remove_build_dirs2() { #
|
|||
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
|
||||
|
|
Reference in a new issue