From dbd9d13857a99c981dd780b6b149f0e157204070 Mon Sep 17 00:00:00 2001 From: Siddharth Kapoor <16ec142siddharth@nitk.edu.in> Date: Sun, 16 May 2021 14:50:46 -0700 Subject: Meta: Run 'du' with '--apparent-size', except on macOS Fixes #7172. --- Meta/build-image-qemu.sh | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Meta/build-image-qemu.sh') diff --git a/Meta/build-image-qemu.sh b/Meta/build-image-qemu.sh index 9e0ae43143..4cb6e88b83 100755 --- a/Meta/build-image-qemu.sh +++ b/Meta/build-image-qemu.sh @@ -20,7 +20,11 @@ fi disk_usage() { # shellcheck disable=SC2003 +if [ "$(uname -s)" = "Darwin" ]; then expr "$(du -sk "$1" | cut -f1)" / 1024 +else + expr "$(du -sk --apparent-size "$1" | cut -f1)" / 1024 +fi } DISK_SIZE=$(($(disk_usage "$SERENITY_SOURCE_DIR/Base") + $(disk_usage Root) + 100)) -- cgit v1.2.3