diff options
author | William Harrington <kb0iic@berzerkula.org> | 2021-04-07 08:39:35 -0500 |
---|---|---|
committer | William Harrington <kb0iic@berzerkula.org> | 2021-04-07 08:39:35 -0500 |
commit | 031b2c7f5f356771ac05a582b0393baa92da4c48 (patch) | |
tree | c0964558578a415bde13d258c7fd67b687e25d1e /packageinstall.sh | |
parent | b760559acc63f313f648076a665efe49a2fbf69d (diff) |
Change grep to look for package up until the first comma.
Diffstat (limited to 'packageinstall.sh')
-rw-r--r-- | packageinstall.sh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/packageinstall.sh b/packageinstall.sh index 78e2cdd..df09148 100644 --- a/packageinstall.sh +++ b/packageinstall.sh @@ -3,7 +3,7 @@ CHAPTER="$1" PACKAGE="$2" -if ! grep -q "^${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 @@ -12,7 +12,7 @@ if [[ -f "${LFS}/sources/chapter${CHAPTER}/${PACKAGE}" ]]; then printf "%b" "${GRN}Package ${YLW}${PACKAGE} ${GRN}already built and installed${RST}\n" else - grep -i "^${PACKAGE}" packages.csv | grep -i -v "\.patch;" | while read -r line; do + grep -i "^${PACKAGE}," packages.csv | grep -i -v "\.patch;" | while read -r line; do VERSION="$(echo "${line}" | cut -d\, -f2)" URL="$(echo "${line}" | cut -d\, -f3 | sed "s/@/${VERSION}/g")" CACHEFILE="$(basename "${URL}")" |