Quarantine is available ONLY if the script exits with '2'.
It is definitely NOT available if Swift doesn't exist or if
it exits with '5' (incompatible SDK). All other cases are
from now on treated as unsupported.
Also print to standard error only when explictly required (via an
exception).
- In some cases (usually old CLT versions) Swift is available but needs an
extra guard to use the quarantine API.
- xattr's native filesystem recursion is an Apple extension which is
not available in Mojave; so let's use xargs.
- Insert a quarantine support check in brew cask doctor.
FixesHomebrew/homebrew-cask#51554, and fixesHomebrew/homebrew-cask#51538.
`brew cask-tests` collected the test results in an improper way so that it reports a false success in certain situations.
Specially, the session under BrewTestBot always reports success regardless of the test status.
With this update, the exit code of `brew cask-tests` is 1 when the test fails, and then CI preperly works.
This hack has been in Homebrew Cask for more than two years
(since 51f93e6dc9c3da4ab2118459ea95e45c104386ec), and it originated even
earlier (6d2f7bc55af0b2aa915b2396d213e30a4446256c).
Cask tests apparently aren't even run on Travis anymore,
so this can be safely removed.