3 Commits

Author SHA1 Message Date
Jack Nagel
85b17ecb4e brew-unpack: define fails_with_llvm? as false
brew-unpack was failing for formulae that satisfy fails_with_llvm? as
handle_llvm_failure() requires our ENV extension to get ENV.compiler.

Rather than requiring extend/ENV, just define fails_with_llvm? as false
since we don't really care about that when just unpacking a formula.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-10-14 23:55:45 -05:00
Charlie Sharpsteen
5790935b12 brew-unpack: Apply patches and use formula options
`brew-unpack` now runs `Formula.brew` and copies the stage directory to the
unpack location. This provides two improvements:

  - Patches may be applied. The `patch` metho of the Formula class is
    overloaded such that patches are only applied if the `--patch` option is
    passed to `brew unpack`.

  - Formula can respond better to flags passed by `ARGV`.

Some trickery is pulled to ensure `DATA` is correctly set for each unpacked
formula.
2011-09-12 23:32:01 -07:00
Charlie Sharpsteen
783be64cf1 Add new external command: unpack
`brew-unpack` is inspired by the `unpack` command of Haskell's Cabal.
`brew unpack <formulae ...>` will fetch the source code archives of one or more
formula and extract them into subfolders of the current working directory. An
alternate root directory may be specified by invoking the `--destdir` flag.

This provides some nice advantages for inspecting source code compared to
`brew install -i -f <formula>`:

  - The extracted source code won't be deleted when the Ruby process
    terminates---which allows for long-term experimentation.

  - The user has control over which directory the code is extracted into.

  - No install process is initiated, so accidentally typing the equivalent of
    `exit 0` will not cause `brew` to mess with an existing installation.

  - Several formulae may be unpacked at once.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2011-05-19 08:03:08 -07:00