dev-cmd/bottle: add --no-all-checks

This commit is contained in:
Bo Anderson 2022-11-04 18:46:43 +00:00
parent 280c8b30ef
commit 5fb368d9b8
No known key found for this signature in database
GPG Key ID: 3DB94E204E137D65
6 changed files with 16 additions and 2 deletions

View File

@ -78,6 +78,9 @@ module Homebrew
switch "--only-json-tab", switch "--only-json-tab",
depends_on: "--json", depends_on: "--json",
description: "When passed with `--json`, the tab will be written to the JSON file but not the bottle." description: "When passed with `--json`, the tab will be written to the JSON file but not the bottle."
switch "--no-all-checks",
depends_on: "--merge",
description: "Don't try to create an `all` bottle or stop a no-change upload."
flag "--committer=", flag "--committer=",
description: "Specify a committer name and email in `git`'s standard author format." description: "Specify a committer name and email in `git`'s standard author format."
flag "--root-url=", flag "--root-url=",
@ -623,7 +626,8 @@ module Homebrew
# if all the cellars and checksums are the same: we can create an # if all the cellars and checksums are the same: we can create an
# `all: $SHA256` bottle. # `all: $SHA256` bottle.
tag_hashes = bottle_hash["bottle"]["tags"].values tag_hashes = bottle_hash["bottle"]["tags"].values
all_bottle = (!old_bottle_spec_matches || bottle.rebuild != old_bottle_spec.rebuild) && all_bottle = !args.no_all_checks? &&
(!old_bottle_spec_matches || bottle.rebuild != old_bottle_spec.rebuild) &&
tag_hashes.count > 1 && tag_hashes.count > 1 &&
tag_hashes.uniq { |tag_hash| "#{tag_hash["cellar"]}-#{tag_hash["sha256"]}" }.count == 1 tag_hashes.uniq { |tag_hash| "#{tag_hash["cellar"]}-#{tag_hash["sha256"]}" }.count == 1
@ -648,7 +652,8 @@ module Homebrew
next next
end end
no_bottle_changes = if old_bottle_spec_matches && bottle.rebuild != old_bottle_spec.rebuild no_bottle_changes = if !args.no_all_checks? && old_bottle_spec_matches &&
bottle.rebuild != old_bottle_spec.rebuild
bottle.collector.tags.all? do |tag| bottle.collector.tags.all? do |tag|
tag_spec = bottle.collector.specification_for(tag) tag_spec = bottle.collector.specification_for(tag)
next false if tag_spec.blank? next false if tag_spec.blank?

View File

@ -410,6 +410,7 @@ _brew_bottle() {
--json --json
--keep-old --keep-old
--merge --merge
--no-all-checks
--no-commit --no-commit
--no-rebuild --no-rebuild
--only-json-tab --only-json-tab

View File

@ -372,6 +372,7 @@ __fish_brew_complete_arg 'bottle' -l help -d 'Show this message'
__fish_brew_complete_arg 'bottle' -l json -d 'Write bottle information to a JSON file, which can be used as the value for `--merge`' __fish_brew_complete_arg 'bottle' -l json -d 'Write bottle information to a JSON file, which can be used as the value for `--merge`'
__fish_brew_complete_arg 'bottle' -l keep-old -d 'If the formula specifies a rebuild version, attempt to preserve its value in the generated DSL' __fish_brew_complete_arg 'bottle' -l keep-old -d 'If the formula specifies a rebuild version, attempt to preserve its value in the generated DSL'
__fish_brew_complete_arg 'bottle' -l merge -d 'Generate an updated bottle block for a formula and optionally merge it into the formula file. Instead of a formula name, requires the path to a JSON file generated with `brew bottle --json` formula' __fish_brew_complete_arg 'bottle' -l merge -d 'Generate an updated bottle block for a formula and optionally merge it into the formula file. Instead of a formula name, requires the path to a JSON file generated with `brew bottle --json` formula'
__fish_brew_complete_arg 'bottle' -l no-all-checks -d 'Don\'t try to create an `all` bottle or stop a no-change upload'
__fish_brew_complete_arg 'bottle' -l no-commit -d 'When passed with `--write`, a new commit will not generated after writing changes to the formula file' __fish_brew_complete_arg 'bottle' -l no-commit -d 'When passed with `--write`, a new commit will not generated after writing changes to the formula file'
__fish_brew_complete_arg 'bottle' -l no-rebuild -d 'If the formula specifies a rebuild version, remove it from the generated DSL' __fish_brew_complete_arg 'bottle' -l no-rebuild -d 'If the formula specifies a rebuild version, remove it from the generated DSL'
__fish_brew_complete_arg 'bottle' -l only-json-tab -d 'When passed with `--json`, the tab will be written to the JSON file but not the bottle' __fish_brew_complete_arg 'bottle' -l only-json-tab -d 'When passed with `--json`, the tab will be written to the JSON file but not the bottle'

View File

@ -461,6 +461,7 @@ _brew_bottle() {
'--json[Write bottle information to a JSON file, which can be used as the value for `--merge`]' \ '--json[Write bottle information to a JSON file, which can be used as the value for `--merge`]' \
'(--no-rebuild)--keep-old[If the formula specifies a rebuild version, attempt to preserve its value in the generated DSL]' \ '(--no-rebuild)--keep-old[If the formula specifies a rebuild version, attempt to preserve its value in the generated DSL]' \
'--merge[Generate an updated bottle block for a formula and optionally merge it into the formula file. Instead of a formula name, requires the path to a JSON file generated with `brew bottle --json` formula]' \ '--merge[Generate an updated bottle block for a formula and optionally merge it into the formula file. Instead of a formula name, requires the path to a JSON file generated with `brew bottle --json` formula]' \
'--no-all-checks[Don'\''t try to create an `all` bottle or stop a no-change upload]' \
'--no-commit[When passed with `--write`, a new commit will not generated after writing changes to the formula file]' \ '--no-commit[When passed with `--write`, a new commit will not generated after writing changes to the formula file]' \
'(--keep-old)--no-rebuild[If the formula specifies a rebuild version, remove it from the generated DSL]' \ '(--keep-old)--no-rebuild[If the formula specifies a rebuild version, remove it from the generated DSL]' \
'--only-json-tab[When passed with `--json`, the tab will be written to the JSON file but not the bottle]' \ '--only-json-tab[When passed with `--json`, the tab will be written to the JSON file but not the bottle]' \

View File

@ -948,6 +948,8 @@ value, while `--no-rebuild` will remove it.
When passed with `--write`, a new commit will not generated after writing changes to the formula file. When passed with `--write`, a new commit will not generated after writing changes to the formula file.
* `--only-json-tab`: * `--only-json-tab`:
When passed with `--json`, the tab will be written to the JSON file but not the bottle. When passed with `--json`, the tab will be written to the JSON file but not the bottle.
* `--no-all-checks`:
Don't try to create an `all` bottle or stop a no-change upload.
* `--committer`: * `--committer`:
Specify a committer name and email in `git`'s standard author format. Specify a committer name and email in `git`'s standard author format.
* `--root-url`: * `--root-url`:

View File

@ -1347,6 +1347,10 @@ When passed with \fB\-\-write\fR, a new commit will not generated after writing
When passed with \fB\-\-json\fR, the tab will be written to the JSON file but not the bottle\. When passed with \fB\-\-json\fR, the tab will be written to the JSON file but not the bottle\.
. .
.TP .TP
\fB\-\-no\-all\-checks\fR
Don\'t try to create an \fBall\fR bottle or stop a no\-change upload\.
.
.TP
\fB\-\-committer\fR \fB\-\-committer\fR
Specify a committer name and email in \fBgit\fR\'s standard author format\. Specify a committer name and email in \fBgit\fR\'s standard author format\.
. .