commit:     563207f4a244e2ca02115224760a9db16eeacbcf
Author:     Matt Jolly <kangie <AT> gentoo <DOT> org>
AuthorDate: Thu Oct 10 21:51:32 2024 +0000
Commit:     Matt Jolly <kangie <AT> gentoo <DOT> org>
CommitDate: Thu Oct 10 21:52:05 2024 +0000
URL:        
https://gitweb.gentoo.org/proj/chromium-tools.git/commit/?id=563207f4

Make sure we don't match substrings and loop forever

Signed-off-by: Matt Jolly <kangie <AT> gentoo.org>

 iterate-over-ebuild.sh | 4 ++--
 1 file 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

Reply via email to