49 Commits

Author SHA1 Message Date
Eloy Duran
c9f056c327 Make sure git commands in RefreshBrew are executed with the proper working dir. 2009-09-17 00:24:11 +02:00
Eloy Duran
c1989b79ad Update Homebrew and list the updated formulae. 2009-09-17 00:24:11 +02:00
Max Howell
c28bd7b571 Allow formulae to use __END__
For this to work the "running script" must be the formulae file. Making this
so wasn't so hard, there is now an install.rb script which is included with
the -r flag to the ruby executable. An at_exit handler calls the install
function.

Having the install logic in its own file made it feel like there was so much
space that I added extra error handling. So there is something to be said for
separating functionality out into its own files.

Still the error handling sucks, we'll need to marshall the exception back to
the bin/brew command. Which is another PITA.

Still overall I think this will prove worthwhile. But if it doesn't we'll
revert.

As a first usage, you can put a diff after __END__ and return DATA from
Formula::patches to make Homebrew aware of it.
2009-09-16 14:49:06 +01:00
David Höppner
f150e5ece2 Fix unittest test_arch_for_command for 10.5 2009-09-14 20:33:46 +01:00
Sean Wolfe
80a54dc5b2 Couchdb and dependency formulae
Signed-off-by: Max Howell <max@methylblue.com>

I squashed a number of commits here, and also replaced the use of nspr.prefix with HOMEBREW_PREFIX as in theory we are flexible with our requirement for dependencies, although with the limited build system that SpiderMonkey possesses this is difficult for us to achieve anyway…
2009-09-14 20:33:46 +01:00
Max Howell
f0f59659dd Overriding Object.class was not my intention
Renamed to Formula::class_s.
2009-09-11 17:42:53 +01:00
Max Howell
d62fd87436 Fix lame version, eg. 398-2
Included test this time!
2009-09-11 17:42:53 +01:00
Adam Vandenberg
981dba1b35 Function to return a binary's Mach-O architectures
Added a utility method to get an array of architecture names for
a given executable.

This will be useful for, say, figuring out what Python was compiled for,
to know what to compile a C-based module as.

Signed Off By: Max Howell <max@methylblue.com>

I added a test and made the function use `which` if the path provided is not
absolute. I considered allowing relative paths, but then it is possible for
the function to take eg. the svn binary from the current directory when you
meant the one in the path, and that could be a confusing bug.
2009-09-10 18:17:15 +01:00
Étienne Barrié
3809c0b419 Add support for SHA256 2009-09-07 16:10:50 +02:00
Étienne Barrié
b2e12c4517 Add test for SHA1 2009-09-07 15:26:43 +02:00
Max Howell
e30c1c8850 Cache ARGV calcs
Means unshift doesn't work, but well, that's almost a feature :P
2009-09-05 14:35:26 +01:00
spicyj
ba8ba4c451 Improvements to build environment determination
Simplified hardware model testing.

Even smarter compiler option generation using sysctl and new GCC 4.2 features.

Get processor count from sysctl and thus remove our dependency on RubyCocoa.
2009-09-03 16:34:31 +01:00
Max Howell
422ec29363 Tests for Pathname+Yeast
I removed the rename and mv functions as when I wrote the tests I realised the function implied the pathname object would be updated to reflect the moved or renamed file. However that cannot be done. Also frankly I think writing it out in full makes clearer code.
2009-09-02 15:07:26 +01:00
Max Howell
fbda4b45d6 Build optimisations for 64 bit Snow Leopard
Specifying -v/--verbose shows the build environment before the build

MACOS_VERSION contains the floating point value of the OS X version

A test for some floating point assumptions I make
2009-09-02 15:07:18 +01:00
Max Howell
f6743bbfd7 Tests for hw.model and brew.h.rb 2009-09-01 12:05:26 +01:00
Max Howell
4d63b87e0a Change license to BSD
I confirmed this change with all relevant contributors first.
2009-08-31 16:09:17 +01:00
Max Howell
11c67fe0b4 Ruby 1.9 version style 2009-08-30 15:49:38 +01:00
Max Howell
b6ccdad53e Proper validation of Formula.name and version 2009-08-24 01:04:53 +01:00
Max Howell
72bde8c583 Move download strategies into their own file 2009-08-24 01:04:53 +01:00
Max Howell
f9d7b34945 Don't return a version that equals the basename
Return nil instead
2009-08-24 01:04:53 +01:00
Max Howell
c532d11e7a Refactor away AbstractFormula
We'd gotten to the stage where Formula was so lean, it was pointless to
separate it.
2009-08-24 01:04:48 +01:00
Adam Vandenberg
0eaf4bbcd9 Factor out downloading from Formula
This patch adds a ArchiveDownloadStrategy that handles downloading
tarbarlls and decompressing them into the staging area ready for brewing.

Refactored safe_system and curl into utils.rb

Signed-off-by: Max Howell <max@methylblue.com>

Modifications to Adam's original patch:

I reverted objectification of checksum verification because I couldn't think
of any other download validation methods that might be useful to us in the
future, so allowing such flexibility had no advantages. If we ever need this
to be OO we can add it. But for now less complexity is preferable.

I removed the @svnurl class member. Instead download_strategy is autodetected
by examining the url. The user can override the download_strategy in case this
fails. Thus we already can easily add support for clones of git repositories.
2009-08-24 01:03:23 +01:00
Adam Vandenberg
9bc60b80b6 Fix comment about ENV overrides 2009-08-21 14:40:26 +01:00
Max Howell
355bfc1751 Pathname.version on directories ignores extname
Because directories don't have extensions.

Included test
2009-08-12 13:43:20 +01:00
Max Howell
ab9f59f227 More ARGV tests 2009-08-11 01:30:39 +01:00
Max Howell
e24e46c793 TEST Zip'd archives can be extracted 2009-08-10 18:16:12 +01:00
Max Howell
dae260561e Support github tagged download versions
eg. http://github.com/lloyd/yajl/tarball/1.0.5
2009-08-10 18:11:23 +01:00
Max Howell
6dbdc9ab0c Remove duplicates from ARGV.named
Includes test
2009-08-10 18:11:23 +01:00
Max Howell
760c083c0c Refactor
Large refactor to Formula, mostly improving reliability and error handling but
also layout and readability.

General improvements so testing can be more complete.

Patches are automatically downloaded and applied for Formula that return a
list of urls from Formula::patches.

Split out the brew command logic to facilitate testing.

Facility from Adam Vandenberg to allow selective cleaning of files, added
because Python doesn't work when stripped.
2009-08-10 18:11:17 +01:00
Adam Vandenberg
cae0e78e60 Pull USERAGENT used by curl into constant 2009-08-10 16:15:24 +01:00
Max Howell
e9dbdadcac Remove all testing temporaries when done 2009-08-04 01:31:32 +01:00
Max Howell
a1d5450f0c The unittest now emulates a fresh install better
In future, this will hopefully prevent regressions like issue Homebrew/homebrew#7.
2009-08-04 01:07:36 +01:00
Max Howell
33b90794e1 HOMEBREW_CACHE is now a Pathname object
This is consistent with the other HOMEBREW_* path constants
2009-08-04 00:40:12 +01:00
Max Howell
a5ca752658 Refactor and clean up code 2009-08-01 18:10:20 +01:00
Max Howell
055a694cd4 More tests for Formula and Keg 2009-07-31 14:21:27 +01:00
Max Howell
7e0d5bf165 Tests for Formula.* 2009-07-31 14:04:24 +01:00
Max Howell
5fd7fd0578 A basis for full test coverage 2009-07-31 04:59:08 +01:00
Max Howell
9b19f194cc Refactor $foo into HOMEBREW_FOO
CONSTANTS are the far saner choice for these important parameters.

Split env up so I can redefine the CONSTANTS in unittest.rb.
2009-07-31 04:59:02 +01:00
Max Howell
fb5aefd4a0 Refactor--object orientate where sensible 2009-07-24 23:57:54 +01:00
Max Howell
17968f51c4 Support gloox version style 2009-07-10 03:11:05 +01:00
Max Howell
a648e46d8a Leave permissions of installed files in sensible state
No write permission for files, executable when required etc.
2009-06-26 13:05:48 +01:00
Max Howell
6e9a564021 foobar-1.2.1rc1 version pattern 2009-06-18 10:31:23 +01:00
Max Howell
02e53d44cb Capture stdout during test_prefix 2009-06-15 01:28:44 +01:00
Max Howell
b3b78eceeb Test for astyle versioning 2009-06-15 00:54:58 +01:00
Max Howell
9003225a34 Another version test 2009-06-08 15:57:24 +01:00
Max Howell
cbbc7b0f0f Better version extraction and more flexible funcs 2009-06-08 11:42:28 +01:00
Max Howell
b3b14a7e0a Refactor class heirarchy 2009-06-05 23:39:56 +01:00
Max Howell
e585686b01 Fix GithubGistFormula 2009-06-05 12:57:37 +01:00
Max Howell
cc50131728 Created /Library moved brew tool to /bin
Moved Forumla and Cellar/homebrew into Library.

This way the homebrew core files are more sensibly placed, Cellar is
more internally consistent and only generated. And Homebrew is ready for
use straight out of the tarball.
2009-06-04 19:36:58 +01:00