From df68d12be40d3c653e20a682529f2012c08f4b67 Mon Sep 17 00:00:00 2001 From: Shaun Jackman Date: Sat, 31 Mar 2018 00:03:08 -0700 Subject: [PATCH] bottle: Add option --or-later If --or-later is passed, append _or_later to the bottle tag. --- Library/Homebrew/dev-cmd/bottle.rb | 11 ++++++++--- docs/Manpage.md | 4 +++- manpages/brew.1 | 5 ++++- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/Library/Homebrew/dev-cmd/bottle.rb b/Library/Homebrew/dev-cmd/bottle.rb index 7fa9ff6b50..06563c4fd4 100644 --- a/Library/Homebrew/dev-cmd/bottle.rb +++ b/Library/Homebrew/dev-cmd/bottle.rb @@ -1,4 +1,4 @@ -#: * `bottle` [`--verbose`] [`--no-rebuild`|`--keep-old`] [`--skip-relocation`] [`--root-url=`] [`--force-core-tap`] : +#: * `bottle` [`--verbose`] [`--no-rebuild`|`--keep-old`] [`--skip-relocation`] [`--or-later`] [`--root-url=`] [`--force-core-tap`] : #: Generate a bottle (binary package) from a formula installed with #: `--build-bottle`. #: @@ -15,6 +15,8 @@ #: If `--root-url` is passed, use the specified 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 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, }, diff --git a/docs/Manpage.md b/docs/Manpage.md index 5ddfa6a034..5cff2c0e7c 100644 --- a/docs/Manpage.md +++ b/docs/Manpage.md @@ -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. diff --git a/manpages/brew.1 b/manpages/brew.1 index e2e5e8fb03..49c6c7ed94 100644 --- a/manpages/brew.1 +++ b/manpages/brew.1 @@ -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