575 Commits

Author SHA1 Message Date
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
Jack Nagel
e0441fc26a Reset to remote HEAD when updating git clones
Git checkouts that do not specify a branch should always reset to the
remote's HEAD, as some remotes have HEAD set to 'unstable' or some other
non-master branch.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-11-26 11:44:55 -06:00
Adam Vandenberg
f2b43831f5 Mercurial 1.9.3 2011-11-15 09:03:12 -08:00
Misty De Meo
1e17a8fb0b Add UnsafeSubversionDownloadStrategy
There was an UnsafeSubversionDownloadStrategy in a single formula
before, but a) it broke against later changes to
SubversionDownloadStrategy, and b) wasn't available to other formula.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2011-10-22 08:04:26 -07:00
Daniel Bingham
fbd0d7ec7b Fix :sha spec so that it actually checks out the SHA
:sha was used to prevent the "--depth" option to git clone, but was
never actually used to checkout the SHA.

Closes Homebrew/homebrew#7859.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-10-03 18:45:25 -05:00
Max Howell
6bd47cf0f9 Only try mirrors for CurlDownloadStrategies
Also adjust output text slightly for prettiness.

A possibly useful side effect here is safe_system has a defined Exception (subclassing RuntimeError) now.
2011-09-19 23:30:10 +01:00
Jack Nagel
d95e7079a2 Reset to remote master when updating git clones
When installing with --HEAD, cached repo clones do "git fetch origin"
followed by "git reset --hard". This will only reset the working tree
and index to the state of the local HEAD, but Homebrew will think it's
updated and install anyway. "git reset --hard origin/master" will
achieve the desired result.

Should fix Homebrew/homebrew#7613.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-09-13 22:26:36 -05:00
Dave Bayer
79873bf44a fix: svn update doesn't take url argument
`svn up` doesn't take url argument; compare `svn help up` to `svn help checkout`
Apparently `svn up` can ignore this argument (not documented), but providing this
argument could confuse code readers into believing that changing the url will
switch the branch. It doesn't; the argument is ignored.

This fix was relayed to me, but I've studied it further before posting.
It is related to the bug where --HEAD installs reuse the wrong cache.
Reading the former code, one might hope that providing a changed URL would
have `svn up` change branches. It doesn't; the url was ignored.

Closes Homebrew/homebrew#7159.

Signed-off-by: Max Howell <max@methylblue.com>
2011-09-01 14:03:01 +01:00
Dave Bayer
4743bc96e2 Fixes Homebrew/homebrew#7114; Cache confuses --HEAD and non--HEAD svn installs
Signed-off-by: Max Howell <max@methylblue.com>
2011-09-01 14:01:41 +01:00
Max Howell
1f5a39b977 git reset --hard after fetch; Fixes Homebrew/homebrew#7124
I believe this fixes it though I confess I didn't test. The guy who opened this issue is the expert.
2011-08-26 15:06:24 +01:00
Ben Burkert
f54a30a534 Only clone with a depth when targeting HEAD or a tag.
Closes Homebrew/homebrew#7101.

Signed-off-by: Max Howell <max@methylblue.com>
2011-08-26 14:31:49 +01:00
Max Howell
6ac0a28523 Implement bottles again
Bottles now pour purely, without doing all the other unnecessary stuff that happened before the `brew upgrade` code shuffle.

Formula.pourable? removed since it was install-specific metadata and not related to the formula itself. Now all such logic is in the FormulaInstaller which is much cleaner.

I also changed the bottle cache location to the normal directory and added a .bottle pre-extension. Thus you can see everything in one directory without messing about.
2011-08-24 22:30:43 +01:00
Max Howell
924f92300f Fix cache extension for github tarballs 2011-07-29 11:58:41 +01:00
Max Howell
72889ea6a8 Set origin remote URL when updating git clones
Thus the url we use can change.

This only works provided the urls both contain git repos with the same blobs. But this should always be true.
2011-07-27 12:51:16 +01:00
Max Howell
f3702b475b Raise if mirror can’t be determined
Adjust mirror ohai slightly.
2011-07-27 10:56:59 +01:00
Jan Lehnardt
c576f4088c Detect Apache mirror system and parse out the closest mirror.
All Apache Formulae should be updated to use the closer.vgi script
to specify downloads rather than a random mirror that could be out
of date or compromised. Apache's closer.cgi does periodic health
checks.

The base URL for the mirror system is

  http://www.apache.org/dyn/closer.cgi?path=#{filepath}

e.g.:

  http://www.apache.org/dyn/closer.cgi?path=/couchdb/1.0.3/apache-couchdb-1.0.3.tar.gz

Note: The addition of the "Actually downloading..." message is sub-optimal
as the message should probably be emitted in _fetch() rather than fetch(),
but I didn't want to change the way Homebrew works today, so I'm leaving
this for mxcl & team to sort out or adopt :)
2011-07-27 09:48:35 +01:00
Mike McQuaid
939a530ddc Make bottle path. 2011-06-21 19:04:18 +01:00
Mike McQuaid
31dea3b800 Add changes to Homebrew internals for bottling. 2011-06-08 22:19:10 +01:00
Adam Vandenberg
206c370d74 Move gz-only strategy into core. 2011-05-19 07:37:24 -07:00
pascalbertrand
11f3fca867 GitHub - use git for smart https repos
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2011-04-04 14:09:41 -07:00
Adam Vandenberg
7c4289d446 Fix inheritance style in download strats. 2011-03-28 19:53:43 -07:00
Simon COURTOIS
846087d585 Removing svn+ when using svn+http to avoid Undefined tunnel scheme error
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2011-03-22 10:18:23 -07:00
Adam Vandenberg
ebb6a98d67 Use --depth 1 more conservatively 2011-03-19 14:30:35 -07:00