These can be changed on macOS but not on Linux so we need to make them
consistent in both places for `all:` bottles to have consistent
checksums.
I investigated adding to `cleaner.rb` to fix these symlink permissions
on installation but it seems it already happens by default when
extracting so there's no need.
Remove all code related to Bintray. It no longer works so there's no
point keeping it around.
Some of this could arguably be deprecated/disabled first/instead but:
I'm not sure I see the sense in keeping stuff around that's known to be
broken.
Run `Homebrew.install_bundler_gems!` a bit earlier for some developer
commands to avoid printing gem installation output in the middle of
normal developer command output.
If the `rebuild`, `root_url`, `cellar` and checksums are all identical
between an old and new bottle block: we don't need a new bottle at
all. Handle this by deleting the relevant files with
`brew bottle --merge --write` and gracefully notifying the caller of
`brew pr-upload`.
This should avoid e.g.
39340a11ea
occurring in future.
For :all bottle blocks in linuxbrew-core, we are going to remove the bottle
block completely before rebottling.
In linuxbrew-core, we use --keep-old to keep the macOS sha lines.
I am not sure why this exception was written initially, but it
now prevents bottling these formulae, because we have no bottle block
and use --keep-old.
I think it's safe to just skip this check, when there is no bottle block
the old_checksum can just directly return nil.
Rely more heavily on the `Bottle::Filename` class rather than hacking
around things manually.
Without this the rebuilding bottles workflow is broken for `all:`
bottles.
Instead of using `libarchive` on macOS (which has a non-zero dependency
tree) let's instead use `gnu-tar` because:
- it has no dependencies
- we're already using it on Linux
I tested this locally with `ack` (which was getting reproducible bottles
with system and Homebrew `libarchive`) and saw a different checksum. A
quick read of the `gtar` manpage indicated that it uses a GNU tar format
by default which can be made consistent with BSD and GNU tar by using
`--format=ustar` with both. Once this is done, the checksums are the
same. This will hopefully ease the transition to having `all:` bottles
be consistent on Linux, too, which will be useful when homebrew-core is
fully merged/supporting Linux.
Generate `all: $SHA256` bottles if:
- all generated bottles have the same cellar
- all generated bottles have the same checksum
In this case, on `brew bottle --merge --write`: delete all the non-`all`
bottles (and their JSON) and upload only the single one that's
necessary.