428 Commits

Author SHA1 Message Date
Jack Nagel
284a3716ea CurlDownloadStrategy: dup mirror list before mutating it 2013-10-11 19:14:52 -05:00
Jack Nagel
3f0a409ec5 GitDownloadStrategy: remove redundant use of nostdout 2013-10-11 00:21:25 -05:00
Jack Nagel
9705e922e3 GitDownloadStrategy: remove redundant use of :quiet_flag 2013-10-11 00:21:25 -05:00
Jack Nagel
90b1102f1a GitDownloadStrategy: @@git is always a string, so inline it 2013-10-11 00:21:24 -05:00
Jack Nagel
069d5d2dce SubversionDownloadStrategy: @@svn is always a string, so inline it 2013-10-11 00:21:24 -05:00
Jack Nagel
932091f9e0 VCSDownloadStrategy: pull construction of @clone into superclass 2013-10-11 00:21:23 -05:00
Jack Nagel
ed7f8faed2 VCSDownloadStrategy: rename checkout_name to cache_filename 2013-10-11 00:21:23 -05:00
Jack Nagel
dd719e7ca6 Move cached_location up to VCSDownloadStrategy 2013-10-10 11:24:36 -05:00
Jack Nagel
1626282c45 download_strategy: rename @co to @clone for uniformity 2013-10-10 11:24:35 -05:00
Jack Nagel
05a2261877 MercurialDownloadStrategy: avoid creating Formula object just for opt_prefix 2013-10-10 10:31:08 -05:00
Jack Nagel
4a2fc89c46 S3DownloadStrategy: use temporary_path accessor 2013-10-09 21:55:58 -05:00
Jack Nagel
bf1d04f039 Move checkout_name from AbstractDownloadStrategy to VCSDownloadStrategy 2013-10-09 21:41:15 -05:00
Jack Nagel
3cda215881 VCSDownloadStrategy: destructure spec hash more efficiently 2013-10-09 21:41:15 -05:00
Jack Nagel
6c5a9ae0fb Extract a new superclass for VCS-based download strategies 2013-10-09 21:41:15 -05:00
Jack Nagel
e27574b27b SubversionDownloadStrategy: stop mutating revisions hash 2013-10-09 21:41:14 -05:00
Jack Nagel
3d7de0065b download_strategy: style nits 2013-10-09 21:41:14 -05:00
Jack Nagel
c790a4f45e download_strategy: rename @spec to @ref_type 2013-10-09 21:41:14 -05:00
Jack Nagel
57560c03e6 Handle invalid names in download strategies
When subformulae are initialized without a name parameter, Homebrew
assigns the name "__UNKNOWN__". This may cause collisions in the cache.

Currently CurlDownloadStrategy and its descendants handles this by
extracting the basename form the URL and using that as the cached
filename. However, other strategies simply raise an exception.

We can improve the other strategies by URL-encoding the URL string and
using that as the cached directory name.

Note that this happens very rarely, especially now that resources (which
always have a name) are preferred to subformulae. The most common case
is a subformula that specifies a head download.

Closes Homebrew/homebrew#22949.
2013-09-30 22:56:02 -05:00
Jack Nagel
a380265e90 BazaarDownloadStrategy: handle corrupt checkouts 2013-09-28 18:38:32 -05:00
Jack Nagel
06d2aa11ee Remove commented out code, this is in git after all 2013-09-28 18:38:30 -05:00
Jack Nagel
da2efa46aa SubversionDownloadStrategy: handle corrupt checkouts 2013-09-28 18:01:00 -05:00
Jack Nagel
5468733e63 MercurialDownloadStrategy: pull quietly in non-verbose mode 2013-09-28 17:09:05 -05:00
Jack Nagel
7deb2f85e8 MercurialDownloadStrategy: handle corrupt checkouts 2013-09-28 17:08:48 -05:00
Jack Nagel
c5289f2503 Infer dependencies from download strategies and URLs
Closes Homebrew/homebrew#20849.
Closes Homebrew/homebrew#22871.
2013-09-28 16:37:05 -05:00
Jack Nagel
d1ce5bafc9 Raise when given an invalid download strategy spec
When DownloadStrategyDetector.detect is given a second argument, and
that argument is not a symbol or an AbstractDownloadStrategy subclass,
it is silently ignored, and we fall back to guessing the strategy based
on the URL.

This means I can do

  url 'http://foo.com/bar.tar.gz', :using => Class.new

and things will appear to work, even though I have clearly passed an
invalid value for :using.

A more useful behavior is to raise an exception for unknown strategy
specifications.
2013-09-26 17:00:00 -05:00
Jack Nagel
1fb9f85c5f Simplify setup for local bottle installation
Closes Homebrew/homebrew#22833.
2013-09-26 10:04:45 -05:00
Jack Nagel
e420683a07 Move "Pouring" message to relevant download strategies 2013-09-25 17:41:11 -05:00
Raymie Stata
694a9c2eed add S3DownloadStrategy
downloads tarballs from public and private S3 buckets

Closes Homebrew/homebrew#22779.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2013-09-24 20:43:34 -07:00
Jack Nagel
7e981fbedc Initialize cached filenames lazily
Closes Homebrew/homebrew#22751.
2013-09-23 21:39:24 -05:00
Jack Nagel
978f0887cb Download strategies take a resource now 2013-09-17 21:29:53 -05:00
Jack Nagel
625d61fe5d Treat target as binary when unpacking gzip-only archives 2013-09-16 14:39:54 -05:00
Jack Nagel
8bb26ee2d9 SubversionDownloadStrategy: fix reference to removed method 2013-08-15 15:46:03 -05:00
Jack Nagel
b730a85e3a Remove outdated comment 2013-08-13 17:09:25 -05:00
Jack Nagel
d08508f7c7 Avoid reading whole files into memory during decompression 2013-08-13 16:43:51 -05:00
Adam Vandenberg
b1f394f807 alphabetize list 2013-08-08 21:57:13 -07:00
Adam Vandenberg
a3796d7b72 Add SourceForge hg pattern 2013-08-08 21:56:18 -07:00
Jack Nagel
3dea341732 Enable connection timeouts when mirrors are available
Closes Homebrew/homebrew#21623.
2013-08-06 12:54:47 -05:00
Tijs Zwinkels - TinkerTank
008476940f Add support for the :ssl3 download-strategy.
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2013-08-05 09:12:32 -07:00
Misty De Meo
ecfb175cdc Fix :gzip_only extraction
gunzip can only extract files in-place, so just shelling out to
gunzip was actually leaving the uncompressed file in Homebrew's cache,
not in the temporary directory. (It also destroyed the original
compressed file.)
2013-06-27 12:24:58 -05:00
Jack Nagel
083b3c84d0 Add Utils::JSON to wrap the JSON implementation 2013-06-22 21:34:02 -05:00
Adam Vandenberg
aff66c3b86 Sniff for non-tarred gzips
Don't try to untar non-tarred gzips.
2013-06-08 15:37:32 -07:00
Mike McQuaid
95f9c6227a Use new download strategy for local bottles.
Fixes installation of e.g. ScriptFileFormula/denominator bottles.
2013-06-08 16:41:23 +01:00
Adam Vandenberg
d5c331c072 CurlDownloadStrategy no longer uses ? in downloaded filenames
Strip `?` and trailing characters from URL extensions and basenames.

This makes some install methods cleaner, and prevents staging of files
with `?` in the name, as that is a weird character.

Affects 2 formulae in core (though potentially externals will need to be fixed.)
2013-06-07 20:57:59 -07:00
Jack Nagel
a8f5527f74 CurlDownloadStrategy: use opt path for xz 2013-06-07 16:35:21 -05:00
Shaun Jackman
fa7291f21b CurlDownloadStrategy: use with_system_path to locate tar
Closes Homebrew/homebrew#20316.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2013-06-07 16:35:14 -05:00
Samuel John
623b21a7bd mercurial: Install python bindings properly
Also allow to build with --HEAD by making brew's
download strategy aware of a brewed but unlined hg.

Adapted the caveats so that the procedure to brew
hg --HEAD is clear.

Mention how to config hgk in the caveats.
2013-06-04 17:05:02 +02:00
Samuel John
c524895666 Python 2.x and 3.x support
New `depends_on :python` Dependency.
New `depends_on :python3` Dependency.

To avoid having multiple formulae with endings -py2 and -py3,
we will handle support for different pythons (2.x vs. 3.x)
in the same formula.
Further brewed vs. external python will be transparently supported.

The formula also gets a new object `python`, which is false if
no Python is available or the user has disabled it. Otherwise
it is defined and provides several support methods:

python.site_packages # the site-packages in the formula's Cellar
python.global_site_packages
python.binary # the full path to the python binary
python.prefix
python.version
python.version.major
python.version.minor
python.xy # => e.g. "python2.7"
python.incdir # includes of python
python.libdir # the python dylib library
python.pkg_config_path # used internally by brew
python.from_osx?
python.framework?
python.universal?
python.pypy?
python.standard_caveats # Text to set PYTHONPATH for python.from_osx?
python.if3then3 # => "" for 2.x and to "3" for 3.x.

Further, to avoid code duplication, `python` takes an optional
block that is run twice if the formula defines depends_on
:python AND :python3.

python do
  system python, 'setup.py', "--prefix=#{prefix}"
end

Read more in the Homebrew wiki.
2013-06-03 17:29:43 +02:00
Jack Nagel
68b3e6f3fb Add required methods to AbstractDownloadStrategy
Fixes Homebrew/homebrew#20080.
2013-05-26 09:16:27 -05:00
Jack Nagel
65775e4318 CurlDownloadStrategy: remove "tarball_path" accessor
This information is already exposed as "cached_location", which is
common to all download strategies.
2013-05-16 15:26:25 -05:00
Adam Vandenberg
13c604035b Retry downloads if a server doesn't support byte ranges
If an incomplete download exists, and the HTTP server doesn't support
byte ranges, delete the incomplete download and retry once.

Tested with freeling, whose server does not support byte ranges.

Closes Homebrew/homebrew#19757.
2013-05-13 07:32:03 -07:00