brew install: make -s apply only to given formula, not deps (#205)
This commit is contained in:
parent
12686ad417
commit
d887dd39ec
@ -64,7 +64,7 @@ module Homebrew
|
|||||||
def fetch_bottle?(f)
|
def fetch_bottle?(f)
|
||||||
return true if ARGV.force_bottle? && f.bottle
|
return true if ARGV.force_bottle? && f.bottle
|
||||||
return false unless f.bottle && f.pour_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?
|
return false unless f.bottle.compatible_cellar?
|
||||||
true
|
true
|
||||||
end
|
end
|
||||||
|
|||||||
@ -24,8 +24,13 @@
|
|||||||
#: `gcc-4.2` for Apple's GCC 4.2, or `gcc-4.9` for a Homebrew-provided GCC
|
#: `gcc-4.2` for Apple's GCC 4.2, or `gcc-4.9` for a Homebrew-provided GCC
|
||||||
#: 4.9.
|
#: 4.9.
|
||||||
#:
|
#:
|
||||||
#: If `--build-from-source` is passed, compile from source even if a bottle
|
#: If `--build-from-source` or `-s` is passed, compile the specified <formula> from
|
||||||
#: is provided for <formula>.
|
#: 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
|
#: 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.
|
#: 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.ignore_deps = ARGV.ignore_deps?
|
||||||
fi.only_deps = ARGV.only_deps?
|
fi.only_deps = ARGV.only_deps?
|
||||||
fi.build_bottle = ARGV.build_bottle?
|
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.force_bottle = ARGV.force_bottle?
|
||||||
fi.interactive = ARGV.interactive?
|
fi.interactive = ARGV.interactive?
|
||||||
fi.git = ARGV.git?
|
fi.git = ARGV.git?
|
||||||
|
|||||||
@ -26,7 +26,7 @@ module Homebrew
|
|||||||
fi = FormulaInstaller.new(f)
|
fi = FormulaInstaller.new(f)
|
||||||
fi.options = options
|
fi.options = options
|
||||||
fi.build_bottle = ARGV.build_bottle? || (!f.bottled? && tab.build_bottle?)
|
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.force_bottle = ARGV.force_bottle?
|
||||||
fi.interactive = ARGV.interactive?
|
fi.interactive = ARGV.interactive?
|
||||||
fi.git = ARGV.git?
|
fi.git = ARGV.git?
|
||||||
|
|||||||
@ -71,7 +71,7 @@ module Homebrew
|
|||||||
fi = FormulaInstaller.new(f)
|
fi = FormulaInstaller.new(f)
|
||||||
fi.options = tab.used_options
|
fi.options = tab.used_options
|
||||||
fi.build_bottle = ARGV.build_bottle? || (!f.bottled? && tab.build_bottle?)
|
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.verbose = ARGV.verbose?
|
||||||
fi.quieter = ARGV.quieter?
|
fi.quieter = ARGV.quieter?
|
||||||
fi.debug = ARGV.debug?
|
fi.debug = ARGV.debug?
|
||||||
|
|||||||
@ -185,7 +185,19 @@ module HomebrewArgvExtension
|
|||||||
end
|
end
|
||||||
|
|
||||||
def build_from_source?
|
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
|
end
|
||||||
|
|
||||||
def flag?(flag)
|
def flag?(flag)
|
||||||
|
|||||||
@ -794,6 +794,8 @@ class Formula
|
|||||||
opt_prefix+"Frameworks"
|
opt_prefix+"Frameworks"
|
||||||
end
|
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.
|
# Can be overridden to selectively disable bottles from formulae.
|
||||||
# Defaults to true so overridden version does not have to check if bottles
|
# Defaults to true so overridden version does not have to check if bottles
|
||||||
# are supported.
|
# are supported.
|
||||||
|
|||||||
@ -428,7 +428,7 @@ class FormulaInstaller
|
|||||||
fi.options |= tab.used_options
|
fi.options |= tab.used_options
|
||||||
fi.options |= Tab.remap_deprecated_options(df.deprecated_options, dep.options)
|
fi.options |= Tab.remap_deprecated_options(df.deprecated_options, dep.options)
|
||||||
fi.options |= inherited_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.verbose = verbose? && !quieter?
|
||||||
fi.debug = debug?
|
fi.debug = debug?
|
||||||
fi.prelude
|
fi.prelude
|
||||||
|
|||||||
@ -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
|
<p>If <code>--HEAD</code> or <code>--devel</code> is passed, fetch that version instead of the
|
||||||
stable version.</p>
|
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>
|
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>
|
<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
|
<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>
|
4.9.</p>
|
||||||
|
|
||||||
<p>If <code>--build-from-source</code> is passed, compile from source even if a bottle
|
<p>If <code>--build-from-source</code> or <code>-s</code> is passed, compile the specified <var>formula</var> from
|
||||||
is provided for <var>formula</var>.</p>
|
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
|
<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>
|
for the current version of OS X, even if custom options are given.</p>
|
||||||
|
|||||||
@ -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\.
|
If \fB\-\-HEAD\fR or \fB\-\-devel\fR is passed, fetch that version instead of the stable version\.
|
||||||
.
|
.
|
||||||
.IP
|
.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
|
.IP
|
||||||
If \fB\-\-force\fR is passed, remove a previously cached version and re\-fetch\.
|
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\.
|
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
|
.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
|
.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\.
|
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\.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user