From 69e6326758d7e83e542d69ae80d88296e9430bc5 Mon Sep 17 00:00:00 2001 From: William Harrington Date: Thu, 18 Mar 2021 12:47:32 -0500 Subject: Return the exit status from packageinstall scrip to the chapter loops in lfs.sh and for sure stop the script when non zero status is returned. --- lfs.sh | 11 +++++++++++ packageinstall.sh | 10 +++++----- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/lfs.sh b/lfs.sh index 8b5e7b3..0d50daf 100755 --- a/lfs.sh +++ b/lfs.sh @@ -47,4 +47,15 @@ source download.sh for package in binutils gcc linux-api-headers glibc libstdc++; do source packageinstall.sh 5 $package + if [ "$retval" -ne 0 ]; then + exit 1 + fi +done + +for package in m4 ncurses bash coreutils diffutils file findutils gawk grep gzip make patch sed tar xz binutils gcc; do + source packageinstall.sh 6 $package + retval=$? + if [ "$retval" -ne 0 ]; then + exit 1 + fi done \ No newline at end of file diff --git a/packageinstall.sh b/packageinstall.sh index 848e4d8..bb6d230 100644 --- a/packageinstall.sh +++ b/packageinstall.sh @@ -36,13 +36,13 @@ else if [ "$retval" -ne 0 ]; then echo -e "\n${GRN}Compiling ${YLW}${PACKAGE} ${RED}FAILED!${RST}" popd > /dev/null - exit 1 + return $retval + else + echo -e "\n${GRN}Done Compiling ${YLW}${PACKAGE}${RST}" + touch ${LFS}/sources/chapter${CHAPTER}/${PACKAGE} + rm -rf ${LFS}/sources/${DIRNAME} fi - echo -e "\n${GRN}Done Compiling ${YLW}${PACKAGE}${RST}" - touch ${LFS}/sources/chapter${CHAPTER}/${PACKAGE} - rm -rf ${LFS}/sources/${DIRNAME} - popd > /dev/null done -- cgit v1.2.3-54-g00ecf