Blame SOURCES/0196-dracut-functions.sh-speed-up-ldconfig_paths.patch

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