aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Library/Homebrew/cmd/fetch.rb2
-rw-r--r--Library/Homebrew/cmd/install.rb11
-rw-r--r--Library/Homebrew/cmd/reinstall.rb2
-rw-r--r--Library/Homebrew/cmd/upgrade.rb2
-rw-r--r--Library/Homebrew/extend/ARGV.rb14
-rw-r--r--Library/Homebrew/formula.rb2
-rw-r--r--Library/Homebrew/formula_installer.rb2
-rw-r--r--share/doc/homebrew/brew.1.html11
-rw-r--r--share/man/man1/brew.17
9 files changed, 40 insertions, 13 deletions
diff --git a/Library/Homebrew/cmd/fetch.rb b/Library/Homebrew/cmd/fetch.rb
index 3a3956607..1dd6da4b3 100644
--- a/Library/Homebrew/cmd/fetch.rb
+++ b/Library/Homebrew/cmd/fetch.rb
@@ -64,7 +64,7 @@ module Homebrew
def fetch_bottle?(f)
return true if ARGV.force_bottle? && f.bottle
return false unless f.bottle && f.pour_bottle?
- return false if ARGV.build_from_source? || ARGV.build_bottle?
+ return false if ARGV.build_formula_from_source?(f)
return false unless f.bottle.compatible_cellar?
true
end
diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb
index 22be53ad0..d41ef66d4 100644
--- a/Library/Homebrew/cmd/install.rb
+++ b/Library/Homebrew/cmd/install.rb
@@ -24,8 +24,13 @@
#: `gcc-4.2` for Apple's GCC 4.2, or `gcc-4.9` for a Homebrew-provided GCC
#: 4.9.
#:
-#: If `--build-from-source` is passed, compile from source even if a bottle
-#: is provided for <formula>.
+#: If `--build-from-source` or `-s` is passed, compile the specified <formula> from
+#: source even if a bottle is provided. Dependencies will still be installed
+#: from bottles if they are available.
+#:
+#: If `HOMEBREW_BUILD_FROM_SOURCE` is set, regardless of whether `--build-from-source` was
+#: passed, then both <formula> and the dependencies installed as part of this process
+#: are built from source even if bottles are available.
#:
#: If `--force-bottle` is passed, install from a bottle if it exists
#: for the current version of OS X, even if custom options are given.
@@ -259,7 +264,7 @@ module Homebrew
fi.ignore_deps = ARGV.ignore_deps?
fi.only_deps = ARGV.only_deps?
fi.build_bottle = ARGV.build_bottle?
- fi.build_from_source = ARGV.build_from_source?
+ fi.build_from_source = ARGV.build_from_source? || ARGV.build_all_from_source?
fi.force_bottle = ARGV.force_bottle?
fi.interactive = ARGV.interactive?
fi.git = ARGV.git?
diff --git a/Library/Homebrew/cmd/reinstall.rb b/Library/Homebrew/cmd/reinstall.rb
index 8cf81fb61..4a23c00ec 100644
--- a/Library/Homebrew/cmd/reinstall.rb
+++ b/Library/Homebrew/cmd/reinstall.rb
@@ -26,7 +26,7 @@ module Homebrew
fi = FormulaInstaller.new(f)
fi.options = options
fi.build_bottle = ARGV.build_bottle? || (!f.bottled? && tab.build_bottle?)
- fi.build_from_source = ARGV.build_from_source?
+ fi.build_from_source = ARGV.build_from_source? || ARGV.build_all_from_source?
fi.force_bottle = ARGV.force_bottle?
fi.interactive = ARGV.interactive?
fi.git = ARGV.git?
diff --git a/Library/Homebrew/cmd/upgrade.rb b/Library/Homebrew/cmd/upgrade.rb
index 2f8407feb..c296e7757 100644
--- a/Library/Homebrew/cmd/upgrade.rb
+++ b/Library/Homebrew/cmd/upgrade.rb
@@ -71,7 +71,7 @@ module Homebrew
fi = FormulaInstaller.new(f)
fi.options = tab.used_options
fi.build_bottle = ARGV.build_bottle? || (!f.bottled? && tab.build_bottle?)
- fi.build_from_source = ARGV.build_from_source?
+ fi.build_from_source = ARGV.build_from_source? || ARGV.build_all_from_source?
fi.verbose = ARGV.verbose?
fi.quieter = ARGV.quieter?
fi.debug = ARGV.debug?
diff --git a/Library/Homebrew/extend/ARGV.rb b/Library/Homebrew/extend/ARGV.rb
index eec2172a2..bb26d453f 100644
--- a/Library/Homebrew/extend/ARGV.rb
+++ b/Library/Homebrew/extend/ARGV.rb
@@ -185,7 +185,19 @@ module HomebrewArgvExtension
end
def build_from_source?
- switch?("s") || include?("--build-from-source") || !!ENV["HOMEBREW_BUILD_FROM_SOURCE"]
+ switch?("s") || include?("--build-from-source")
+ end
+
+ def build_all_from_source?
+ !!ENV["HOMEBREW_BUILD_FROM_SOURCE"]
+ end
+
+ # Whether a given formula should be built from source during the current
+ # installation run.
+ def build_formula_from_source?(f)
+ return true if build_all_from_source?
+ return false unless (build_from_source? || build_bottle?)
+ formulae.any? { |argv_f| argv_f.full_name == f.full_name }
end
def flag?(flag)
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index afeb3ec27..a25a78f44 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -794,6 +794,8 @@ class Formula
opt_prefix+"Frameworks"
end
+ # Indicates that this formula supports bottles. (Not necessarily that one
+ # should be used in the current installation run.)
# Can be overridden to selectively disable bottles from formulae.
# Defaults to true so overridden version does not have to check if bottles
# are supported.
diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb
index 4de4a79dc..4b8dcf202 100644
--- a/Library/Homebrew/formula_installer.rb
+++ b/Library/Homebrew/formula_installer.rb
@@ -428,7 +428,7 @@ class FormulaInstaller
fi.options |= tab.used_options
fi.options |= Tab.remap_deprecated_options(df.deprecated_options, dep.options)
fi.options |= inherited_options
- fi.build_from_source = build_from_source?
+ fi.build_from_source = ARGV.build_formula_from_source?(df)
fi.verbose = verbose? && !quieter?
fi.debug = debug?
fi.prelude
diff --git a/share/doc/homebrew/brew.1.html b/share/doc/homebrew/brew.1.html
index daf613eb3..ca2230308 100644
--- a/share/doc/homebrew/brew.1.html
+++ b/share/doc/homebrew/brew.1.html
@@ -145,7 +145,7 @@ For tarballs, also print SHA-256 checksums.</p>
<p>If <code>--HEAD</code> or <code>--devel</code> is passed, fetch that version instead of the
stable version.</p>
-<p>If <code>-v</code> is passed, do a verbose VCS checkout, if the URL represents a CVS.
+<p>If <code>-v</code> is passed, do a verbose VCS checkout, if the URL represents a VCS.
This is useful for seeing if an existing VCS cache has been updated.</p>
<p>If <code>--force</code> is passed, remove a previously cached version and re-fetch.</p>
@@ -196,8 +196,13 @@ options but do not install the specified formula.</p>
<code>gcc-4.2</code> for Apple's GCC 4.2, or <code>gcc-4.9</code> for a Homebrew-provided GCC
4.9.</p>
-<p>If <code>--build-from-source</code> is passed, compile from source even if a bottle
-is provided for <var>formula</var>.</p>
+<p>If <code>--build-from-source</code> or <code>-s</code> is passed, compile the specified <var>formula</var> from
+source even if a bottle is provided. Dependencies will still be installed
+from bottles if they are available.</p>
+
+<p>If HOMEBREW_BUILD_FROM_SOURCE is set, regardless of whether <code>--build-from-source</code> was
+passed, then both <var>formula</var> and the dependencies installed as part of this process
+are built from source even if bottles are available.</p>
<p>If <code>--force-bottle</code> is passed, install from a bottle if it exists
for the current version of OS X, even if custom options are given.</p>
diff --git a/share/man/man1/brew.1 b/share/man/man1/brew.1
index acadd5de2..201e45a7d 100644
--- a/share/man/man1/brew.1
+++ b/share/man/man1/brew.1
@@ -196,7 +196,7 @@ Download the source packages for the given \fIformulae\fR\. For tarballs, also p
If \fB\-\-HEAD\fR or \fB\-\-devel\fR is passed, fetch that version instead of the stable version\.
.
.IP
-If \fB\-v\fR is passed, do a verbose VCS checkout, if the URL represents a CVS\. This is useful for seeing if an existing VCS cache has been updated\.
+If \fB\-v\fR is passed, do a verbose VCS checkout, if the URL represents a VCS\. This is useful for seeing if an existing VCS cache has been updated\.
.
.IP
If \fB\-\-force\fR is passed, remove a previously cached version and re\-fetch\.
@@ -265,7 +265,10 @@ If \fB\-\-only\-dependencies\fR is passed, install the dependencies with specifi
If \fB\-\-cc=\fR\fIcompiler\fR is passed, attempt to compile using \fIcompiler\fR\. \fIcompiler\fR should be the name of the compiler\'s executable, for instance \fBgcc\-4\.2\fR for Apple\'s GCC 4\.2, or \fBgcc\-4\.9\fR for a Homebrew\-provided GCC 4\.9\.
.
.IP
-If \fB\-\-build\-from\-source\fR is passed, compile from source even if a bottle is provided for \fIformula\fR\.
+If \fB\-\-build\-from\-source\fR or \fB\-s\fR is passed, compile the specified \fIformula\fR from source even if a bottle is provided\. Dependencies will still be installed from bottles if they are available\.
+.
+.IP
+If HOMEBREW_BUILD_FROM_SOURCE is set, regardless of whether \fB\-\-build\-from\-source\fR was passed, then both \fIformula\fR and the dependencies installed as part of this process are built from source even if bottles are available\.
.
.IP
If \fB\-\-force\-bottle\fR is passed, install from a bottle if it exists for the current version of OS X, even if custom options are given\.