brew-cleanup: don't whine about permission denied.

Closes #14359.
qt5: make keg_only due to qt conflict.

References #16471.
References #16921.
Allow depending on requirement class or instance.
ruby: use opt_prefix in caveats

The gem's bindir is available in the opt_prefix; use
that instead of the Cellar location in the caveat.

Closes #17315.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Clean up Tab creation
Move option comparison into BuildOptions
Options can be used interchangeably with Strings

We want to be able to use Option objects in place of strings and have
this be transparent. Defining to_str means that methods like
Kernel#system and Kernel#exec will be able to perform an implicit
conversion.
Options can be dumped as JSON
BuildOptions: simplify setting description
BuildOptions: check has_option? for universal and 32-bit
Refactor option handling internals

Currently we handle options in several ways, and it is hard to remember
what code needs an option string ("--foo"), what needs only the name
("foo") and what needs an Option object.

Now that Option objects can act as strings and be converted to JSON, we
can start using them instead of passing around strings between Formula
objects, Tab objects, and ARGV-style arrays.

The Options class is a special collection that can be queried for the
inclusion of options in any form: '--foo', 'foo', or Option.new("foo").
Move BuildOptions to a separate file
Tests for BuildOptions
Tab#with? to mirror BuildOptions#with?

Eventually a common interface could be factored out into a module, but
for now this will suffice.
Formula#recursive_dependencies

This behaves like recursive_deps, but the resulting list consists of
Dependency objects instead of Formula objects. The list maintains the
installable order property of recursive_deps.

While in the area, add some comments clarifying the purpose of related
methods.
Dependency#to_formula and associated helpers
FormulaInstaller: factor out requirement checking
FormulaInstaller: factor out dependency installation
FormulaInstaller: skip build-time deps for bottles
FormulaInstaller: implement installation locks

FormulaInstaller now attempts to take a lock on a "foo.brewing" file for
the formula and all of its dependencies before attempting installation.

The lock is an advisory lock implemented using flock(), and as such it
only locks out other processes that attempt to take the lock. It also
means that it is never necessary to manually remove the lock file,
because the lock is not enforced by I/O.

The uninstall, link, and unlink commands all learn to respect this lock
as well, so that the installation cannot be corrupted by a concurrent
Homebrew process, and keg operations cannot occur simultaneously.