bottle: Add option --or-later

If --or-later is passed, append _or_later to the bottle tag.
This commit is contained in:
Shaun Jackman 2018-03-31 00:03:08 -07:00
parent e3cd9c972f
commit df68d12be4
3 changed files with 15 additions and 5 deletions

View File

@ -1,4 +1,4 @@
#: * `bottle` [`--verbose`] [`--no-rebuild`|`--keep-old`] [`--skip-relocation`] [`--root-url=`<URL>] [`--force-core-tap`] <formulae>:
#: * `bottle` [`--verbose`] [`--no-rebuild`|`--keep-old`] [`--skip-relocation`] [`--or-later`] [`--root-url=`<URL>] [`--force-core-tap`] <formulae>:
#: Generate a bottle (binary package) from a formula installed with
#: `--build-bottle`.
#:
@ -15,6 +15,8 @@
#: If `--root-url` is passed, use the specified <URL> as the root of the
#: bottle's URL instead of Homebrew's default.
#:
#: If `--or-later` is passed, append _or_later to the bottle tag.
#:
#: If `--force-core-tap` is passed, build a bottle even if <formula> is not
#: in homebrew/core or any installed taps.
#:
@ -57,7 +59,7 @@ BOTTLE_ERB = <<-EOS.freeze
<% checksums.each do |checksum_type, checksum_values| %>
<% checksum_values.each do |checksum_value| %>
<% checksum, macos = checksum_value.shift %>
<%= checksum_type %> "<%= checksum %>" => :<%= macos %>
<%= checksum_type %> "<%= checksum %>" => :<%= macos %><%= "_or_later" if Homebrew.args.or_later? %>
<% end %>
<% end %>
end
@ -78,6 +80,7 @@ module Homebrew
switch "--write"
switch "--no-commit"
switch "--json"
switch "--or-later"
switch :verbose
switch :debug
flag "--root-url"
@ -360,6 +363,8 @@ module Homebrew
puts output
return unless @args.json?
tag = Utils::Bottles.tag.to_s
tag += "_or_later" if args.or_later?
json = {
f.full_name => {
"formula" => {
@ -372,7 +377,7 @@ module Homebrew
"cellar" => bottle.cellar.to_s,
"rebuild" => bottle.rebuild,
"tags" => {
Utils::Bottles.tag.to_s => {
tag => {
"filename" => filename.to_s,
"sha256" => sha256,
},

View File

@ -664,7 +664,7 @@ With `--verbose` or `-v`, many commands print extra debugging information. Note
`audit` exits with a non-zero status if any errors are found. This is useful,
for instance, for implementing pre-commit hooks.
* `bottle` [`--verbose`] [`--no-rebuild`|`--keep-old`] [`--skip-relocation`] [`--root-url=``URL`] [`--force-core-tap`] `formulae`:
* `bottle` [`--verbose`] [`--no-rebuild`|`--keep-old`] [`--skip-relocation`] [`--or-later`] [`--root-url=``URL`] [`--force-core-tap`] `formulae`:
Generate a bottle (binary package) from a formula installed with
`--build-bottle`.
@ -681,6 +681,8 @@ With `--verbose` or `-v`, many commands print extra debugging information. Note
If `--root-url` is passed, use the specified `URL` as the root of the
bottle's URL instead of Homebrew's default.
If `--or-later` is passed, append _or_later to the bottle tag.
If `--force-core-tap` is passed, build a bottle even if `formula` is not
in homebrew/core or any installed taps.

View File

@ -682,7 +682,7 @@ Passing \fB\-\-only\-cops=\fR\fIcops\fR will check for violations of only the li
\fBaudit\fR exits with a non\-zero status if any errors are found\. This is useful, for instance, for implementing pre\-commit hooks\.
.
.TP
\fBbottle\fR [\fB\-\-verbose\fR] [\fB\-\-no\-rebuild\fR|\fB\-\-keep\-old\fR] [\fB\-\-skip\-relocation\fR] [\fB\-\-root\-url=\fR\fIURL\fR] [\fB\-\-force\-core\-tap\fR] \fIformulae\fR
\fBbottle\fR [\fB\-\-verbose\fR] [\fB\-\-no\-rebuild\fR|\fB\-\-keep\-old\fR] [\fB\-\-skip\-relocation\fR] [\fB\-\-or\-later\fR] [\fB\-\-root\-url=\fR\fIURL\fR] [\fB\-\-force\-core\-tap\fR] \fIformulae\fR
Generate a bottle (binary package) from a formula installed with \fB\-\-build\-bottle\fR\.
.
.IP
@ -698,6 +698,9 @@ If \fB\-\-skip\-relocation\fR is passed, do not check if the bottle can be marke
If \fB\-\-root\-url\fR is passed, use the specified \fIURL\fR as the root of the bottle\'s URL instead of Homebrew\'s default\.
.
.IP
If \fB\-\-or\-later\fR is passed, append _or_later to the bottle tag\.
.
.IP
If \fB\-\-force\-core\-tap\fR is passed, build a bottle even if \fIformula\fR is not in homebrew/core or any installed taps\.
.
.TP