diff --git a/Library/Homebrew/dev-cmd/man.rb b/Library/Homebrew/dev-cmd/man.rb index 871fbf46c9..d7f47d199d 100644 --- a/Library/Homebrew/dev-cmd/man.rb +++ b/Library/Homebrew/dev-cmd/man.rb @@ -1,5 +1,9 @@ -#: * `man`: +#: * `man` [`--fail-if-changed`]: #: Generate Homebrew's manpages. +#: +#: If `--fail-if-changed` is passed, the command will return a failing +#: status code if changes are detected in the manpage outputs. +#: This can be used for CI to be notified when the manpages are out of date. require "formula" require "erb" @@ -18,6 +22,12 @@ module Homebrew else regenerate_man_pages end + + if system "git", "-C", HOMEBREW_REPOSITORY, "diff", "--quiet", "docs/brew.1.html", "manpages" + puts "No changes to manpage output detected." + elsif ARGV.include?("--fail-if-changed") + Homebrew.failed = true + end end private diff --git a/docs/brew.1.html b/docs/brew.1.html index 1aee073c14..c5cb7f6424 100644 --- a/docs/brew.1.html +++ b/docs/brew.1.html @@ -467,7 +467,8 @@ for instance, for implementing pre-commit hooks.
bump-formula-pr [--devel] [--dry-run] [--audit|--strict] --tag=tag --revision=revision formulaCreates a pull request to update the formula with a new url or a new tag.
If a url is specified, the sha-256 checksum of the new download must -also be specified.
+also be specified. A best effort to determine the sha-256 and formula +name will be made if either or both values are not supplied by the user.If a tag is specified, the git commit revision corresponding to that tag must also be specified.
@@ -477,10 +478,19 @@ The development spec must already exist.If --dry-run is passed, print what would be done rather than doing it.
If --write is passed along with --dry-run, perform a not-so-dry run
+making the expected file modifications but not taking any git actions.
If --audit is passed, run brew audit before opening the PR.
If --strict is passed, run brew audit --strict before opening the PR.
If --mirror=url is passed, use the value as a mirror url.
If --version=version is passed, use the value to override the value
+parsed from the url or tag. Note that --version=0 can be used to delete
+an existing version override from a formula if it has become redundant.
Note that this command cannot be used to transition a formula from a url-and-sha256 style specification into a tag-and-revision style specification, nor vice versa. It must use whichever style specification @@ -515,7 +525,11 @@ non-zero exit code if any missing libraries were found.
If --reverse is passed, print the dylib followed by the binaries
which link to it for each library the keg references.
manGenerate Homebrew's manpages.
man [--fail-if-changed]Generate Homebrew's manpages.
+ +If --fail-if-changed is passed, the command will return a failing
+status code if changes are detected in the manpage outputs.
+This can be used for CI to be notified when the manpages are out of date.