147 Commits

Author SHA1 Message Date
Mike McQuaid
c4fb2b73e2 Support installing bottles from local files. 2012-12-01 12:45:23 +00:00
Mike McQuaid
c3313d084c Copy rather than move e.g. war files. 2012-11-25 23:03:29 +00:00
Sijawusz Pur Rahnama
32b1d46c96 Add support for 7zip archives
Closes Homebrew/homebrew#15723.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-10-29 14:57:23 -05:00
Jack Nagel
39ec66614b Test coverage for DownloadStrategyDetector
While at it, make it use class methods instead; no reason to instantiate
an object for this.

Eventually there should be some functional tests for the individual
strategies as well.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-10-15 17:45:48 -05:00
Jack Nagel
bab29bab72 GitDownloadStrategy: avoid unnecessary checkout
By default, git checks out the fetched ref after cloning the repo, but
this is unnecessary as we explicitly check out the desired ref during
staging. This also silences some unnecessarily confusing output.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-10-15 15:29:23 -05:00
Jack Nagel
799c164cd9 GitDownloadStrategy: silence checkout actions in non-verbose mode
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-10-15 15:29:23 -05:00
Jack Nagel
a0e575e5b6 GitDownloadStrategy: silence status check
"git status -s" is used to detect if the repository was corrupted during
an interrupted clone, but it can leak output to the terminal, so use
quiet_system.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-10-15 15:29:23 -05:00
Jack Nagel
36dc701cfb Remove extra newline
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-09-28 21:06:48 -05:00
Jack Nagel
ee485b16e7 Make VCS download strategies work without user paths
Closes Homebrew/homebrew#15139.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-09-28 21:05:08 -05:00
Jack Nagel
0639364a82 _Really_ fix hg strategy
Fixes Homebrew/homebrew#15181.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-09-28 09:30:01 -05:00
Jack Nagel
cc932ca668 Fix hg strategy under stdenv
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-09-27 17:59:01 -05:00
Max Howell
d1be193cfe MercurialDownloadStrategy can find hg again
Was broken after superenv PATH modification.

Fixes Homebrew/homebrew#15078.
2012-09-25 11:31:56 -04:00
Max Howell
672388d4f7 Always find git and svn without trying hard
Two wrapper scripts that find git and svn using the ENV variables we support and then searching through the PATH and looking inside Xcode.app if necessary.

Now just calling git or svn in Homebrew code will find and exec the right tool and we can stop fussing.

Apologies to @adamv who is probably unimpressed that the cmds directory has non-commands in it now. If it's consolation these are temporary pending some more work on superenv whereby some more directories are created under the superenv root.
2012-08-29 12:41:36 -04:00
Adam Vandenberg
97d1dc4f2b Cache found svn binary 2012-08-22 09:44:49 -07:00
Adam Vandenberg
b104623f43 Honor GIT env var 2012-08-22 09:43:30 -07:00
Jack Nagel
166a9ba0ed Deprecate MacOS.version? style methods
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-18 11:25:59 -05:00
samueljohn
eb0be2ba47 download_strategy: Use MacOS.locate to find svn
- So that Xcode-only systems don't fail to find svn.

Closes Homebrew/homebrew#14080.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2012-08-09 08:53:20 -07:00
Jack Nagel
a45bfc8786 MercurialDownloadStrategy: remove redundant chdir
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-07-19 17:45:38 -05:00
Felipe Navarro V
9ec231bcb7 MercurialDownloadStrategy: check out subrepos
Closes Homebrew/homebrew#13495.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-07-19 17:44:37 -05:00
Misty De Meo
f39d8eb88c DownloadStrategy: Detect classes 2012-07-06 12:02:08 -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
samueljohn
f9b2761d77 warn if unrar is needed but not found.
You can `brew unrar`

Closes Homebrew/homebrew#12858.

Signed-off-by: Misty De Meo <mistydemeo@gmail.com>
2012-06-15 09:28:04 -05:00
Adam Vandenberg
f8a6075af3 Detect http://svn... as svn 2012-05-10 07:09:51 -07:00
Jack Nagel
68124d481f Unify 'which' and which_s' utility methods
'which' only returns a Pathname or nil, and doesn't care about anything
sent to stderr, so just silence it by default and combine the two
methods.

Closes Homebrew/homebrew#12115.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-05-07 21:05:47 -05:00
Adam Vandenberg
428781723b Detect uncompressed tars
From a patch by @RuiPereira

Closes Homebrew/homebrew#12011.
2012-05-03 20:31:00 -07:00
Jack Nagel
df2803ece5 GitDownloadStrategy: don't pass --depth to fetch
The --depth option is apparently more nuanced that I had originally
thought, and while it does not actually break repositories, repeatedly
using "--depth 1" can cause problems depending on the structure of the
history.

Luckily, we don't actually need it to prevent the entire repository from
being fetched as long as the fetch respec is set correctly, which we do
since 7718c939b06987ff8f1ecd599c8ace6f998ce180.

Fixes Homebrew/homebrew#12024.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-05-03 19:33:30 -05:00
Adam Vandenberg
3ad19e08b7 Extract detection of compression types
Separate out detecting compression types from uncompressing and staging.
2012-05-02 19:57:33 -07:00
Jack Nagel
837d206a62 GitDownloadStrategy: don't assume --single-branch is available
git-clone's --single-branch is too new, and Xcode 4.3's stock git
doesn't have it. Since we don't require git from Homebrew, don't use it.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-05-02 21:55:24 -05:00
Jack Nagel
b8715f6d97 GitDownloadStrategy optimization
The current series of fetch invocations in GitDownloadStrategy has the
unfortunate behavior of fetching full history even in shallow clones
that only need the history between the clone point and the remote HEAD.
It should be possible to determine if it is actually necessary to fetch
the full history, including all tags, and if it is not to avoid this
overhead.

Fixes Homebrew/homebrew#11958, and several other recurring problems.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-05-01 21:46:42 -05:00
Jack Nagel
b1d490cbed Don't set GIT_DIR when staging git clones
GIT_DIR is convenient, but it does not work when both a formula and
subformula try to stage a git checkout, as git will use the main
formula's repository when staging the subformula.

Stop setting it, and restore the kludge to the git-multipush formula.

Fixes Homebrew/homebrew#10893.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-05-01 18:07:58 -05:00
Mike McQuaid
995186a72c Fix Ruby warnings.
Fixes Homebrew/homebrew#11966.
2012-05-01 20:45:17 +08:00
Jack Nagel
cd4428bcb9 CurlDownloadStrategy: fix .rar detection
We now read six bytes instead of four in order to detect xz compression;
this broke rar detection which used a string literal instead of a regexp
for comparison.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-04-26 20:54:30 -05:00
Mike McQuaid
ebe4e07fa3 Change versioned bottle syntax and fix issues.
Fixed Homebrew/homebrew#11562.
2012-04-24 18:53:45 +10:00
Mike McQuaid
4138d30428 Revert "Change versioned bottle syntax and fix issues."
This reverts commit f80908bead8b620ebcc5cdde9de65e70598002b6.
2012-04-24 18:10:08 +10:00
Mike McQuaid
40370e05bd Change versioned bottle syntax and fix issues.
Fixed Homebrew/homebrew#11562.
2012-04-24 18:08:14 +10:00
Charlie Sharpsteen
4b96cf6f0b Can't force checkouts if using Leopard system SVN 2012-04-22 10:46:30 -07:00
Adam Vandenberg
f097ce8953 Detect .git as git urls 2012-04-19 21:05:59 -07:00
Mike McQuaid
a947064994 Version bottles. 2012-04-03 11:43:41 +10:00
Mike McQuaid
0d67d3baf1 Fix bottle redownloading and bad naming. 2012-03-18 16:35:09 +13:00
Mike McQuaid
23b84ef732 Set MACOS_VERSION as 0 on non-OSX platforms. 2012-03-18 15:43:39 +13:00
Max Howell
f1c26eb6e7 Let's print the full path 2012-03-16 00:35:56 +00:00
Adam Vandenberg
379a9353b0 Quote the .xz path in case of spaces 2012-03-13 06:58:01 -07:00
Mike McQuaid
4a306f32f4 Support bottles for non-Lion OSX versions. 2012-03-10 18:09:35 +13:00
Jack Nagel
6fe29922c8 Set GIT_DIR when staging git clones
Some build scripts want to inspect the git history, e.g. to determine
version strings. Rather than copy the repository into the build tree,
just setting GIT_DIR is enough for things to "just work".

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-02-28 18:35:09 -06:00
Jaeho Shin
1647a8d93e Suppress output of which commands
Added missing -s option to which for hg, bzr, fossil.

Closes Homebrew/homebrew#9954.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-02-03 12:22:09 -06:00
Colin Hebert
5cc4b1c991 CVSDownloadStrategy: correctly stage all files
The FileUtils.cp_r function with a wildcard doesn't copy hidden files
(starting with a dot) Instead of copying everything selected by *,
select all the folder content.

See: http://www.ruby-doc.org/core-1.9.3/Dir.html#method-c-glob

Closes Homebrew/homebrew#8873.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-02-01 21:18:39 -06:00
Adam Vandenberg
2d4d0c4655 Rubyisms 2012-01-23 19:29:55 -08:00
Jack Nagel
ffd5b7d7ab Add support for xz-compressed tarballs
Rationale: some software (e.g. GNU Coreutils, GnuTLS 3.x), have started
distributing _only_ xz-compressed tarballs. There is no system XZ
utility provided by OS X, but it is necessary so that we can continue to
provide formulae for this software.

If XZUtils isn't installed, we abort and prompt the user to `brew
install xz`.

The `xz` command itself doesn't do any untarring, so we write the
decompressed archive to stdout and pipe it to tar.
2011-12-09 16:16:46 -06:00
Colin Hebert
3b8c98040c download_strategy.ry: Improve Bazaar efficiency
Bazaar download strategy tried to re-download everything on "export" as a
checkout is used. See:

 https://answers.launchpad.net/bzr/+question/180269
 https://bugs.launchpad.net/bzr/+bug/897511

Related to issue Homebrew/homebrew#8774.

Closes Homebrew/homebrew#8863.

Signed-off-by: Charlie Sharpsteen <source@sharpsteen.net>
2011-11-29 10:06:58 -08:00