HOMEBREW_TEMP is not used when pouring a bottle

Hi,
When I’m trying to install llvm@7, brew fails to pour the bottle because my /tmp is full. I have set HOMEBREW_TEMP to different directory and the bottle is still extracted to /tmp.
Is it the intended behaviour?

If I build from source, the archive will be extracted to HOMEBREW_TEMP.
If I change bin/brew and add TMPDIR to the whitelist, the bottle will be extracted in TMPDIR as Ruby uses TMPDIR to guess the temp directory.
I’m happy to do a PR for this problem but I have no idea on the impact

HOMEBREW_TEMP : If set, instructs Homebrew to use HOMEBREW_TEMP as the temporary directory for building packages.

The last part seems to be essential here.

You can always make a PR though. In the worst case nothing happens

Thanks for pointing me in the right direction, that definitely explains the behaviour, I’ll do a PR