Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft Roadmap: brew cask upgrade #4678

Closed
21 of 87 tasks
rolandwalker opened this issue Jun 4, 2014 · 40 comments
Closed
21 of 87 tasks

Draft Roadmap: brew cask upgrade #4678

rolandwalker opened this issue Jun 4, 2014 · 40 comments

Comments

@rolandwalker
Copy link
Contributor

Explanation

brew cask upgrade is frequently brought up on IRC, and there have been a few different issues and PRs where it is discussed (long-running: #309).

brew cask upgrade is a high priority to me. Homebrew-cask is not really a package manager without upgrade. It is also important that when we do ship an upgrade verb, it actually works.

There are many prerequisites for our infrastructure to support a brew cask upgrade that works reliably, and a few things that should come along with it.

For the benefit of our users, and anyone who wants to participate in coding, here is a general roadmap that shows what some of us have been working on, and where we can go over upcoming months. I plan to edit this comment in-place over time.

Why is so much attention paid to tokens and versioning? Because Homebrew-cask uses a simple filesystem-as-a-datastore approach in which Cask tokens and version numbers are used as directory names. We need to standardize tokens and versions so that files are stored in a predictable place on disk — and because there is no facility to handle renames sensibly.

This is only a draft. It is possible that there is disagreement among the maintainers about certain items.

Current Implementation

Homebrew-cask is very good at installing, inconsistent on uninstalling, and mostly-incapable on upgrading. Part of upgrading is implicit uninstalling, so uninstall must be made to work equally well as install does.

Roadmap

  • Standardize Cask tokens in repos (2090/2467)
    • Standardize tokens for app Casks (1312)
    • Standardize tokens for font Casks (778)
    • Standardize tokens for Casks in homebrew-versions (102)
    • Standardize tokens for pkg Casks (179)
    • Standardize tokens for prefpane Casks (24)
    • Standardize tokens for qlplugin Casks (22)
    • Standardize tokens for manual-installer Casks (13)
    • Standardize tokens for binary-only Casks (10)
    • Standardize tokens for Casks in homebrew-unofficial (8)
    • Standardize tokens for colorpicker Casks (6)
    • Standardize tokens for screen-saver Casks (6)
    • Standardize tokens for widget Casks (3, unimportant because they don't work) (support for widgets has been removed as of Remove support for widgets #8751)
    • Standardize tokens for service Casks (2)
    • Standardize tokens for input-method Casks (1)
    • Standardize tokens for none-of-the-above Casks (1, adobe-air.rb)
  • Standardize Cask version numbers in repos (778/2467)
    • Standardize version numbers for app Casks (1312)
    • Standardize version numbers for font Casks (778)
    • Standardize tokens for Casks in homebrew-versions (102)
    • Standardize version numbers for pkg Casks (179)
    • Standardize version numbers for prefpane Casks (24)
    • Standardize version numbers for qlplugin Casks (22)
    • Standardize version numbers for manual-installer Casks (13)
    • Standardize version numbers for binary-only Casks (10)
    • Standardize tokens for Casks in homebrew-unofficial (8)
    • Standardize version numbers for colorpicker Casks (6)
    • Standardize version numbers for screen-saver Casks (6)
    • Standardize version numbers for widget Casks (3, unimportant because they don't work) Support for widgets removed as of Remove support for widgets #8751
    • Standardize version numbers for service Casks (2)
    • Standardize version numbers for input-method Casks (1)
    • Standardize version numbers for none-of-the-above Casks (1, adobe-air.rb)
  • Algorithmic token-generation and versioning
  • All pkg-based Casks must have uninstall stanzas
  • Make the uninstall stanza available to all Cask types
  • Nail down changes to the DSL
  • Use appcasts to detect updates
  • Migrate as many 'latest'-scheme Casks to version numbers as possible
    • prediction: we will never be able to entirely remove the 'latest' scheme
    • migrate to versioned download URLs revealed by appcasts
    • migrate to versioned download URLs revealed by HTTP redirects
    • migrate to versioned download URLs revealed by metadata?
      • new devscript to support this: list_url_attributes_on_file
  • Support for a ~/.brewcaskconfig file
    • git-style format
    • bundle a license-compatible library as was done for the plist parser, or roll our own
    • the CLI should be able to write to the config file as with git
    • support for environment variables should be REMOVED
  • Bookkeeping: keep records of what was done at install-time, as in Store metadata with installed Casks. #3066
    • add new command verb to display the install record for a given cask
  • Make brew cask uninstall refer to the previously recorded Cask/version, rather than the current repo
  • Expose discrete installation phases with new command verbs
    • fetch (CLI - Fetch #2970)
    • stage
      • part of the reason to separate out staging is to implement brew cask audit --stage
    • preflight (fairly unimportant)
    • link
      • ability to re-link already installed Cask
      • ability to un-link Cask without removing it from Caskroom
    • postflight
    • zap (new functionality; zap phase not implicit under default install)
  • New command verb to dump a shell script which will re-create the existing install
    • desirable feature: option to use stored metadata instead of implicitly upgrading
  • New command verb to rename versioned Caskroom directories to match in-place updates performed independently by apps
  • brew cask audit --stage
    • needed if we are going to start depending on Info.plist
  • New command verb outdated ([WIP] brew cask outdated #9490)
    • consult Info.plist as well as versioned directory name
    • leave room for the planned feature of managing multiple installed versions
  • Ability to remove currently-installed, but outdated (unlinked) versions.
  • New command verb upgrade
  • Update HACKING.md re: upgrade verb
@alebcay
Copy link
Member

alebcay commented Jun 4, 2014

Have we considered using the milestones function on GitHub for help with stuff like this?

@rolandwalker
Copy link
Contributor Author

It's a good idea, though I don't find them to be that handy in practice.

Milestones are like a special type of label which you can apply to an existing issue. I would have to open a bunch of separate new issues for all the notions here, then assign each to the milestone, which is a lot of clicking. Then, each reader has to click on all the items to read them, which makes it harder to see the big picture. In addition, discussion gets scattered into the various sub-issues and sometimes goes un-noticed.

Lastly, I included some things in the overview which are related work, but are not blocking the milestone.

@rolandwalker
Copy link
Contributor Author

Let's also call upon the mysterious @phinze.

@danielb2
Copy link
Contributor

Support for a ~/.brewcaskconfig file

My vote is for following the convention .config/<appname>/<files>

Example: .config/homebrew-cask/settings.yml

@rolandwalker
Copy link
Contributor Author

@alebcay looks like GitHub made milestones a lot more useful now.

@fgarcia
Copy link

fgarcia commented Sep 6, 2014

I've just adapted one of the scripts to just list outdated casks, and realized that I do not want certain apps be upgraded by cask: Google Chrome being a clear example for its automagical self upgrade.

This is a minor issue, but maybe it is worth considering adding brew pin to the roadmap for this feature.

@rolandwalker
Copy link
Contributor Author

The DSL changes all got done, but I am no longer working on this roadmap.

@leipert
Copy link
Contributor

leipert commented Aug 3, 2015

Wait. Does this mean there will be no brew cask upgrade in the foreseeable future?

@vitorgalvao
Copy link
Member

There are plans (that need a bit more discussion and an official announcement I’ll need to write up) to change homebrew-cask’s behaviour from linking to copying (long story short, linking sucks for GUI apps and we’re just building workarounds on top of workarounds, making it an incredibly broken model), so upgrade (which was moving slowly anyway) will have to be revised anyway.

@szhu
Copy link
Contributor

szhu commented Aug 3, 2015

Good to hear that links are going away! Can you link to gh issues surrounding this change?

@vitorgalvao
Copy link
Member

There are none yet, @szhu. But don’t worry I didn’t forget about you. At the moment this is just an idea that hopefully will be discussed and set in march soon. I strongly believe it’s the right one, though.

@szhu
Copy link
Contributor

szhu commented Aug 3, 2015

I actually forgot that I wrote that, thanks :)

@tjnycum
Copy link
Contributor

tjnycum commented Aug 11, 2015

There are plans (that need a bit more discussion and an official announcement I’ll need to write up) to change homebrew-cask’s behaviour from linking to copying (long story short, linking sucks for GUI apps and we’re just building workarounds on top of workarounds, making it an incredibly broken model), so upgrade (which was moving slowly anyway) will have to be revised anyway.

At the moment this is just an idea that hopefully will be discussed and set in march soon. I strongly believe it’s the right one, though.

Please wait for open discussion of that before you make up your mind. I'm under no illusion that there's a perfect solution—each option has its strengths and weaknesses—but I find the idea that requiring everyone to keep two copies of every app they install via cask is the best course of action very difficult to swallow.

@vitorgalvao
Copy link
Member

Plans will be posted soon (should be today or tomorrow). No one is talking about keeping two copies, though, “copy” is a throwback to how we referred to the feature in the past, it doesn’t mean duplicating stuff (actually, we’ll take less space in some cases).

Linking has shown to be a subpar solution for this, so keeping that is not an option. For homebrew-cask to evolve in other areas, we need this change: it’ll solve a bunch of issues right of the bat. Will it introduce new ones? We’ll have see how it evolves.

I’ll go into all the reasoning at length in the announcement, though (it’ll be a regular github issue). Please also don’t think there hasn’t been open discussion on this — there has (like the issue I linked to before). A big part of the reasoning to do it the current way has been ideological but that approach isn’t working.

The goal of homebrew-cask isn’t changing, though, but it is time to try a different solution.

@salimane
Copy link

salimane commented Nov 8, 2015

+1

@vitorgalvao
Copy link
Member

@salimane Please stop spamming issues. This is closed, don’t +1 it, or any other issue for that matter, it won’t make issues get worked on faster (or at all).

@salimane
Copy link

salimane commented Nov 9, 2015

@vitorgalvao you're right, this was closed :)

@gripedthumbtacks
Copy link

So what is the actual solution???

@chilloutman
Copy link

Here's a workaround that mostly works:

brew cask list | xargs brew cask install

I'm pretty sure a propper solution is WIP.

@gripedthumbtacks
Copy link

gripedthumbtacks commented Apr 28, 2016

for app in $(brew cask list); do cver="$(brew cask info "${app}" | head -n 1 | cut -d " " -f 2)"; ivers=$(ls -1 "/opt/homebrew-cask/Caskroom/${app}/.metadata/" | tr '\n' ' ' | sed -e 's/ $//'); aivers=(${ivers}); nvers=$(echo ${#aivers[@]}); echo "[*] Found ${app} in cask list. Latest available version is ${cver}. You have installed version(s): ${ivers}"; if [[ ${nvers} -eq 1 ]]; then echo "${ivers}" | grep -q "^${cver}$" && { echo "[*] Latest version already installed :) Skipping changes ..."; continue; }; fi; echo "[+] Fixing from ${ivers} to ${cver} ..."; brew cask uninstall "${app}" --force; brew cask install "${app}"; done

@tonyseek
Copy link
Contributor

@gripedthumbtacks
Copy link

@tonyseek yeah i had implemented a hack one-liner above very similar to your with exception of default path not being checked ;)

@a0s
Copy link

a0s commented May 1, 2016

Simple cleaning based on ctime https://gist.github.com/orangeudav/29a58c8df6446a87c50ec035b2b5dfcd

@RandomDSdevel
Copy link
Contributor

@orangeudav: What does your scripted alternative to brew cask cleanup have to do with this thread, where we're discussing ways to make up for Homebrew Cask's lack of a brew cask upgrade command?

@vitorgalvao
Copy link
Member

vitorgalvao commented May 2, 2016

This is a closed issue. There have been already a bunch of workarounds posted by people. No more are needed. What we need is a native solution.

Please stop spamming our inboxes with the same alternatives with variable results. Locking.

@Homebrew Homebrew locked and limited conversation to collaborators May 2, 2016
@miccal miccal removed the roadmap label Dec 23, 2016
@vitorgalvao
Copy link
Member

#29301

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests