Harald Hoyer b2d442
From f6e777ec4b1031b18b835cd34ed644ebf4a2ace6 Mon Sep 17 00:00:00 2001
Harald Hoyer b2d442
From: Harald Hoyer <harald@redhat.com>
Harald Hoyer b2d442
Date: Tue, 22 May 2018 09:48:23 +0200
Harald Hoyer b2d442
Subject: [PATCH] cleanup empty ldconfig_paths directories
Harald Hoyer b2d442
Harald Hoyer b2d442
https://bugzilla.redhat.com/show_bug.cgi?id=1324746
Harald Hoyer b2d442
---
Harald Hoyer b2d442
 dracut.sh | 5 +++++
Harald Hoyer b2d442
 1 file changed, 5 insertions(+)
Harald Hoyer b2d442
Harald Hoyer b2d442
diff --git a/dracut.sh b/dracut.sh
Harald Hoyer b2d442
index 5b5b27e3..a4406dd9 100755
Harald Hoyer b2d442
--- a/dracut.sh
Harald Hoyer b2d442
+++ b/dracut.sh
Harald Hoyer b2d442
@@ -1643,6 +1643,11 @@ if [[ $do_strip = yes ]] ; then
Harald Hoyer b2d442
     done
Harald Hoyer b2d442
 fi
Harald Hoyer b2d442
 
Harald Hoyer b2d442
+# cleanup empty ldconfig_paths directories
Harald Hoyer b2d442
+for d in $(ldconfig_paths); do
Harald Hoyer b2d442
+    rmdir -p --ignore-fail-on-non-empty "$initdir/$d" >/dev/null 2>&1
Harald Hoyer b2d442
+done
Harald Hoyer b2d442
+
Harald Hoyer b2d442
 if [[ $do_strip = yes ]] && ! [[ $DRACUT_FIPS_MODE ]]; then
Harald Hoyer b2d442
     dinfo "*** Stripping files ***"
Harald Hoyer b2d442
     find "$initdir" -type f \
Harald Hoyer b2d442