{"action":"created","issue":{"url":"https://api.github.com/repos/eduncan911/dotfiles/issues/1","repository_url":"https://api.github.com/repos/eduncan911/dotfiles","labels_url":"https://api.github.com/repos/eduncan911/dotfiles/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/eduncan911/dotfiles/issues/1/comments","events_url":"https://api.github.com/repos/eduncan911/dotfiles/issues/1/events","html_url":"https://github.com/eduncan911/dotfiles/issues/1","id":153913612,"number":1,"title":"Two problems found with brew-cask.sh","user":{"login":"hao-lh","id":14138581,"avatar_url":"https://avatars.githubusercontent.com/u/14138581?v=3","gravatar_id":"","url":"https://api.github.com/users/hao-lh","html_url":"https://github.com/hao-lh","followers_url":"https://api.github.com/users/hao-lh/followers","following_url":"https://api.github.com/users/hao-lh/following{/other_user}","gists_url":"https://api.github.com/users/hao-lh/gists{/gist_id}","starred_url":"https://api.github.com/users/hao-lh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hao-lh/subscriptions","organizations_url":"https://api.github.com/users/hao-lh/orgs","repos_url":"https://api.github.com/users/hao-lh/repos","events_url":"https://api.github.com/users/hao-lh/events{/privacy}","received_events_url":"https://api.github.com/users/hao-lh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-05-10T02:55:02Z","updated_at":"2016-05-10T18:20:39Z","closed_at":null,"body":"The brew-cask.sh script is great for batch update via command, but with two issues found currently:\r\n1. Users occasionally could update the application via In-App update item, and this scripts would force downloading and updating again, thus, seemed need to check the app version before update?\r\n2. Sometimes users are faced with sha256 mismatch problem, and this scripts would not download and update it anymore since files are already downloaded into directory, and users have to remove the download file manually and I was wondering if you can remove the pre-download files in the script?\r\n\r\nHope the above two issues can be fixed, many thanks!"},"comment":{"url":"https://api.github.com/repos/eduncan911/dotfiles/issues/comments/218245260","html_url":"https://github.com/eduncan911/dotfiles/issues/1#issuecomment-218245260","issue_url":"https://api.github.com/repos/eduncan911/dotfiles/issues/1","id":218245260,"user":{"login":"eduncan911","id":104980,"avatar_url":"https://avatars.githubusercontent.com/u/104980?v=3","gravatar_id":"","url":"https://api.github.com/users/eduncan911","html_url":"https://github.com/eduncan911","followers_url":"https://api.github.com/users/eduncan911/followers","following_url":"https://api.github.com/users/eduncan911/following{/other_user}","gists_url":"https://api.github.com/users/eduncan911/gists{/gist_id}","starred_url":"https://api.github.com/users/eduncan911/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eduncan911/subscriptions","organizations_url":"https://api.github.com/users/eduncan911/orgs","repos_url":"https://api.github.com/users/eduncan911/repos","events_url":"https://api.github.com/users/eduncan911/events{/privacy}","received_events_url":"https://api.github.com/users/eduncan911/received_events","type":"User","site_admin":false},"created_at":"2016-05-10T18:20:39Z","updated_at":"2016-05-10T18:20:39Z","body":"Excellent!  My first feedback on `dotfiles`!  Thank you!  👍 \r\n\r\nNote that you hit home on the version issue I have with **Homebrew** in general as a package manager: it has next to nil support for revisions like `aptitude` and `pacman` for example.  There are serious limitations to Homebrew in general in regards to that.\r\n\r\nBut, it is even worse with **Cask**...  In what features that Homebrew is lacking, Cask lacks even some of the basic features of Homebrew itself (such as version tracking!  it only knows what `brew update` has, not what is installed).  Therefore, scripts like mine are basically work arounds with these limitations.\r\n\r\nhomebrew-cask cannot always detect updates.  Therefore, the official way to get anything installed is with `brew cask install --force {caskname}`.  Using `brew upgrade --all` does not always upgrade packages I've noticed.\r\n\r\nMy script basically:\r\n\r\n* gets a list of all Casks locally with `brew cask list`.\r\n* iterate and query each Cask item with `brew cask info {caskname}` <- NOTE: this only returns what version that your latest `brew update` has available.  There is no way to \"list\" what version you have installed using the Cask tooling.\r\n* parse get the version number reported by said Cask based on the `brew update` version available.\r\n* parse the 'current version installed' from basically looking at all sub-directories of `/opt/homebrew-cask/Caskroom/{caskname}/{versions}`\r\n* compare each version to see if it is listed.  if not listed, upgrade/mark as upgrade available.\r\n\r\nFor #1, the issue is that it doesn't know what version of the app is \"installed/update\".  We can only know based on the Directory Name that `brew cask install ...` installed it into, which happens to be a version number like `/opt/homebrew-cask/Caskroom/atom/1.7.3/`.  As to what the application version number actually is within that directory, who knows!  It's up in the air. \r\n\r\nI think the other issue is that **homebrew-cask** typically expects users to evaluate the In-App updatability on a per application basis.  \r\n\r\n> * Can it update itself?  (e.g. Chrome)   If yes, then leave the cask alone and let it update the location that Homebrew installed.  Don't upgrade.\r\n> * No internal updater?  Use `brew cask install --force {caskname}` to force an update based on the version from `brew update` tap of `caskroom`.  Or, uninstall first and then install again for latest (ick).\r\n\r\nMy script forces an update regardless.  Therefore, these are the rules I follow when using the **homebrew-cask** tap:\r\n\r\n* Does the app have an auto-updater?  (Chrome, Atom, etc)  Don't use Cask, go download the app from official locations and install it outside of Cask.\r\n* Does the app not have a way to update itself; or, is it limited/annoying in the way it updates itself?  (e.g. Karabiner)  Install it with `brew cask install {caskname}` like normal, and disable all updating notifications itself.  I want Cask to just force install each new version whenever available.  I don't need to be told \"Hey, there's a new version available for download!\"  \r\n\r\nFor example, i install Chrome normally by downloading from Chrome's main site.  It auto-updates itself. \r\n\r\nAs for #2, I am no Homebrew expert but I think that's what is what `brew cleanup -s` is for (note, use `brew cleanup -ns` to test it first).  Unfortunately this is only works for normal homebrew packages - not Caskroom!\r\n\r\nI haven't seen this mismatch issue before though.  Could you elaborate?  \r\n\r\nAs far as removing pre-downloaded files... I've thought of it; but, the way brew and casks are downloaded to and compared is kind of all over the place.  I'd rather let the tooling do that itself.  \r\n\r\nFor example: Dependencies that are no longer used, how do you want to clean them up?  There is no clear way to do that with Homebrew itself.  With Cask?  Ha, non-existent.  "}}