From 5fb368d9b8b1b98a70f6359fd57cb36770435da9 Mon Sep 17 00:00:00 2001 From: Bo Anderson Date: Fri, 4 Nov 2022 18:46:43 +0000 Subject: [PATCH] dev-cmd/bottle: add --no-all-checks --- Library/Homebrew/dev-cmd/bottle.rb | 9 +++++++-- completions/bash/brew | 1 + completions/fish/brew.fish | 1 + completions/zsh/_brew | 1 + docs/Manpage.md | 2 ++ manpages/brew.1 | 4 ++++ 6 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/dev-cmd/bottle.rb b/Library/Homebrew/dev-cmd/bottle.rb index 38d62a7c80..66320adf32 100644 --- a/Library/Homebrew/dev-cmd/bottle.rb +++ b/Library/Homebrew/dev-cmd/bottle.rb @@ -78,6 +78,9 @@ module Homebrew switch "--only-json-tab", depends_on: "--json", 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=", description: "Specify a committer name and email in `git`'s standard author format." flag "--root-url=", @@ -623,7 +626,8 @@ module Homebrew # if all the cellars and checksums are the same: we can create an # `all: $SHA256` bottle. 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.uniq { |tag_hash| "#{tag_hash["cellar"]}-#{tag_hash["sha256"]}" }.count == 1 @@ -648,7 +652,8 @@ module Homebrew next 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| tag_spec = bottle.collector.specification_for(tag) next false if tag_spec.blank? diff --git a/completions/bash/brew b/completions/bash/brew index 448c975359..4ef33450a1 100644 --- a/completions/bash/brew +++ b/completions/bash/brew @@ -410,6 +410,7 @@ _brew_bottle() { --json --keep-old --merge + --no-all-checks --no-commit --no-rebuild --only-json-tab diff --git a/completions/fish/brew.fish b/completions/fish/brew.fish index e2b781fa0b..66d8e5fbba 100644 --- a/completions/fish/brew.fish +++ b/completions/fish/brew.fish @@ -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 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 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-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' diff --git a/completions/zsh/_brew b/completions/zsh/_brew index 57ced64ab2..2094818fd9 100644 --- a/completions/zsh/_brew +++ b/completions/zsh/_brew @@ -461,6 +461,7 @@ _brew_bottle() { '--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]' \ '--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]' \ '(--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]' \ diff --git a/docs/Manpage.md b/docs/Manpage.md index f0ea1f962c..5e431601e9 100644 --- a/docs/Manpage.md +++ b/docs/Manpage.md @@ -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. * `--only-json-tab`: 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`: Specify a committer name and email in `git`'s standard author format. * `--root-url`: diff --git a/manpages/brew.1 b/manpages/brew.1 index bdaceab3e1..bcac8f5482 100644 --- a/manpages/brew.1 +++ b/manpages/brew.1 @@ -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\. . .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 Specify a committer name and email in \fBgit\fR\'s standard author format\. .