446 Commits

Author SHA1 Message Date
Jack Nagel
90f938dc86 Stop returning a path from CurlDownloadStrategy#fetch
Download strategies do not consistently return a value from `fetch`, so
our code calls `cached_location` to get the path instead.
2014-12-09 12:47:10 -05:00
Jack Nagel
8560ad3ad0 Use quiet_safe_system to silence submodule updates 2014-12-06 20:57:23 -05:00
Jack Nagel
04d287e8db Use quiet_safe_system to silence submodule checkouts 2014-12-06 20:57:23 -05:00
Jack Nagel
5d811c519b Use quiet_safe_system to silence bzr updates 2014-12-06 20:57:22 -05:00
Jack Nagel
37c08393db Use quiet_safe_system to silence CVS updates 2014-12-06 17:18:34 -05:00
Jack Nagel
7e844cad1c Simplify fossil checkouts 2014-12-06 16:48:20 -05:00
Jack Nagel
dd2446ab08 Extract part of stage method to VCS strategy superclass 2014-12-06 16:00:20 -05:00
Jack Nagel
5f0feb7e85 Remove years-old TODO 2014-12-06 15:54:04 -05:00
Jack Nagel
df25be78b5 Demote FIXME to a normal comment 2014-12-06 15:53:37 -05:00
Jack Nagel
6081874612 Mark private SubversionDownloadStrategy methods 2014-12-06 15:02:49 -05:00
Jack Nagel
5afa11ecab Move fetch implementation into VCS strategy superclass 2014-12-06 15:02:49 -05:00
Jack Nagel
4026e035ad Use start_with? instead of a regexp 2014-12-06 15:02:49 -05:00
Jack Nagel
01dc112b60 Move SVN URL munging to initialize 2014-12-06 15:02:49 -05:00
Jack Nagel
62c1c61ec2 Remove method that duplicates superclass implementation 2014-12-06 15:02:49 -05:00
Jack Nagel
f189454328 Extract update from fetch in VCS strategies 2014-12-06 15:02:49 -05:00
Jack Nagel
3a20562d6e Add clone_repo to remaining VCS strategies 2014-12-06 15:02:49 -05:00
Jack Nagel
8debc18839 Add repo_valid? to remaining VCS strategies 2014-12-06 15:02:49 -05:00
Jack Nagel
a2dbcfee5b Make repo_valid? private 2014-12-06 15:02:48 -05:00
Jack Nagel
f43fe41423 Make __path methods private 2014-12-06 15:02:48 -05:00
Jack Nagel
54785bb8a0 Make cache_tag private 2014-12-06 15:02:48 -05:00
Jack Nagel
6a56c45fbf Mark private VCSDownloadStrategy methods 2014-12-06 15:02:48 -05:00
Jack Nagel
566d6b3a46 CurlDownloadStrategy: initialize attributes in initializer
The downloader is instantiated on-demand, so we no longer need the lazy
initialization here.
2014-12-05 22:11:23 -05:00
Jack Nagel
853399da44 Provide VCSDownloadStrategy#head? 2014-12-05 18:57:28 -05:00
Jack Nagel
ecba7b4e7e Stop supporting hg found in share/python 2014-12-05 17:05:48 -05:00
Jack Nagel
ed842246f7 Make the git download strategy default to :branch => "master"
Fixes Homebrew/homebrew#33437.
2014-12-03 17:25:51 -05:00
Jack Nagel
32ab3bb32f Use curl -d to pass query parameters in the bottle download strategy
Fixes Homebrew/homebrew#33355.
2014-10-19 23:01:09 -05:00
Jack Nagel
09b7f40b25 Simplify UnsafeSubversionDownloadStrategy 2014-10-07 21:33:15 -05:00
Jack Nagel
5dd1092f5f Remove last usage of StrictSubversionDownloadStrategy
This strategy is only used in one formula, so we can just replace it
with a dependency. It could be done with a requirement, but since this
is a low-impact change (it only matters for head builds on Leopard), I'm
not sure it's worth the effort.

The constant is retained for compatibility, though I could find only one
other reference to it on GitHub, in a formula that was removed from core
almost two years ago.
2014-10-05 20:15:18 -05:00
Larry Shaffer
ba8ef6a7ed Add friendlier local file missing error
Closes Homebrew/homebrew#26481.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2014-08-24 23:26:36 -05:00
Dabrien 'Dabe' Murphy
46ca68de5e Modify "git rev-parse --verify" args in "has_ref?"
Per the `git-rev-parse(1)` manpage:

  --verify Verify that exactly one parameter is provided, and that it
  can be turned into a raw 20-byte SHA-1 that can be used to access the
  object database. If so, emit it to the standard output; otherwise,
  error out.

  If you want to make sure that the output actually names an object in
  your object database and/or can be used as a specific type of object
  For example, git rev-parse "$VAR^{commit}" will make sure $VAR names
  an existing object that is a commit-ish (i.e. a commit, or an
  annotated tag that points at a commit).

That actually means that:

  git rev-parse --verify af8e768e2bd3b4398bca033998f83b0eb8874914

will _always_ return the SHA-1 hash — regardless of whether or not
that's actually a valid reference!

Thus, when `GitDownloadStragtegy#update_repo` tries to check
`has_ref?`, it mistakenly succeeds, and doesn't actually do a `git fetch
origin`.

The fix is to use:

  git rev-parse --verify "af8e768e2bd3b4398bca033998f83b0eb8874914^{commit}"

Fixes Homebrew/homebrew#31045.
Closes Homebrew/homebrew#31054.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2014-07-23 21:07:02 -05:00
Maurus Cuelenaere
efcfbcc98b Fix checking out recursive git submodules
When nested submodules appear in a git repository, the `git submodule foreach
git checkout-index ..` command would fail because it would checkout at the root
directory instead of in its parent(s)' folder.

Eg: root/submodule1/submodule2 would be checked out in root/submodule2

Closes Homebrew/homebrew#30841.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2014-07-18 21:02:56 -05:00
Jack Nagel
598e7010f9 Remove dead code
This method is identical to the superclass implementation.
2014-07-17 21:55:21 -05:00
Jack Nagel
22038d5269 Remove special case for now-deprecated GitHub URLs 2014-07-17 15:18:13 -05:00
Jack Nagel
4295e76d3f Remove more dead code 2014-07-16 23:22:04 -05:00
Jack Nagel
197dbe5601 Remove dead code
Formula objects are always constructed with an explicit name, so we no
longer need to special case an empty name or the name "__UNKNOWN__".
2014-07-16 18:30:52 -05:00
Jack Nagel
2d8a3ac35a Use popen wrapper
Closes Homebrew/homebrew#30678.
2014-07-05 15:41:22 -05:00
Jack Nagel
e91f359a56 Remove an unnecessary use of ARGV.build_head? 2014-06-15 23:31:58 -05:00
Jack Nagel
d29d5d7e92 Fix some places where encoding issues manifest on ruby 2.0 2014-06-04 01:37:56 -05:00
Jack Nagel
0133afe6f8 Remove unnecessary use of Dir[] 2014-06-01 15:27:40 -05:00
Jack Nagel
0445318494 Remove no-op directory traversal 2014-06-01 15:27:40 -05:00
Mike McQuaid
3710beda66 download_strategy: fix Git repo updating.
Git repositories should always be updated when the ref is a branch.
They should be also updated if no ref was specified or if the ref isn’t
present. This stops the repo being updated if we’re building a specific
revision and it is present. Additionally, this stops the update barfing
on repositories where we’re using a revision and there is no upstream
`master` branch.

Closes Homebrew/homebrew#29218.
2014-05-13 16:23:06 +01:00
Jack Nagel
260a351663 Recognize and extract xar files 2014-04-06 12:35:54 -05:00
Jack Nagel
7541f13164 Extract common decompression code to a method 2014-04-06 11:34:08 -05:00
Jack Nagel
cb5da28b5c Handle untarred bzip2 files
Fixes Homebrew/homebrew#28187.
2014-04-06 11:33:50 -05:00
Jack Nagel
45bdeadd94 Set bottle download strategy directly
We know what strategy we want, so going through DownloadStrategyDetector
is wasted work. Now we can remove those patterns from the detector and
have two fewer branches each time through.
2014-03-18 21:28:33 -05:00
Jack Nagel
aaea4d236a Reorder download strategy symbols by frequency 2014-03-18 21:28:33 -05:00
Jack Nagel
eace29a50e Reorder download strategy regexps by frequency 2014-03-18 21:28:29 -05:00
Josh Tilles
2225ebc44e Adapt to Git 1.9's submodule foreach changes
Closes Homebrew/homebrew#26871.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2014-02-21 00:05:42 -05:00
Jack Nagel
457d409f80 GitDownloadStrategy: fix typo'd parameter name
This should be "resource", not "resources", though it works anyway
because there is a also "resource" reader method.
2014-02-15 01:43:06 -05:00
Jack Nagel
7eec2d8b5a GitDownloadStrategy: allow disabling of shallow clone
Closes Homebrew/homebrew#25751.
Closes Homebrew/homebrew#26730.
2014-02-14 16:55:26 -05:00