From 315ce2397efab99a8a15cd2bb73367b00f178418 Mon Sep 17 00:00:00 2001 From: William Harrington Date: Fri, 2 Apr 2021 11:08:30 -0500 Subject: Use if [[ ... ]] instead of [ ... ] and change retval check in setupdisk when checking exit code when creating partition. --- packageinstall.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'packageinstall.sh') diff --git a/packageinstall.sh b/packageinstall.sh index afd11a0..43fd4eb 100644 --- a/packageinstall.sh +++ b/packageinstall.sh @@ -3,7 +3,7 @@ CHAPTER="$1" PACKAGE="$2" -if [ -f "${LFS}/sources/chapter${CHAPTER}/${PACKAGE}" ]; then +if [[ -f "${LFS}/sources/chapter${CHAPTER}/${PACKAGE}" ]]; then printf "%b" "${GRN}Package ${YLW}${PACKAGE} ${GRN}already built and installed for ${YLW}Chapter ${CHAPTER}.${RST}\n" else @@ -20,7 +20,7 @@ else tar xf "${CACHEFILE}" > /dev/null 2>&1 & pid=$! spinner "$pid" "${SPINNER}" retval=$? - if [ "$retval" -ne 0 ]; then + if [[ "$retval" -ne 0 ]]; then printf "%b" "${GRN}Extraction ${RED}FAILED!${RST}\n" return $retval else @@ -35,7 +35,7 @@ else source "${LFS}/sources/chapter${CHAPTER}/${PACKAGE}.sh" 2>&1 > "${LFS}/sources/log/chapter${CHAPTER}/${PACKAGE}.log" 2>&1 & pid=$! spinner "$pid" "${SPINNER}" retval=$? - if [ "$retval" -ne 0 ]; then + if [[ "$retval" -ne 0 ]]; then printf "%b" "${RED}FAILED!${RST}\n" popd > /dev/null || return 1 return $retval -- cgit v1.2.3-54-g00ecf