Simplify access to the different forms of a formula's build options by
making options into real objects rather than strings, and expose both
the 'name' and 'flag' form.
Doing so was the result of a quick hack to fix the "deps installed as
upgrades don't get linked" bug, but it was a mistake. Instead, always
return the LinkedKegs entry as a Pathname object, and let callers be
responsible for checking that it exists.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Passing Formula.factory the name of a keg that belongs to a non-core
formula will cause an error to be raised; we don't really care, so just
fake a totally empty install receipt in this case.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
This will be useful in places where we need information about things
other than the currently linked keg, such as `brew info`.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
FormulaInstaller now loads the install recipt of a previous install and appends
the `used_options` to ARGV before forking to build. This means `brew upgrade`
will "remember" which options were invoked for the last install and re-use
them.
FixesHomebrew/homebrew#5250.