From 2928c3d9cd33bfc8fd7c1f502c48e706691cb57b Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Tue, 6 Jul 2021 23:10:30 +1200 Subject: [PATCH] fix reduce_pass_size behaviour around deleted directories --- live-build/lb_chroot_layered | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/live-build/lb_chroot_layered b/live-build/lb_chroot_layered index c08a43ef..d6cf49ee 100755 --- a/live-build/lb_chroot_layered +++ b/live-build/lb_chroot_layered @@ -130,6 +130,14 @@ reduce_pass_size () { if ! diff --brief --no-dereference "$pass_dir/$f" "$parent_pass_dir/$f" >/dev/null; then continue fi + p=$(dirname $f) + while [ "$p" != . ]; do + if [ -n "$(getfattr -n trusted.overlay.opaque -h --only-values -- "$pass_dir/$p" 2>/dev/null)" ]; then + Echo_message "reduce_pass_size: '%s' would be removed from overlay but for trusted.overlay.opaque on '%s'" "$f" "$p" + continue 2 + fi + p=$(dirname $p) + done # Files are strictly identical between the 2 passes (only mod or access times differs). No need for unused delta. Echo_message "reduce_pass_size: '%s' is strictly identical between %s and %s. Removing." "$f" "$pass" "$parent" rm "$pass_dir/$f"