256 Commits

Author SHA1 Message Date
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
Xiyue Deng
869642e635 Fix download strategy for SVN HEAD
After converting to Pathname to create paths, using '+=' will result in
path concatenation by '/', which result in weird path like
'gcc--svn/-HEAD'. This patch should fix this.

Closes Homebrew/homebrew#19233.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2013-04-16 16:17:48 -05:00
Jack Nagel
1426b92a82 Only dup and shift when specs hash is populated 2013-04-16 14:18:23 -05:00
Jack Nagel
49682e854d Avoid expensive Pathname concatenation 2013-04-15 15:00:57 -05:00
Jack Nagel
841c8bedca Clean up remaining DownloadStrategy initializers 2013-04-15 15:00:57 -05:00
Jack Nagel
6ed441bd71 SubversionDownloadStrategy: *really* fix pathname concatenation 2013-04-08 23:07:21 -05:00
Jack Nagel
b681ed4200 SubversionDownloadStrategy: fix pathname concatenation
Fixes Homebrew/homebrew#19066.
2013-04-08 19:18:19 -05:00
Jack Nagel
8cf0f34aa7 Download strategies require a usable name
We should handle this case in some predictable way, but until we do,
let's raise a more appropriate exception. It would also be good to get
rid of the duplication here.
2013-04-07 20:59:50 -05:00
Jack Nagel
2288f63197 Tests for AbstractDownloadStrategy 2013-04-07 20:59:50 -05:00
Jack Nagel
9db0e68eb6 Unify indentation of access modifiers
These are class method calls, not some special keyword, and should be
indented as such (also all standard Ruby indenters do this).
2013-04-07 20:59:49 -05:00
Jack Nagel
0d45c3c0f2 Suppress uninitialized instance variable warnings 2013-03-28 17:37:29 -05:00
Mike McQuaid
9837bbda55 Add with_system_path to run using system PATHs.
Needed for Linux compatibility.
2013-03-11 18:26:25 +00:00
Jack Nagel
528072f7d7 GitDownloadStrategy: force checkouts
Local changes to the cached repository should not cause fetch or install
to error out.
2013-02-17 15:54:22 -06:00
Jack Nagel
6d1c6dcdea GitDownloadStrategy: reset after checkout during updates
Otherwise, if the local branch is behind the remote branch, or has
diverged, we will stage the wrong revision.
2013-02-17 15:53:35 -06:00
Jack Nagel
145647fc45 GitDownloadStrategy: factor out checkout args 2013-02-17 15:43:16 -06:00
Jack Nagel
612745352d GitDownloadStrategy: generalize has_tag? to has_ref? 2013-02-17 15:41:24 -06:00
Jack Nagel
2ef79d1387 GitDownloadStrategy: default to remote HEAD during checkout 2013-02-14 17:29:59 -06:00
Jack Nagel
166e262312 GitDownloadStrategy: quiet reset in non-verbose mode 2013-02-14 17:29:59 -06:00
Jack Nagel
5f5d6ace5f GitDownloadStrategy: only fetch from remote when necessary
When we are building from a tag, and that tag is already present in the
cached repository, we don't to hit the network; everything we need
already exists.
2013-02-14 17:29:58 -06:00
Jack Nagel
02ad6442e7 GitDownloadStrategy: extract checkout from #stage 2013-02-14 17:29:58 -06:00
Jack Nagel
8b27989d11 GitDownloadStrategy: split up submodule update and checkout 2013-02-14 17:29:58 -06:00
Jack Nagel
e186d9a136 GitDownloadStrategy: split #fetch into several methods 2013-02-14 17:29:58 -06:00
Jack Nagel
248891fde1 Avoid nil in URL specs 2013-02-11 20:52:07 -06:00