Tools like `brew create` need to create and manipulate SoftwareSpec
objects. It is useful to be able to do this directly, rather than by
proxy through the special methods that serve the main formula DSL.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Now that a URL, version, and the (for lack of a better term) "specs"
associated with said URL (e.g. the VCS revision, or a download strategy
hint) are neatly bundled up in a SoftwareSpec object, it doesn't make
sense to pass them individually to download strategy constructors. These
constructors now take only the formula name and a SoftwareSpec as
parameters.
This allows us to move mirror handling out out of Formula#fetch and into
the download strategies themselves. While doing so, we adjust the mirror
implementation a bit; mirrors now assume the same "specs" as their
owner's URL. They are still only useable by the CurlDownloadStrategy,
but this provides a basis for extending mirror support to other
strategies.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
When the name of a new formula can't be autodetected, it defaults to the empty
string. When it then gets read from user input later on, the new name is used
but the formula path, based on the name, stays empty.
This change sets the path after a new name was read.
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
Also don't abort searches if the query matches a blacklist. Eg.
`brew search vim` should return macvim and the information that vim itself is
not packaged.
The code was sucking. To the extent that maintenance was hard. It's a lot
easier to work with code that is sensibly split at sensible boundaries. So
now it is more like that.
But the refactor is minimal. Because we don't want you to have more merge
hell than absolutely necessary.
If you merge you will need to pay attention to brew.h.rb (as it is deleted)
and bin/brew (as command logic is gone). It will be painful, but you will just
have to help git out by moving any changes around manually.
Note compatibility.rb. It ensures that any function renames or removals don't
break anything. We're pretty serious about backwards compatibility. And that's
because we encourage you to hack around with the innards. And we couldn't do
that if we would then just make stuff disappear behind your back.