307 Commits
Author SHA1 Message Date
Issy Long 0b6b2f04da cask/reinstall: Support --zap for entirely purging cask files
- The `brew uninstall` command has `--zap`, so let's make `brew
  reinstall` have parity here for a better user experience. (Requested
  in issue 12983.)
- It feels weird that to get my new reinstall test to pass I had to add
  `--zap` to `cask/cmd/install.rb`, not `cask/cmd/reinstall.rb` to get
  the tests to pass. But the `brew reinstall --cask caffeine --zap`
  command worked fine all the time. The CLI argument parser from the
  test run was complaining about not knowing what `zap` was. As a
  result, `--zap` now shows up as a switch in `brew install --help`
  which I'm not 100% convinced is the desired UX. But I've edited the
  description accordingly to specify that it will only work on
  `reinstall` operations (and `--zap` on `install` is a no-op).

```
issyl0 at pictor in /opt/homebrew on reinstall-cask-zap
❯ brew reinstall --cask caffeine --zap
==> Downloading https://github.com/IntelliScape/caffeine/releases/download/1.1.3/Caffeine.dmg
Already downloaded: /Users/issyl0/Library/Caches/Homebrew/downloads/3d6ccfdd3b8d0ab37d1c2468d6e69078c2d31d3b12bf51947c4db21e5f376af2--Caffeine.dmg
==> Implied `brew uninstall --cask caffeine`
==> Backing App 'Caffeine.app' up to '/opt/homebrew/Caskroom/caffeine/1.1.3/Caffeine.app'
==> Removing App '/Applications/Caffeine.app'
==> Dispatching zap stanza
==> Trashing files:
~/Library/Application Support/com.intelliscapesolutions.caffeine
~/Library/Preferences/com.intelliscapesolutions.caffeine.plist
~/Library/Caches/com.intelliscapesolutions.caffeine
~/Library/HTTPStoages/com.intelliscapesolutions.caffeine.binarycookies
==> Removing all staged versions of Cask 'caffeine'
==> Installing Cask caffeine
==> Moving App 'Caffeine.app' to '/Applications/Caffeine.app'
🍺  caffeine was successfully installed!
```
2022-04-09 16:37:23 +01:00
Bevan Kay d5448ff54a rubocops (cask/url): add rubocop to use csv instead of before_comma and after_comma in cask 2021-12-31 11:08:47 +11:00
Bo Anderson 4836ea0ba2 Remove XQuartz handling 2021-11-05 12:40:22 +00:00
Sam Ford 77273fe2b3 Cask::Audit: Handle referenced cask in livecheck
`Cask::Audit#check_livecheck_version` was never updated to handle
a referenced cask in a `livecheck` block (e.g., `cask "other-cask"`).
As a result, this audit will wrongly give an error like `Version
'1.2.3' differs from '' retrieved by livecheck.` in this scenario.

This commit ensures that a referenced cask is handled by the audit
and it won't error when the referenced check provides a good version.
2021-11-02 12:32:38 -04:00
Mike McQuaid 0cda6a0657 Only use patchelf.rb
Remove support for using the `patchelf` formula for writing as it's been
off by default for a long time now.
2021-10-19 15:15:56 +01:00
Mike McQuaid 41e94afda5 Fix brew style
Fixes for https://github.com/Homebrew/brew/pull/12152.

Extracted into a separate PR so this can be merged immediately.
2021-09-30 10:13:53 +01:00
Alexander Bayandin fe9a039774 unpack_strategy: add zstd 2021-09-20 14:12:30 +01:00
Bo Anderson a0093bd647 test/support/fixtures/bottles: add fixtures for Monterey 2021-09-09 15:28:15 +01:00
Mike McQuaidandGitHub 365e554f67 Revert "rubocops: allow uses_from_macos openssl@3" 2021-09-09 09:16:59 +01:00
Jonathan Chang d85559876e tests: skip formulae exist check for openssl* 2021-09-07 11:33:27 -07:00
Rylan Polster c3a8b3841e Only include differring versions
Move the resetting of `MacOS.version` to an `ensure` block.

Fix the tests by adding a test OS and new fixture that has a
different version for that test OS.
2021-08-25 10:30:38 -04:00
Connor Mann 1581a29b28 Update tests 2021-08-06 22:34:30 -04:00
Rylan Polster 27ba803bb5 Remove need for HOMEBREW_NO_DEV_CMD_MESSAGE 2021-07-20 11:47:31 -04:00
Rui Chen b28f14aac2 fixtures: add test.epub
Signed-off-by: Rui Chen <rui@chenrui.dev>
2021-07-09 11:39:58 -04:00
Sam Ford e8f803bc75 Cask::Audit: Handle livecheck skip conditions 2021-06-14 14:28:27 -04:00
Bo Anderson a06d136d2c Move Sorbet gems into an optional group 2021-06-11 08:10:30 +01:00
cnnrmnn 02993c5899 Update tests to stop passing full_clone 2021-05-06 10:11:21 -04:00
Mike McQuaid 6f071a06f8 Use JSON.pretty_generate
It's dramatically more human readable for very little difference in
space.
2021-04-09 15:44:37 +01:00
Mike McQuaid d73351251c Deprecate, disable, delete code for next major/minor version.
Do the usual dance for bumping our major/minor version.
2021-04-09 09:30:36 +01:00
Bo Anderson 20d86c0185 Refactor some tag handling into a Utils::Bottles::Tag class 2021-04-08 17:23:57 +01:00
xxyzz 3c18e98432 test .gz man page 2021-04-06 16:52:56 +08:00
Nanda H KrishnaandGitHub 8e11f03fa9 Merge pull request #11003 from nandahkrishna/gpg-tap-new
dev-cmd/tap-new: use `Utils::Git.setup_gpg!`
2021-04-05 17:32:55 +05:30
Markus ReiterandGitHub 051d4378b1 Merge pull request #10958 from cho-m/cask-eject-apfs-dmg
cask install: fix APFS DMG eject to use physical disk
2021-04-03 20:38:12 +02:00
Nanda H Krishna f648b071ad dev-cmd/tap-new: use Utils::Git.setup_gpg! 2021-04-02 17:21:26 +05:30
Michael Cho cf8d96e0b2 cask install: fix APFS DMG eject to use physical disk 2021-03-29 19:59:20 -07:00
Michael Cho a0261c4b39 cask uninstall script: allow tilde expansion to '$HOME' 2021-03-28 09:52:49 -07:00
Mike McQuaid dc1fdc9f8d Speedup brew --version.
Port `brew --version` to Bash to speed it up.

While we're here:
- remove (now) unused `Tap` Git methods
- use `--quiet` instead of `-q` to be more verbose

Benchmarks:
```
$ hyperfine --min-runs=3 --warmup=2 "git checkout origin/master; brew --version" "git checkout speedup_brew_version; brew --version"
Benchmark #1: git checkout origin/master; brew --version
  Time (mean ± σ):      2.083 s ±  0.004 s    [User: 396.8 ms, System: 597.2 ms]
  Range (min … max):    2.080 s …  2.088 s    3 runs

Benchmark #2: git checkout speedup_brew_version; brew --version
  Time (mean ± σ):     847.9 ms ±  35.2 ms    [User: 100.0 ms, System: 247.9 ms]
  Range (min … max):   824.1 ms … 888.3 ms    3 runs

Summary
  'git checkout speedup_brew_version; brew --version' ran
    2.46 ± 0.10 times faster than 'git checkout origin/master; brew --version'
```
2021-03-04 12:59:42 +00:00
Bo Anderson a5b12a33c2 utils/gems: use Gem API rather than ENV to set paths 2021-02-27 16:23:28 +00:00
Bo Anderson 6cd1e5e384 Avoid passing around a massive $LOAD_PATH.
Portable Ruby crashes if the $LOAD_PATH gets too big.
2021-02-26 18:23:48 +00:00
Issy Long 83ead25229 rubocop: Disable RSpec/ContextWording for shared_context descs
- I couldn't figure out a way to start these with "when", "with" or
  "without" given where these are in cop descriptions. Three ignored
  things out of 150 problems is a good ratio though.
2021-02-19 23:31:17 +00:00
Bo Anderson 87b6fe8f84 test/os/mac/sdk: add tests 2021-02-11 01:20:02 +00:00
Mike McQuaid fc1c142ebd software_spec: reverse tag/digest for new bottles.
This new format was agreed in #10377
2021-01-28 13:15:41 +00:00
EricFromCanada a427de5bee capitalization fixes
"curl" is the binary, while "cURL" is the umbrella project.
2021-01-26 15:36:44 -05:00
Michka Popoff 3eea1434cc bottle: tag specific cellars 2021-01-19 10:14:25 +01:00
Vítor Galvão 1ca68556e7 Cask: audit: Do not require appcast on GitHub releases 2021-01-17 00:48:33 +00:00
souleater7 e50e3e4b22 Delete references to devel 2021-01-01 10:16:31 -08:00
Seeker 2fc17772f7 bottle_spec: more cleanup 2020-12-25 13:10:10 -08:00
Issy LongandGitHub e041468375 Merge pull request #10100 from issyl0/use-rspec-github-gem
Replace `test/support/github_formatter` with `rspec-github` gem
2020-12-23 18:34:47 +00:00
Michka Popoff 75491b7906 bottle --merge: add more write tests
In preparation for #9315
2020-12-23 10:34:16 +01:00
Issy Long 3c2467fc3d Replace test/support/github_formatter with rspec-github gem
- This was a TODO in `test/support/github_formatter.rb` and the PR it
  referenced had been merged.
2020-12-22 18:03:01 +00:00
Seeker cdb07d89ae integration_test: fix indentation for test formulae 2020-12-21 16:17:39 -08:00
Mike McQuaidandGitHub 010ae37420 Merge pull request #9403 from MikeMcQuaid/deprecate-cask-requirements
Deprecate cask requirements.
2020-12-18 12:15:35 +00:00
Markus Reiter 44cf1041ac Fix tests. 2020-12-16 09:45:58 +01:00
Mike McQuaid 87dd13aea6 Deprecate cask requirements.
This probably has to wait until 2.7.0 now and will require a bunch of
formula changes/deprecations but we should probably start moving in this
direction given we're not installing any of these on our CI any more.
2020-12-15 14:19:45 +00:00
Markus Reiter 287dfee35f Properly handle ~ artifact targets. 2020-12-13 03:31:34 +01:00
Francois-Xavier Coudert 35b27cf997 fixtures: add test.dmg.gz 2020-12-10 14:19:56 +01:00
Mike McQuaid 0f9bad0052 Fix bottle prefix and repository handling
We were previously only looking at the `cellar` value when pouring
bottles and ignoring the `prefix` and (implicit) `repository`.

Actually look at these values and set the defaults for each platform.

Also, when we're relocating to create or pour bottles when `prefix`
and `repository` are equal then skip relocating the `repository` and
always use references to the `prefix` instead.

Fixes #9453
2020-12-09 13:53:10 +00:00
Rylan Polster f450bfbf5e style: migrate some lists back to Homebrew/brew 2020-12-02 20:56:07 -05:00
Rylan PolsterandGitHub 77b4275f81 Merge pull request #9326 from Rylan12/migrate-style-exceptions
Migrate style exceptions to homebrew/core
2020-12-01 12:19:45 -05:00
linzichaoandMarkus Reiter 058a1c3645 add verified parameter in url 2020-12-01 01:17:21 +01:00