575 Commits

Author SHA1 Message Date
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
Jack Nagel
e22af69149 Catch JSON decoding errors in Apache download strategy
c.f. Homebrew/homebrew#17772.
2013-02-11 17:14:26 -06:00
Jack Nagel
7b8f4b3d19 kill dead code 2013-02-10 20:32:18 -06:00
Jack Nagel
8e2b8c1419 CurlDownloadStrategy: remove pointless type introspection 2013-02-10 20:10:15 -06:00
Jack Nagel
ef6d01fc8f download_strategy: move requires out of method
This can cause subtle issues when an exception is marshaled between the
build process and the main Homebrew process, as the marshaled exception
may contain URI objects even when the main Homebrew process has not
loaded the URI library.

Closes Homebrew/homebrew#17642.
2013-02-07 12:45:37 -06:00
Jack Nagel
f9670f5dda download_strategy: fix typo 2013-02-02 16:21:25 -06:00
Simon Sigurdhsson
af3bfab9db Make CurlDownloadStrategy resume aborted downloads
* `CurlDownloadStrategy#_fetch` (and the same methods in its
  subclasses) now fetches the file to a temporary path, and
  `CurlDownloadStrategy#fetch` moves it to the correct location.
* `Homebrew#cleanup` cleans the temporary files `CurlDownloadStrategy`
  creates if they're left in the cache.

Closes Homebrew/homebrew#13953.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2013-02-02 14:05:40 -08:00
Mike McQuaid
161b89ddf0 Add SourceForge bottle mirror selection.
Use ENV['HOMEBREW_SOURCEFORGE_MIRROR'].

Closes Homebrew/homebrew#15642.
Closes Homebrew/homebrew#17368.
2013-01-30 21:29:19 -08:00
Mike McQuaid
1107171f83 Cleanup old bottle syntax. 2013-01-29 17:14:00 -08:00
Jack Nagel
0a9f5c6867 CurlApacheMirrorDownloadStrategy: fetch mirrors in JSON format
Closes Homebrew/homebrew#16457.
2013-01-23 18:01:06 -06:00
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