This a follow-up for the related feature request. I'm submitting an updated patch here which fixes some metalint warnings.
Updated patch to use $TMPDIR.
Updated patch to use $TMPDIR.