Blame 0001-Partially-revert-41cfdfc-to-fix-RHBZ-1936781-per-ryn.patch

Adam Williamson eeb15e
From 9db78bc16fc66d1200ab032bd667809a4404c869 Mon Sep 17 00:00:00 2001
Adam Williamson eeb15e
From: Adam Williamson <awilliam@redhat.com>
Adam Williamson eeb15e
Date: Mon, 19 Apr 2021 08:33:38 -0700
Adam Williamson eeb15e
Subject: [PATCH] Partially revert 41cfdfc to fix RHBZ #1936781 per @ryncsn
Adam Williamson eeb15e
Adam Williamson eeb15e
Signed-off-by: Adam Williamson <awilliam@redhat.com>
Adam Williamson eeb15e
---
Adam Williamson eeb15e
 dracut.sh | 7 +++++--
Adam Williamson eeb15e
 1 file changed, 5 insertions(+), 2 deletions(-)
Adam Williamson eeb15e
Adam Williamson eeb15e
diff --git a/dracut.sh b/dracut.sh
Adam Williamson eeb15e
index 062ed6c1..71942ce1 100755
Adam Williamson eeb15e
--- a/dracut.sh
Adam Williamson eeb15e
+++ b/dracut.sh
Adam Williamson eeb15e
@@ -2059,8 +2059,11 @@ if dracut_module_included "squash"; then
Adam Williamson eeb15e
 
Adam Williamson eeb15e
     # Remove duplicated files
Adam Williamson eeb15e
     for folder in "${squash_candidate[@]}"; do
Adam Williamson eeb15e
-        find "$initdir/$folder/" -not -type d \
Adam Williamson eeb15e
-            -exec bash -c 'mv -f "$squash_dir${1#$initdir}" "$1"' -- "{}" \;
Adam Williamson eeb15e
+        for file in $(find $initdir/$folder/ -not -type d); do
Adam Williamson eeb15e
+            if [[ -e $squash_dir${file#$initdir} ]]; then
Adam Williamson eeb15e
+                mv -f $squash_dir${file#$initdir} $file
Adam Williamson eeb15e
+            fi
Adam Williamson eeb15e
+        done
Adam Williamson eeb15e
     done
Adam Williamson eeb15e
 fi
Adam Williamson eeb15e
 
Adam Williamson eeb15e
-- 
Adam Williamson eeb15e
2.31.1
Adam Williamson eeb15e