Fix standalone release pruning on macOS with GNU coreutils (#62648)

GNU `stat` can take precedence on `PATH` and interprets `-f` differently
from macOS `stat`, causing the installer's device checks to fail.

Use the system `stat` for both device checks before pruning old releases.

GitOrigin-RevId: 180b62ba6e2ea4ec4419c2d6e51ba4d6ce819a2d
This commit is contained in:
Felipe Coury
2026-11-20 02:20:47 +00:00
committed by copyberry
parent 10ca17496f
commit 2c1b4c7c35
+3 -2
View File
@@ -919,8 +919,9 @@ prune_standalone_releases() (
continue
fi
else
device="$(stat -f '%d' "$releases")" || return 1
if ! find "$candidate" -xdev -exec stat -f '%d' {} + > "$tmp_dir/devices"; then
# Use macOS stat even when GNU coreutils comes first on PATH.
device="$(/usr/bin/stat -f '%d' "$releases")" || return 1
if ! find "$candidate" -xdev -exec /usr/bin/stat -f '%d' {} + > "$tmp_dir/devices"; then
continue
fi
grep -vxF "$device" "$tmp_dir/devices" >/dev/null && continue