diff options
author | Siddharth Kapoor <16ec142siddharth@nitk.edu.in> | 2021-05-16 14:50:46 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-16 22:50:46 +0100 |
commit | dbd9d13857a99c981dd780b6b149f0e157204070 (patch) | |
tree | f36713f4f9618516945c077334430fc10be7f882 /Meta | |
parent | 2eb9dca7827cd91b696a95a309a49086b52bba07 (diff) | |
download | serenity-dbd9d13857a99c981dd780b6b149f0e157204070.zip |
Meta: Run 'du' with '--apparent-size', except on macOS
Fixes #7172.
Diffstat (limited to 'Meta')
-rwxr-xr-x | Meta/build-image-extlinux.sh | 4 | ||||
-rwxr-xr-x | Meta/build-image-grub.sh | 4 | ||||
-rwxr-xr-x | Meta/build-image-qemu.sh | 4 |
3 files changed, 12 insertions, 0 deletions
diff --git a/Meta/build-image-extlinux.sh b/Meta/build-image-extlinux.sh index 314c6cd30d..d4977c9e56 100755 --- a/Meta/build-image-extlinux.sh +++ b/Meta/build-image-extlinux.sh @@ -25,7 +25,11 @@ if [ -z $syslinux_dir ]; then fi disk_usage() { +if [ "$(uname -s)" = "Darwin" ]; then du -sm "$1" | cut -f1 +else + du -sm --apparent-size "$1" | cut -f1 +fi } DISK_SIZE=$(($(disk_usage "$SERENITY_SOURCE_DIR/Base") + $(disk_usage Root) + 300)) diff --git a/Meta/build-image-grub.sh b/Meta/build-image-grub.sh index e8e55ee4a0..dffc940fdb 100755 --- a/Meta/build-image-grub.sh +++ b/Meta/build-image-grub.sh @@ -24,7 +24,11 @@ fi echo "using grub-install at ${grub}" disk_usage() { +if [ "$(uname -s)" = "Darwin" ]; then du -sm "$1" | cut -f1 +else + du -sm --apparent-size "$1" | cut -f1 +fi } DISK_SIZE=$(($(disk_usage "$SERENITY_SOURCE_DIR/Base") + $(disk_usage Root) + 300)) 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)) |