To make the patch smaller, I'd suggest disabling the clever detection with
```sh
if false; then
...
fi
```