Blame 0005-dracut-functions.sh-speed-up-ldconfig_paths.patch

Harald Hoyer e09d6b
From 5ea0be0a8c83969fd0041b3e647f82fcfb365e44 Mon Sep 17 00:00:00 2001
Harald Hoyer e09d6b
From: Harald Hoyer <harald@redhat.com>
Harald Hoyer e09d6b
Date: Tue, 8 Jul 2014 12:54:21 +0200
Harald Hoyer e09d6b
Subject: [PATCH] dracut-functions.sh: speed up ldconfig_paths()
Harald Hoyer e09d6b
Harald Hoyer e09d6b
---
Harald Hoyer e09d6b
 dracut-functions.sh | 7 +++----
Harald Hoyer e09d6b
 1 file changed, 3 insertions(+), 4 deletions(-)
Harald Hoyer e09d6b
Harald Hoyer e09d6b
diff --git a/dracut-functions.sh b/dracut-functions.sh
Harald Hoyer e09d6b
index d30e835..9f481b2 100755
Harald Hoyer e09d6b
--- a/dracut-functions.sh
Harald Hoyer e09d6b
+++ b/dracut-functions.sh
Harald Hoyer e09d6b
@@ -109,12 +109,11 @@ ldconfig_paths()
Harald Hoyer e09d6b
     local a i
Harald Hoyer e09d6b
     declare -A a
Harald Hoyer e09d6b
     for i in $(
Harald Hoyer e09d6b
-        ldconfig -pN 2>/dev/null | while read a b c d; do
Harald Hoyer e09d6b
-            [[ "$c" != "=>" ]] && continue
Harald Hoyer e09d6b
-            printf "%s\n" ${d%/*};
Harald Hoyer e09d6b
+        ldconfig -pN 2>/dev/null | grep -F '=>' | grep -E -v '/(lib|lib64|usr/lib|usr/lib64)/[^/]*$' | while read a b c d; do
Harald Hoyer e09d6b
+            d=${d%/*}
Harald Hoyer e09d6b
+            printf "%s\n" "$d";
Harald Hoyer e09d6b
         done
Harald Hoyer e09d6b
     ); do
Harald Hoyer e09d6b
-        [[ "$i" = "/lib" || "$i" = "/usr/lib" || "$i" = "/lib64" || "$i" = "/usr/lib64" ]] && continue
Harald Hoyer e09d6b
         a["$i"]=1;
Harald Hoyer e09d6b
     done;
Harald Hoyer e09d6b
     printf "%s\n" ${!a[@]}