aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rw-r--r--Library/Contributions/manpages/brew.1.md10
-rw-r--r--Library/Homebrew/cmd/fetch.rb16
2 files changed, 21 insertions, 5 deletions
diff --git a/Library/Contributions/manpages/brew.1.md b/Library/Contributions/manpages/brew.1.md
index 409eab697..3030f3b8d 100644
--- a/Library/Contributions/manpages/brew.1.md
+++ b/Library/Contributions/manpages/brew.1.md
@@ -154,16 +154,18 @@ didn't include with OS X.
Show the git log for the given formulae. Options that `git-log`(1)
recognizes can be passed before the formula list.
- * `fetch [--force] [-v] [--HEAD]` <formula>:
- Download the source package for the given <formula>. For tarballs, also
- prints MD5 and SHA1 checksums.
+ * `fetch [--force] [-v] [--HEAD] [--deps]` <formulae>:
+ Download the source packages for the given <formulae>.
+ For tarballs, also print MD5 and SHA1 checksums.
- If `--HEAD` is passed, download the HEAD version of <formula> instead. `-v`
+ If `--HEAD` is passed, download the HEAD versions of <formulae> instead. `-v`
may also be passed to make the VCS checkout verbose, useful for seeing if
an existing HEAD cache has been updated.
If `--force` is passed, remove a previously cached version and re-fetch.
+ If `--deps` is passed, also download dependencies for any listed <formulae>.
+
* `audit [--strict]`:
Check formulae for Homebrew coding style violations. This should be
run before submitting a new formula for inclusion.
diff --git a/Library/Homebrew/cmd/fetch.rb b/Library/Homebrew/cmd/fetch.rb
index 8ad3c7f7d..f8eada40a 100644
--- a/Library/Homebrew/cmd/fetch.rb
+++ b/Library/Homebrew/cmd/fetch.rb
@@ -4,7 +4,21 @@ require 'formula'
module Homebrew extend self
def fetch
- ARGV.formulae.each do |f|
+ if ARGV.include? '--deps'
+ bucket = []
+ ARGV.formulae.each do |f|
+ bucket << f
+ bucket << f.recursive_deps
+ end
+
+ bucket = bucket.flatten.uniq
+ else
+ bucket = ARGV.formulae
+ end
+
+ puts "Fetching: #{bucket * ', '}" if bucket.size > 1
+
+ bucket.each do |f|
if ARGV.include? "--force" or ARGV.include? "-f"
where_to = `brew --cache #{f.name}`.strip
FileUtils.rm_rf where_to unless where_to.empty?