22 Commits

Author SHA1 Message Date
Jack Nagel
c235395fd7 Give SoftwareSpec an initializer
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>
2012-07-04 22:47:35 -05:00
Jack Nagel
56fe164e95 Teach download strategies to take a SoftwareSpec
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>
2012-07-04 22:47:35 -05:00
Jack Nagel
b2ff74372e Refactor download strategy detection
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-07-04 22:47:34 -05:00
Jack Nagel
168ccb2821 Update formula template for new X11 dependency
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-07-01 14:32:28 -05:00
Adam Vandenberg
73d047d3ac Use sha1 as the default checksum for new formulae
See: https://github.com/mxcl/homebrew/pull/12587
2012-06-06 07:04:51 -07:00
Jack Nagel
01bcf58e6a create: update cmake calls in template
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-05-22 22:32:16 -05:00
Max Howell
b6a5b3f3a3 Assist more in the template from brew create 2012-03-01 13:25:10 +00:00
Max Howell
85e05b27dd Some additional aid for brew create 2012-02-29 02:03:26 +00:00
Jack Nagel
a743f8d862 create: homepage comes before url and checksum
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-02-06 17:19:54 -06:00
Jack Nagel
66388b7a43 create: punt on bad URLs
When we can't detect a name from the URL, just ask the user.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-01-31 17:57:20 -06:00
Misty De Meo
af457fb200 Correct cmake syntax in formula template
Closes Homebrew/homebrew#8879.

Signed-off-by: Charlie Sharpsteen <source@sharpsteen.net>
2011-11-29 14:20:38 -08:00
Max Howell
28aef26a47 More docs for brew create generated formula tests
To assist those new to stuff.
2011-09-20 03:39:07 +01:00
Max Howell
36596de68c Force contributors to define a test by adding it to the create template
A little cheeky but it should help us to maintain higher quality.
2011-08-25 00:53:37 +01:00
Jack Nagel
4e65175564 Fix misspelled method name: Formula.canonical_name
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2011-05-07 21:50:37 -07:00
Martin Kühl
dafe97b047 Fix formula paths for manually specified names.
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>
2011-04-09 09:43:48 -07:00
Adam Vandenberg
035b216e90 brew create: remind people to 'brew audit' 2011-04-05 08:37:59 -07:00
Adam Vandenberg
bc3225a348 brew create: ensure CACHE folder exists 2011-04-05 08:31:05 -07:00
Max Howell
4abf493670 Remove unused exception; Closes Homebrew/homebrew#4652
If version cannot be determined, then instruct the user to add one.
2011-03-13 16:16:17 +00:00
Max Howell
e0639f1588 Replace create --cache with create --no-fetch
Because since 0.8 we do the opposite, ie. download by default.
2011-03-13 12:52:41 +00:00
Adam Vandenberg
9ed51082c2 Use ruby style for inheritance. 2011-03-12 11:55:09 -08:00
Max Howell
719e6c8999 Refactor the blacklists
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.
2011-03-12 11:55:02 -08:00
Max Howell
768910283a Refactor the brew command into one file per command
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.
2011-03-12 11:55:02 -08:00