aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Library/Contributions/manpages/brew.1.md10
-rw-r--r--Library/Homebrew/cmd/fetch.rb16
-rw-r--r--share/man/man1/brew.19
3 files changed, 27 insertions, 8 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?
diff --git a/share/man/man1/brew.1 b/share/man/man1/brew.1
index ed8a909dc..c394dd7f6 100644
--- a/share/man/man1/brew.1
+++ b/share/man/man1/brew.1
@@ -171,15 +171,18 @@ For all installed or specific formulae, remove any older versions from the cella
Show the git log for the given formulae\. Options that \fBgit\-log\fR(1) recognizes can be passed before the formula list\.
.
.TP
-\fBfetch [\-\-force] [\-v] [\-\-HEAD]\fR \fIformula\fR
-Download the source package for the given \fIformula\fR\. For tarballs, also prints MD5 and SHA1 checksums\.
+\fBfetch [\-\-force] [\-v] [\-\-HEAD] [\-\-deps]\fR \fIformulae\fR
+Download the source packages for the given \fIformulae\fR\. For tarballs, also print MD5 and SHA1 checksums\.
.
.IP
-If \fB\-\-HEAD\fR is passed, download the HEAD version of \fIformula\fR instead\. \fB\-v\fR may also be passed to make the VCS checkout verbose, useful for seeing if an existing HEAD cache has been updated\.
+If \fB\-\-HEAD\fR is passed, download the HEAD versions of \fIformulae\fR instead\. \fB\-v\fR may also be passed to make the VCS checkout verbose, useful for seeing if an existing HEAD cache has been updated\.
.
.IP
If \fB\-\-force\fR is passed, remove a previously cached version and re\-fetch\.
.
+.IP
+If \fB\-\-deps\fR is passed, also download dependencies for any listed \fIformulae\fR\.
+.
.TP
\fBaudit [\-\-strict]\fR
Check formulae for Homebrew coding style violations\. This should be run before submitting a new formula for inclusion\.