From 07ac5bf3b60278dbff15d13dbd798d342588347e Mon Sep 17 00:00:00 2001 From: Mohammad Zain Abbas Date: Tue, 27 Sep 2022 14:45:49 +0200 Subject: [PATCH 1/5] Update doc for `brew livecheck` --- docs/Brew-Livecheck.md | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/docs/Brew-Livecheck.md b/docs/Brew-Livecheck.md index fbbef6c7dc..9e7951f117 100644 --- a/docs/Brew-Livecheck.md +++ b/docs/Brew-Livecheck.md @@ -1,27 +1,29 @@ # `brew livecheck` -The `brew livecheck` command finds the newest version of a formula or cask's software by checking upstream. Livecheck has [strategies](https://rubydoc.brew.sh/Homebrew/Livecheck/Strategy.html) to identify versions from various sources, such as Git repositories, websites, etc. +The `brew livecheck` command finds the newest version of a formula, cask or resource's software by checking upstream. Livecheck has [strategies](https://rubydoc.brew.sh/Homebrew/Livecheck/Strategy.html) to identify versions from various sources, such as Git repositories, websites, etc. ## Behavior When livecheck isn't given instructions for how to check for upstream versions, it does the following by default: -1. For formulae: Collect the `head`, `stable`, and `homepage` URLs, in that order. For casks: Collect the `url` and `homepage` URLs, in that order. -1. Determine if any strategies apply to the first URL. If not, try the next URL. -1. If a strategy can be applied, use it to check for new versions. -1. Return the newest version (or an error if versions could not be found at any available URLs). +1. For __formulae__: Collect the `stable`, `head` and `homepage` URLs, in that order. For __casks__: Collect the `appcast`, `url` and `homepage` URLs, in that order. For __resource__: Collect the `url` (since resource's url is considered `stable` by default) +2. Determine if any strategies apply to the first URL. If not, try the next URL. +3. If a strategy can be applied, use it to check for new versions. +4. Return the newest version (or an error if versions could not be found at any available URLs). It's sometimes necessary to override this default behavior to create a working check. If a source doesn't provide the newest version, we need to check a different one. If livecheck doesn't correctly match version text, we need to provide an appropriate regex or `strategy` block. -This can be accomplished by adding a `livecheck` block to the formula/cask. For more information on the available methods, please refer to the [`Livecheck` class documentation](https://rubydoc.brew.sh/Livecheck.html). +This can be accomplished by adding a `livecheck` block to the formula/cask/resource. For more information on the available methods, please refer to the [`Livecheck` class documentation](https://rubydoc.brew.sh/Livecheck.html). ## Creating a check -1. **Use the debug output to understand the situation**. `brew livecheck --debug |` provides information about which URLs livecheck tries, any strategies that apply, matched versions, etc. +1. **Use the debug output to understand the situation**. `brew livecheck --debug |` provides information about which URLs livecheck tries, any strategies that apply, matched versions, etc. `brew livecheck --debug --resources ` will provides livecheck's debug information about the resources as well. -1. **Research available sources to select a URL**. Try removing the file name from `stable`/`url`, to see if this is a directory listing page. If that doesn't work, try to find a page that links to the file (e.g. a download page). If it's not possible to find the newest version on the website, try checking other sources from the formula/cask. When necessary, search for other sources outside of the formula/cask. +> Note: `--resources` flag only works with Formulae. -1. **Create a regex, if necessary**. If the check works without a regex and wouldn't benefit from having one, it's usually fine to omit it. More information on creating regexes can be found in the [regex guidelines](#regex-guidelines) section. +2. **Research available sources to select a URL**. Try removing the file name from `stable`/`url`, to see if this is a directory listing page. If that doesn't work, try to find a page that links to the file (e.g. a download page). If it's not possible to find the newest version on the website, try checking other sources from the formula/cask. When necessary, search for other sources outside of the formula/cask. + +3. **Create a regex, if necessary**. If the check works without a regex and wouldn't benefit from having one, it's usually fine to omit it. More information on creating regexes can be found in the [regex guidelines](#regex-guidelines) section. ### General guidelines From de2972d8b5efae29328295504693ac45a6bf5ad9 Mon Sep 17 00:00:00 2001 From: Mohammad Zain Abbas Date: Wed, 28 Sep 2022 11:43:24 +0200 Subject: [PATCH 2/5] Reverted numbering from numbered lists to generic 1s --- docs/Brew-Livecheck.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/Brew-Livecheck.md b/docs/Brew-Livecheck.md index 9e7951f117..6ab088a6e6 100644 --- a/docs/Brew-Livecheck.md +++ b/docs/Brew-Livecheck.md @@ -7,9 +7,9 @@ The `brew livecheck` command finds the newest version of a formula, cask or reso When livecheck isn't given instructions for how to check for upstream versions, it does the following by default: 1. For __formulae__: Collect the `stable`, `head` and `homepage` URLs, in that order. For __casks__: Collect the `appcast`, `url` and `homepage` URLs, in that order. For __resource__: Collect the `url` (since resource's url is considered `stable` by default) -2. Determine if any strategies apply to the first URL. If not, try the next URL. -3. If a strategy can be applied, use it to check for new versions. -4. Return the newest version (or an error if versions could not be found at any available URLs). +1. Determine if any strategies apply to the first URL. If not, try the next URL. +1. If a strategy can be applied, use it to check for new versions. +1. Return the newest version (or an error if versions could not be found at any available URLs). It's sometimes necessary to override this default behavior to create a working check. If a source doesn't provide the newest version, we need to check a different one. If livecheck doesn't correctly match version text, we need to provide an appropriate regex or `strategy` block. @@ -21,9 +21,9 @@ This can be accomplished by adding a `livecheck` block to the formula/cask/resou > Note: `--resources` flag only works with Formulae. -2. **Research available sources to select a URL**. Try removing the file name from `stable`/`url`, to see if this is a directory listing page. If that doesn't work, try to find a page that links to the file (e.g. a download page). If it's not possible to find the newest version on the website, try checking other sources from the formula/cask. When necessary, search for other sources outside of the formula/cask. +1. **Research available sources to select a URL**. Try removing the file name from `stable`/`url`, to see if this is a directory listing page. If that doesn't work, try to find a page that links to the file (e.g. a download page). If it's not possible to find the newest version on the website, try checking other sources from the formula/cask. When necessary, search for other sources outside of the formula/cask. -3. **Create a regex, if necessary**. If the check works without a regex and wouldn't benefit from having one, it's usually fine to omit it. More information on creating regexes can be found in the [regex guidelines](#regex-guidelines) section. +1. **Create a regex, if necessary**. If the check works without a regex and wouldn't benefit from having one, it's usually fine to omit it. More information on creating regexes can be found in the [regex guidelines](#regex-guidelines) section. ### General guidelines From 50ccb96d7702dd5190ca6310d005f93b641029c8 Mon Sep 17 00:00:00 2001 From: Mohammad Zain Abbas Date: Sun, 2 Oct 2022 16:53:51 +0200 Subject: [PATCH 3/5] Reverted back changes --- docs/Brew-Livecheck.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/docs/Brew-Livecheck.md b/docs/Brew-Livecheck.md index 6ab088a6e6..976098b75c 100644 --- a/docs/Brew-Livecheck.md +++ b/docs/Brew-Livecheck.md @@ -1,6 +1,6 @@ # `brew livecheck` -The `brew livecheck` command finds the newest version of a formula, cask or resource's software by checking upstream. Livecheck has [strategies](https://rubydoc.brew.sh/Homebrew/Livecheck/Strategy.html) to identify versions from various sources, such as Git repositories, websites, etc. +The `brew livecheck` command finds the newest version of a formula or cask's software software by checking upstream. Livecheck has [strategies](https://rubydoc.brew.sh/Homebrew/Livecheck/Strategy.html) to identify versions from various sources, such as Git repositories, websites, etc. ## Behavior @@ -17,9 +17,7 @@ This can be accomplished by adding a `livecheck` block to the formula/cask/resou ## Creating a check -1. **Use the debug output to understand the situation**. `brew livecheck --debug |` provides information about which URLs livecheck tries, any strategies that apply, matched versions, etc. `brew livecheck --debug --resources ` will provides livecheck's debug information about the resources as well. - -> Note: `--resources` flag only works with Formulae. +1. **Use the debug output to understand the situation**. `brew livecheck --debug |` provides information about which URLs livecheck tries, any strategies that apply, matched versions, etc. 1. **Research available sources to select a URL**. Try removing the file name from `stable`/`url`, to see if this is a directory listing page. If that doesn't work, try to find a page that links to the file (e.g. a download page). If it's not possible to find the newest version on the website, try checking other sources from the formula/cask. When necessary, search for other sources outside of the formula/cask. From d66104f182eb90edc975676fa9b9d994a6021d00 Mon Sep 17 00:00:00 2001 From: Mohammad Zain Abbas Date: Sun, 2 Oct 2022 19:55:27 +0500 Subject: [PATCH 4/5] Update docs/Brew-Livecheck.md Co-authored-by: Sam Ford <1584702+samford@users.noreply.github.com> --- docs/Brew-Livecheck.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Brew-Livecheck.md b/docs/Brew-Livecheck.md index 976098b75c..54dbfd86e5 100644 --- a/docs/Brew-Livecheck.md +++ b/docs/Brew-Livecheck.md @@ -6,7 +6,7 @@ The `brew livecheck` command finds the newest version of a formula or cask's sof When livecheck isn't given instructions for how to check for upstream versions, it does the following by default: -1. For __formulae__: Collect the `stable`, `head` and `homepage` URLs, in that order. For __casks__: Collect the `appcast`, `url` and `homepage` URLs, in that order. For __resource__: Collect the `url` (since resource's url is considered `stable` by default) +1. For formulae: Collect the `stable`, `head`, and `homepage` URLs, in that order (resources simply use their `url`). For casks: Collect the `url` and `homepage` URLs, in that order. 1. Determine if any strategies apply to the first URL. If not, try the next URL. 1. If a strategy can be applied, use it to check for new versions. 1. Return the newest version (or an error if versions could not be found at any available URLs). From bd4a4e3254152ea07b74e6419595ca8b8b291139 Mon Sep 17 00:00:00 2001 From: Mohammad Zain Abbas Date: Mon, 3 Oct 2022 03:10:34 +0500 Subject: [PATCH 5/5] Update docs/Brew-Livecheck.md Co-authored-by: Eric Knibbe --- docs/Brew-Livecheck.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Brew-Livecheck.md b/docs/Brew-Livecheck.md index 54dbfd86e5..89bbf46a06 100644 --- a/docs/Brew-Livecheck.md +++ b/docs/Brew-Livecheck.md @@ -1,6 +1,6 @@ # `brew livecheck` -The `brew livecheck` command finds the newest version of a formula or cask's software software by checking upstream. Livecheck has [strategies](https://rubydoc.brew.sh/Homebrew/Livecheck/Strategy.html) to identify versions from various sources, such as Git repositories, websites, etc. +The `brew livecheck` command finds the newest version of a formula or cask's software by checking upstream. Livecheck has [strategies](https://rubydoc.brew.sh/Homebrew/Livecheck/Strategy.html) to identify versions from various sources, such as Git repositories, websites, etc. ## Behavior