From c9cb04e59113a3afb1cc9fde17dc8bb27a0a315c Mon Sep 17 00:00:00 2001 From: William Harrington Date: Thu, 15 Apr 2021 08:32:23 -0500 Subject: Create fail and success functions and remove trailing white spaces at ends of lines. --- chapter6/backup.sh | 4 ++-- chapter6/cleanup.sh | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'chapter6') diff --git a/chapter6/backup.sh b/chapter6/backup.sh index 837c44c..f9a761c 100644 --- a/chapter6/backup.sh +++ b/chapter6/backup.sh @@ -15,12 +15,12 @@ else spinner "$pid" "${SPINNER}" retval=$? if [ "$retval" -ne 0 ]; then - printf "%b" "${IRED}FAILED!${RST}\n" + fail "FAILED!" exit "${retval}" else # shellcheck disable=SC2024 sudo chown -v "${USER}":"$(id -g)" "${HOME}"/"${file}" >>"${LFS}"/sources/log/chapter6/backup.log - printf "%b" "${IGRN}OK${RST}\n" + success "OK" fi popd > /dev/null || exit 1 diff --git a/chapter6/cleanup.sh b/chapter6/cleanup.sh index 0eb80a2..5f6e327 100644 --- a/chapter6/cleanup.sh +++ b/chapter6/cleanup.sh @@ -7,12 +7,12 @@ else printf "%b" "${GRN}Cleaning up ${YLW}${LFS}${RST}... " { - find "${LFS}"/usr/lib -name \*.la -delete - find "${LFS}"/usr/libexec -name \*.la -delete + find "${LFS}"/usr/lib -name \*.la -delete + find "${LFS}"/usr/libexec -name \*.la -delete - rm -rfv "${LFS}"/usr/share/doc - rm -rfv "${LFS}"/usr/share/info - rm -rfv "${LFS}"/usr/share/man + rm -rfv "${LFS}"/usr/share/doc + rm -rfv "${LFS}"/usr/share/info + rm -rfv "${LFS}"/usr/share/man strip --strip-debug "${LFS}"/usr/lib/* strip --strip-unneeded "${LFS}"/usr/bin/* @@ -21,6 +21,6 @@ else } >"${LFS}"/sources/log/chapter6/cleanup.log 2>&1 - printf "%b" "${IGRN}OK${RST}\n" - touch "${LFS}"/sources/chapter6/cleanup + success "OK" + touch "${LFS}"/sources/chapter6/cleanup fi -- cgit v1.2.3-54-g00ecf