mirror of
https://github.com/openai/codex.git
synced 2026-11-20 22:40:37 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user