Previously, running e.g. `brew help bundle` when homebrew-bundle was not
tapped would tap homebrew-bundle and then run `brew bundle` showing
`Error: No Brewfile found` instead of the expected help text.
Align the logic in `cleanup_portable_ruby` with that in `ruby.sh`.
Co-authored-by: Maxim Belkin <maxim.belkin@gmail.com>
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
- This has to be in multiple places, hence a new method. A patch failing
to apply, which is a common occurrence with HEAD builds because the
patch is already upstream, raises a different exception to another,
"normal" build failure.
Tested with:
```
╭─issyl0@rigel /home/linuxbrew/.linuxbrew/Homebrew ‹head-builds-arent-officially-supported*›
╰─ $ brew install --HEAD mtr
==> Cloning https://github.com/traviscross/mtr.git
Updating /home/issyl0/.cache/Homebrew/mtr--git
==> Checking out branch master
Already on 'master'
Your branch is up to date with 'origin/master'.
HEAD is now at 155f76a Merge pull request #340 from Sea-n/master
==> Downloading https://github.com/traviscross/mtr/pull/315.patch?full_index=1
Already downloaded: /home/issyl0/.cache/Homebrew/downloads/82d9d939303d8fceb7a3ae071ecd49a5f075e0fb451b308653b555ffbae74336--315.patch
==> Patching
==> Applying 315.patch
patching file packet/probe.c
Hunk #1 FAILED at 323.
Hunk #2 FAILED at 364.
2 out of 2 hunks FAILED -- saving rejects to file packet/probe.c.rej
Error: Failure while executing; `patch -g 0 -f -p1 -i /tmp/mtr--patch-20200330-10734-avjmyy/315.patch` exited with 1.
HEAD builds are unsupported by maintainers - please file pull requests instead of issues.
```
and
```
╭─issyl0@rigel /home/linuxbrew/.linuxbrew/Homebrew ‹head-builds-arent-officially-supported*›
╰─ $ brew install --HEAD zookeeper
==> Cloning https://gitbox.apache.org/repos/asf/zookeeper.git
Updating /home/issyl0/.cache/Homebrew/zookeeper--git
==> Checking out branch master
Already on 'master'
Your branch is up to date with 'origin/master'.
HEAD is now at 1ff1b779 ZOOKEEPER-3755: Use maven to create fatjar
==> ant compile_jute
Last 15 lines from /home/issyl0/.cache/Homebrew/Logs/zookeeper/01.ant:
2020-03-30 21:45:10 +0100
ant
compile_jute
Picked up _JAVA_OPTIONS: -Duser.home=/home/issyl0/.cache/Homebrew/java_cache
Buildfile: build.xml does not exist!
Build failed
READ THIS: https://docs.brew.sh/Troubleshooting
HEAD builds are unsupported by maintainers - please file pull requests instead of issues.
```