1942 Commits

Author SHA1 Message Date
Mike McQuaid
6467fbadee
MacOS::Version: add (and use) architecture. 2020-12-09 11:55:27 +00:00
Dawid Dziurla
e831b197ff
Merge pull request #9459 from EricFromCanada/create-fix-options
create: fix options handling
2020-12-09 09:34:55 +01:00
Markus Reiter
eec1d5e17f Add timeout in bump-unversioned-casks. 2020-12-09 03:12:21 +01:00
EricFromCanada
c8e821d307 create: fix options handling 2020-12-08 10:14:20 -05:00
hyuraku
c8a8b79730 add path name to brew edit error message 2020-12-08 22:48:29 +09:00
Markus Reiter
1c2a31e224 Allow passing individual casks to bump-unversioned-casks for debugging. 2020-12-08 01:03:39 +01:00
Markus Reiter
73440797ef Add bump_unversioned_cask helper method. 2020-12-07 23:03:47 +01:00
Markus Reiter
c6876ba65c Add UnversionedCaskChecker helper class. 2020-12-07 23:03:47 +01:00
Markus Reiter
3b524a04c2 Output PKG contents if no version can be found. 2020-12-07 23:03:47 +01:00
Markus Reiter
d6f30a4bc1 Handle formatted versions ending with build version. 2020-12-07 23:03:47 +01:00
Markus Reiter
96bbf1ac15 Show contained files of PKGs when version detection fails. 2020-12-07 23:03:47 +01:00
Markus Reiter
4f3bfd1d58 Improve handling of short_version starting with version. 2020-12-07 23:03:47 +01:00
Markus Reiter
91ce799fe2 Ignore empty version strings. 2020-12-07 23:03:47 +01:00
Markus Reiter
933499089c Add test for decide_between_versions. 2020-12-07 23:03:47 +01:00
Markus Reiter
6d21df2c8b Always choose longer version in correct format. 2020-12-07 23:03:47 +01:00
Markus Reiter
bf46814ddd Skip casks before extracting. 2020-12-07 23:03:47 +01:00
Markus Reiter
a3182a6386 Extract package into new temporary directory. 2020-12-07 23:03:47 +01:00
Markus Reiter
ef1ea75c08 Add support for single-package casks. 2020-12-07 23:03:47 +01:00
Markus Reiter
2157a71a68 Never exit with failure. 2020-12-07 23:03:47 +01:00
Markus Reiter
ffebf0da5f Update check_time even if time and file size didn't change. 2020-12-07 23:03:47 +01:00
Markus Reiter
0a54169fa6 Change limit to minutes. 2020-12-07 23:03:47 +01:00
Markus Reiter
b57a448f2a Add bump-unversioned-casks command. 2020-12-07 23:03:47 +01:00
Michka Popoff
d768b6649a bottle: add tests for json merging
- Extract the json reading from the json merging: it makes the code hard to understand.
This helps for the separation of concerns: the jsons are read in one method;
and merged in a second one
- Added a first test to check the merge function

No change in behaviour was done, this change is just there to increase code coverage
and to prepare for #9315
2020-12-07 19:58:49 +01:00
Mike McQuaid
532864b0ef
dev-cmd/dispatch-build-bottle: remove testing code.
This was accidentally merged in https://github.com/Homebrew/brew/pull/9444.
2020-12-07 14:42:00 +00:00
Mike McQuaid
09cca671bd
dev-cmd/dispatch-build-bottle: set ARM labels.
Set the label properly for ARM.

Tested with inputs `11-arm` and `arm64_big_sur`.

Fixes https://github.com/Homebrew/brew/issues/9434
2020-12-07 13:20:01 +00:00
Jonathan Chang
8b206dfa33 git_extensions: move commit_message from utils/git 2020-12-06 14:33:23 +11:00
Jonathan Chang
92d3eda914 git_extensions: move origin_branch from utils/git 2020-12-06 14:33:23 +11:00
Jonathan Chang
d802b3755a utils/git: remove redundant current_branch 2020-12-06 14:33:23 +11:00
Jonathan Chang
5bda84b594 dev-cmd/pr-pull: use git_extensions 2020-12-06 14:33:23 +11:00
Rylan Polster
77b4275f81
Merge pull request #9326 from Rylan12/migrate-style-exceptions
Migrate style exceptions to homebrew/core
2020-12-01 12:19:45 -05:00
Markus Reiter
6f09768549 Add missing require in dev-cmd/irb. 2020-12-01 12:05:21 +01:00
Rylan Polster
c181c9995e style: add --reset-cache option 2020-11-30 18:18:50 -05:00
Markus Reiter
f438fa98be Avoid reinstalling bundler in integration tests. 2020-11-30 20:52:27 +01:00
Markus Reiter
323cfbca41 Fix type error in dev-cmd/dispatch-build-bottle. 2020-11-29 22:59:10 +01:00
Markus Reiter
6fb5315deb Fix unconditionally true condition. 2020-11-29 22:37:24 +01:00
Markus Reiter
749199632b Add signatures for dev-cmd/unbottled. 2020-11-29 22:37:24 +01:00
Markus Reiter
6750448d95 Fix some auto-correctable type errors. 2020-11-29 21:23:54 +01:00
Issy Long
f142714448
Merge pull request #9312 from issyl0/unbottled-fail-nicely-if-HOMEBREW_NO_ANALYTICS
dev-cmd/unbottled: Fail nicely if `HOMEBREW_NO_ANALYTICS` is set
2020-11-27 18:03:34 +00:00
Markus Reiter
79d6c059fc
Merge pull request #9297 from reitermarkus/brew-typecheck
Refactor `brew typecheck` and upgrade `typed` sigils.
2020-11-27 00:01:47 +01:00
Michka Popoff
d42e8c7842
Merge pull request #9310 from iMichka/cellar
bottle merge: add support for linux cellar
2020-11-26 23:31:28 +01:00
Issy Long
ca999a81f7
dev-cmd/unbottled: Fail nicely if analytics data can't be retrieved
- When testing `brew unbottled <formula>` this crashed because I, as a
  maintainer, have `HOMEBREW_NO_ANALYTICS` set on all my machines to
  avoid polluting the analytics with test installs.

```
❯ brew unbottled
==> Getting formulae...
==> Getting analytics data...
Error: undefined method `[]' for nil:NilClass
/usr/local/Homebrew/Library/Homebrew/dev-cmd/unbottled.rb:89:in `formulae_all_sort_installs_from_args'
/usr/local/Homebrew/Library/Homebrew/dev-cmd/unbottled.rb:49:in `unbottled'
/usr/local/Homebrew/Library/Homebrew/brew.rb:119:in `<main>'
```
2020-11-26 21:21:48 +00:00
Michka Popoff
95bf529ad2 bottle merge: add support for linux cellar
The first attempt to build and pull a formula (hello) for linux in homebrew-core
resulted in a wrong cellar line being added to the formula's bottle block.

How to test/debug this, using the 4 bottles that where built for hello:
brew bottle --merge --debug hello--2.10_1.mojave.bottle.json hello--2.10_1.x86_64_linux.bottle.json hello--2.10_1.big_sur.bottle.json hello--2.10_1.catalina.bottle.json

This command would add create the following bottle block:

  bottle do
    cellar "/home/linuxbrew/.linuxbrew/Cellar"
    sha256 "a0af7dcbb5c83f6f3f7ecd507c2d352c1a018f894d51ad241ce8492fa598010f" => :big_sur
    sha256 "5334dd344986e46b2aa4f0471cac7b0914bd7de7cb890a34415771788d03f2ac" => :catalina
    sha256 "22948764d8f8d7be4870ff92dae64d986eb63a9150b219c20fff87d1a6aa93d6" => :mojave
    sha256 "702dc7f78444d2f4f1c19324be654bcbb8b99dd0e9ce26c3e2fbc3b6464a189f" => :x86_64_linux
  end

After the change in this PR, the result is the following:

  bottle do
    sha256 "a0af7dcbb5c83f6f3f7ecd507c2d352c1a018f894d51ad241ce8492fa598010f" => :big_sur
    sha256 "5334dd344986e46b2aa4f0471cac7b0914bd7de7cb890a34415771788d03f2ac" => :catalina
    sha256 "22948764d8f8d7be4870ff92dae64d986eb63a9150b219c20fff87d1a6aa93d6" => :mojave
    sha256 "702dc7f78444d2f4f1c19324be654bcbb8b99dd0e9ce26c3e2fbc3b6464a189f" => :x86_64_linux
  end

The brew bottle --merge code will pick the most common cellar line between the 4 bottles, by order of priority:
- non-relocatable (fixed cellar path)
- cellar :any
- cellar :any_skip_relocation

In the case of the hello bottle, the 3 mac bottles are "cellar :any_skip_relocation", and the linux bottle
is non-relocatable. So the linux bottle wins and the code correctly determines that the 4 bottles should
be non-relocatable.

In that case, the /home/linuxbrew/.linuxbrew/Cellar path is defined as cellar, and by convention
we do not write that out to the formula file, hence the cellar path check that needs to be modified
in this PR.

This PR also fixes the same situation for mac ARM cellar paths
2020-11-26 15:11:55 +01:00
Mike McQuaid
135b5a3679
dev-cmd/unbottled: add new command.
Add a new command to list formulae that aren't bottled for a given OS.
2020-11-26 08:22:06 +00:00
Michka Popoff
9c3515ce73
Merge pull request #9284 from iMichka/first
pr-pull: fix empty workflow check
2020-11-25 17:49:21 +01:00
Markus Reiter
5be4c9b5e0 Upgrade typed sigils. 2020-11-25 17:04:19 +01:00
Markus Reiter
0032cfca5b Refactor brew typecheck. 2020-11-25 17:04:19 +01:00
Michka Popoff
76e52ebe62 pr-pull: fix empty workflow check
workflow_run is an array, which first element is the json
returned by the github API. We need to check that first element
if we want to know if the workflow exists.
2020-11-25 16:10:35 +01:00
Mike McQuaid
f364f0c841
Merge remote-tracking branch 'origin/master' into deprecate-cask-commands 2020-11-25 09:39:00 +00:00
Mike McQuaid
b484f70572
Remove cask from man brew. 2020-11-25 09:37:21 +00:00
Mike McQuaid
db33c9a2a0
Merge pull request #9209 from MikeMcQuaid/deprecations
Deprecations for Homebrew 2.6.0
2020-11-25 08:49:52 +00:00