Homebrew / homebrew-bundle

📦 Bundler for non-Ruby dependencies from Homebrew, Homebrew Cask and the Mac App Store.
MIT License
5.34k stars 287 forks source link

issue with casks still? #446

Closed brianbrownton closed 5 years ago

brianbrownton commented 5 years ago

I have read https://github.com/Homebrew/homebrew-bundle/issues/258 and see that installing casks with a --force flag should work, but this seems to be a not-great solution.

I recently (due to rbenv issues with brew) tried to freshly install homebrew by doing the following (per this thread):

$ brew bundle dump
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
$ brew bundle

It mostly went fine, my Brewfile (generated from brew bundle dump) is included below for reference. What didn't go fine was most of the casks did not reinstall correctly, erroring out with something like:

==> Satisfying dependencies
==> Downloading https://c.1password.com/dist/1P/mac7/1Password-7.2.4.zip
Already downloaded: /Users/brian/Library/Caches/Homebrew/downloads/70236f631a50d6cfb6f05be343464bd7c90030d129ce243fc8401234edb35391--1Password-7.2.4.zip
==> Verifying SHA-256 checksum for Cask '1password'.
==> Installing Cask 1password
Error: It seems there is already an App at '/Applications/1Password 7.app'.
==> Purging files for version 7.2.4 of Cask 1password
Installing 1password has failed!

So it would seem this issue can be resolved in two ways:

Either way, the current experience is pretty bad. It looks like I will have to find all the casks that failed to "install" (even though they were never uninstalled) and try to force install them? Is there a better way?

Brewfile:

tap "brianmorton/cask-automation"
tap "eugenmayer/dockersync"
tap "heroku/brew"
tap "homebrew/bundle"
tap "homebrew/cask"
tap "homebrew/cask-drivers"
tap "homebrew/cask-eid"
tap "homebrew/cask-fonts"
tap "homebrew/cask-versions"
tap "homebrew/core"
tap "homebrew/dupes"
tap "homebrew/formula-analytics"
tap "homebrew/services"
tap "vitorgalvao/tiny-scripts"
cask "osxfuse"
brew "sqlite"
brew "awscli"
brew "bash"
brew "gettext"
brew "cmake"
brew "libassuan"
brew "libksba"
brew "pth"
brew "dirmngr"
brew "ffmpeg"
brew "fsevents-tools"
brew "fswatch"
brew "git"
brew "git-flow-avh"
brew "glances"
brew "libusb"
brew "gnupg"
brew "go"
brew "gpg-agent"
brew "jpeg"
brew "graphicsmagick"
brew "htop"
brew "imagemagick"
brew "jq"
brew "libusb-compat"
brew "lsusb"
brew "mas"
brew "multitail"
brew "nmap"
brew "node"
brew "node@6"
brew "ntfs-3g"
brew "openssh"
brew "pip-completion"
brew "pkg-config"
brew "pyenv"
brew "rbenv"
brew "ripgrep"
brew "rsync"
brew "screenresolution"
brew "speedtest-cli"
brew "ssh-copy-id"
brew "sshuttle"
brew "telnet"
brew "unison"
brew "wget"
brew "whois"
brew "brianmorton/cask-automation/cask-scan"
brew "heroku/brew/heroku"
brew "vitorgalvao/tiny-scripts/cask-repair"
cask "1password"
cask "airflow"
cask "android-platform-tools"
cask "atext"
cask "background-music"
cask "coconutbattery"
cask "fastlane"
cask "firefox"
cask "gimp"
cask "gotomeeting"
cask "ip-scanner"
cask "kap"
cask "kdiff3"
cask "keep"
cask "launchcontrol"
cask "licecap"
cask "postman"
cask "private-internet-access"
cask "pusher"
cask "rar"
cask "skyfonts"
cask "slack"
cask "soundflower"
cask "spotify"
cask "steam"
cask "sublime-text"
cask "todour"
cask "vagrant"
cask "valentina-studio"
cask "virtualbox"
cask "visual-studio-code"
cask "vlc"
cask "wkhtmltopdf"
cask "yujitach-menumeters"
mas "Blackmagic Disk Speed Test", id: 425264550
mas "Xcode", id: 497799835
MikeMcQuaid commented 5 years ago
  • when homebrew is uninstalled the casks should be removed.

They are. They are not removed from /Applications though. We'd review a PR to the uninstall script to add this functionality but I think it would be fairly unexpected for a Homebrew uninstaller to remove e.g. a Google Chrome that you've installed with brew cask.

  • when brew bundle is run (or perhaps the cask command that I'm sure is eventually called), if there is already something installed it should be added to the list of installed casks.

The Casks were not installed but there were files in /Applications that were not uninstalled and, once Casks were removed, were impossible to differentiate from being installed manually.

As mentioned above: this seems at most something that the uninstall should handle but even then I'm not yet convinced it's desirable functionality. What could be added to brew bundle, if anything, would be a brew bundle --force that passes through --force to brew install and brew cask install.