Bazaar is no longer maintained, and Breezy seems to be a drop-in
replacement.
I've tested the commands used in the download strategy and they seem to
work.
We need this in order to properly deprecate the `bazaar` formula.
See Homebrew/homebrew-core#106848.
instead of prefixing and/or replacing data in URLs, the
*HOMEBREW_ARTIFACT_DOMAIN* environment variable only replaces
the bottle base URL. this causes URLs from Casks and other assets
to be no longer affected by this feature.
closes#13226closes#13222closes#13227
When its `try_partial` argument is `true`, `#curl_download` makes a
`HEAD` request before downloading the file using `#curl`. Currently
`try_partial` defaults to `true`, so any `#curl_download` call that
doesn't explicitly specify `try_partial: false` will make a `HEAD`
request first. This can potentially involve several requests if the
URL redirects, so it can be a bit of unnecessary overhead when a
partial download isn't needed.
Partial downloads are generally only useful when we're working with
larger files, however there's currently only one place in brew where
`#curl_download` is used and this is the case:
`CurlDownloadStrategy`. The other `#curl_download` calls are fetching
smaller [text] files and don't need to support partial downloads.
This commit changes the default `try_partial` value to `false`,
making partial downloads opt-in rather than opt-out.
We want `try_partial` to continue to default to `true` in
`CurlDownloadStrategy` and there are various ways to accomplish this.
In this commit, I've chosen to update its `#initialize` method to
accept a `try_partial` argument that defaults to `true`, as this
value can also be used in classes that inherit from
`CurlDownloadStrategy` (e.g., `HomebrewCurlDownloadStrategy`). This
instance variable is passed to `#curl_download` in related methods,
effectively maintaining the previous `try_partial: true` value, while
also allowing this value to be overridden when necessary.
Other uses of `#curl_download` in brew are
`Formulary::FromUrlLoader#load_file` and
`Cask::CaskLoader::FromURILoader#load`, which did not provide a
`try_partial` argument but should have been using
`try_partial: false`. With the `try_partial: false` default in this
commit, these calls are now fine without a `try_partial` argument.
The only other use of `#curl_download` in brew is
`SPDX#download_latest_license_data!`. These calls were previously
using `try_partial: false` but we can now omit this argument with
the new `false` default (aligning with the above).
> This regular expression has an unrestricted wildcard '.+?' which may cause 'googlecode\.com/svn' to be matched anywhere in the URL, outside the hostname.
The PR that added this #8622 didn't actually resolve the problem because you see the warning when the `@ref_type` you've specified is a `:revision` (not a `:branch` or `:tag`).
The output looks like this:
```
==> Checking out revision 3b3527f5050270cf1acd280691b09b5abe130e73
Note: switching to '3b3527f5050270cf1acd280691b09b5abe130e73'
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:
git switch -c <new-branch-name>
Or undo this operation with:
git switch -
Turn off this advice by setting config variable advice.detachedHead to false
```
There's a few bits of functionality that Homebrew has changed over the
years, makes sense as a sensible default but some people find really
annoying:
- automatically running `brew update`
- automatically running `brew cleanup`
- automatically upgrading outdated dependents
- automatically reinstalling broken dependents
For each of these: let's improve the documentation of the commands
whose behaviour is changed and the environment variables themselves.
### Background
Given a repo that does not have branch named `master` and a formula like this:
```ruby
class Example < Formula
stable do
url "https://github.com/user/example.git", revision: "e8b123de62e0faec283c3253c6ea5495a332007e"
end
end
```
Homebrew was executing this when the cached location did not exist:
```
git clone https://github.com/user/example.git /path/to/cache
```
(which would work)
and this when the cached location did exist:
```
git -C /path/to/cache config remote.origin.fetch +refs/heads/master:refs/remotes/origin/master
git -C /path/to/cache fetch origin
```
(which would always fail with `fatal: couldn't find remote ref refs/heads/master`)
This commit changes the value for `remote.origin.fetch` to `+refs/heads/*:refs/remotes/origin/*` which is [Git's default value for the refspec](https://git-scm.com/book/en/v2/Git-Internals-The-Refspec) anyway.
This may increase the latency of `git fetch origin` for formulae that use `:revision` because Git will now fetch all remote refs; but it does have the advantage of not being broken 🙂
- `download_strategy`: only request image index JSON for downloading
the manifest for the tab
- use a shared `OS` constant for the version of `glibc` we use in CI
- fix `skoepeo` typo
- ensure that blank hash values are deleted (again) rather than just
`nil` ones
- use a shared `Hardware::CPU` constant for oldest CPU we're
supporting/using on Intel 64-bit
- re-add comment to `software_spec`
- Write a subset of the tab required for bottles as an annotation.
- Add option on new bottle creation to skip writing tab into bottle
and instead add it (and other useful metadata) to bottle JSON.
- Read formula information and tab from bottle JSON.
- Write prettier JSON to disk.
- Don't write `HEAD` to tab; this duplicates `HOMEBREW_VERSION`.
- Allow `brew bottle` to use `--json` to generate JSON files from a
local bottle file.