From e23af271ea30fd57305887e79114d0dd4f861211 Mon Sep 17 00:00:00 2001 From: William Harrington Date: Mon, 5 Apr 2021 21:02:45 -0500 Subject: Have grep exit 0 without stdoutput when checking if a package is in packages.csv. --- insidechroot.sh | 18 ++++++++++++++++-- packageinstall.sh | 2 +- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/insidechroot.sh b/insidechroot.sh index 28cf64f..b78a4a2 100644 --- a/insidechroot.sh +++ b/insidechroot.sh @@ -22,7 +22,21 @@ if [[ "${CHAPTER}" -eq 7 ]]; then exit 1 fi done - + +elif [[ "${CHAPTER}" -eq 8 ]]; then + + # Chapter 8 + printf "%b" "\n${IWHT}============ ${IGRN}Building ${IYLW}Chapter 8${IWHT} \ +============${RST}\n" + + for package in man-pages iana-etc glibc zlib bzip2 xz zstd file readline m4 bc flex tcl expect dejagnu binutils gmp mpfr mpc isl attr acl libcap shadow gcc pkg-config ncurses sed psmisc gettext bison grep bash libtool gdbm gperf expat inetutils perl xml-parser intltool autoconf automake kmod libelf libffi openssl python ninja meson coreutils check diffutils gawk findutils groff grub less gzip iproute2 kbd libpipeline make patch man-db tar texinfo vim eudev procps-ng util-linux e2fsprogs sysklogd sysvinit; do + source packageinstall.sh 8 $package + retval=$? + if [[ "${retval}" -ne 0 ]]; then + exit 1 + fi + done + else - printf "%b" "Do Chapter 8, 9 and 10 stuff here.\n" + printf "%b" "Do Chapter 9 and 10 stuff here.\n" fi diff --git a/packageinstall.sh b/packageinstall.sh index c9689a6..78e2cdd 100644 --- a/packageinstall.sh +++ b/packageinstall.sh @@ -3,7 +3,7 @@ CHAPTER="$1" PACKAGE="$2" -if ! grep "^${PACKAGE}" packages.csv; then +if ! grep -q "^${PACKAGE}" packages.csv; then printf "%b" " ${IRED}PACKAGE ${IYLW}${PACKAGE} ${IRED}DOES NOT EXIST!${RST}\n" exit 1 fi -- cgit v1.2.3-54-g00ecf