diff options
author | Matt Jolly <kangie@gentoo.org> | 2024-10-11 07:51:32 +1000 |
---|---|---|
committer | Matt Jolly <kangie@gentoo.org> | 2024-10-11 07:52:05 +1000 |
commit | 563207f4a244e2ca02115224760a9db16eeacbcf (patch) | |
tree | fb1f545e585f095de772ef0dadf6d13f5dde8f7c | |
parent | New script: iterate-over-ebuild.sh (diff) | |
download | chromium-tools-563207f4a244e2ca02115224760a9db16eeacbcf.tar.gz chromium-tools-563207f4a244e2ca02115224760a9db16eeacbcf.tar.bz2 chromium-tools-563207f4a244e2ca02115224760a9db16eeacbcf.zip |
Make sure we don't match substrings and loop forever
Signed-off-by: Matt Jolly <kangie@gentoo.org>
-rwxr-xr-x | iterate-over-ebuild.sh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/iterate-over-ebuild.sh b/iterate-over-ebuild.sh index 5013a45..9d0d479 100755 --- a/iterate-over-ebuild.sh +++ b/iterate-over-ebuild.sh @@ -39,12 +39,12 @@ while true; do else for lib in "${libs[@]}"; do echo "[$(date)]: Whitelisting $lib" - if grep -q "$lib" "${1}"; then + if grep -q "$lib$" "${1}"; then # Something went wrong if we're here but whatever. echo "[$(date)]: $lib already exists in keeplibs" else echo "[$(date)]: Adding $lib to keeplibs" - sed -i "/^\s*local keeplibs=/a \t\t$lib" "${1}" + sed -i "/^\s*local keeplibs=/a $lib" "${1}" added+=("$lib") fi done |