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
Revamp install processes #114
Conversation
`md5`, `sha1`, `sha256` all take a hexdigest string, e.g: sha1 'f645e9da45a621415a07a7492c45923b1a1fd4d4' `no_checksum` takes no argument, and indicates there is no checksum for this cask. This is *not recommended*, and should only be used for casks that have no versioned downloads. `brew cask install` will complain if there is no sum provided (unless `no_checksum` has been invoked), or if the sums do not match. It will provide the computed checksum so the cask can be easily amended.
It checks whitespace, URLs, and code style just like Homebrew's one, albeit modified to fit Casks (a lot of compiling-related stuff was removed).
Can now specify alternate specs for *devel* (checksummed, versioned) and *edge* (un-checksummed, unversioned) using blocks, see README.md.
Also change `--linkpath` option to `--[app|pref]dir`.
Holy crap, it's Christmas come early!!!! Let me take a look at this later today, but the summary sounds AWESOME On Monday, December 10, 2012 at 6:27 AM, Félix Saparelli wrote:
|
Note that the extensions aren't fixed for the # Symlink Somefile.jar to ~/Applications
install :app => 'Somefile.jar' |
Ack, I owe you a review on this stuff. I will try to get to it soon! On Wed, Dec 12, 2012 at 1:48 PM, Félix Saparelli
|
MotherTRUCKER! 👍 |
I really like that you provided a means to specific stable, devel, and edge, btw |
Took some time to look this over this afternoon. Few initial comments: Devel / EdgeAwesome. auto-linkNice! Caskroom+1, you beat me to the punch here, and with a better name Configurability+1, nice simple interface with args that can also be stuck in the env Checksumsalso beat me to the punch, nicely done Auditi like going with homebrew style audit here, but one of the main purposes of the audit in my mind was to check the durability of the remote URL. the core part of this is performing a HEAD request against the URL and expecting a 200, along with the content_length to ensure the binary is still there. TestsWhere are they?! ;) I figure you were trying to sketch this out which is why you didn't work on the test suite, but I was getting up to pretty decent test coverage, and your changes don't include tests. So let's figure out next steps!!I think it would be nice to pull this stuff in piecemeal. I'll take a further look this weekend to see if I can make a proposal. |
Tests… yeah, I mostly began that work as a prototyping/sketching/lemme-see-how-it-goes, but it went better than I expected, so I sent the pull request in before polishing everything. If you have a look at the branch readme you'll see that I had planned to include appifying (see #99) as part of it all, and, implicitly, tests were planned too. However, I just recently started a new job and didn't want to just stop working on it and have it all waste away, so that's why I sent it up unfinished like that :) Audit: I thought about fetching all URLs/specs and checking the SHAs, but that adds a lot of delays and variance to each audit. Maybe… have it enabled for individual audits (e.g. Also, I've been toying with the idea of named scopes to accommodate more complex alpha/beta/nightly/devel/edge release schemes. It'd look something like this: # Casks/formula-blah.rb
class Firefox < Cask
url 'http://download.cdn.mozilla.net/pub/mozilla.org/firefox/releases/17.0.1/mac/en-US/Firefox%2017.0.1.dmg'
homepage 'http://www.mozilla.org/en-US/firefox/'
version '17.0.1'
sha1 'a9888ce69440574fabff712549c8ff503fd1acb7'
# By default, both checksums and versions are required / checked…
spec :beta do
url 'http://download.cdn.mozilla.net/pub/mozilla.org/firefox/releases/18.0b3/mac/en-US/Firefox%2018.0b3.dmg'
version '18.0b3'
sha1 '31e383782b4fbbcbf3a1ef578d82cbf6861912cb'
end
# …and you can disable each separately…
spec :aurora, :checksum => false do
url 'https://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-mozilla-aurora/firefox-19.0a2.en-US.mac.dmg'
version '19.0a2'
end
# …and also set aliases for ease-of-use / familiarity
spec :nightly, :checksum => false, :version => false, :alias => :edge do
url 'http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-trunk/firefox-20.0a1.en-US.mac.dmg'
end
end # brew cask info firefox
firefox: 17.0.1 (stable)
specs: stable, beta, aurora, nightly/edge
http://www.mozilla.org/en-US/firefox/
/usr/local/Caskroom/firefox/17.0.1 (1234 files, 56M)
https://github.com/phinze/cask/commits/master/Casks/firefox.rb With options looking like this: # Predefined specs have predefined switches:
--stable
--devel
--edge
# Custom specs use a more generic syntax:
--spec=aurora
# Re: the example above, aliased specs can be accessed through any name:
--spec=nightly
--edge
# The generic syntax is also valid for predefined specs:
--spec=devel
--spec=stable What do you think? |
Closing this as it's better tracked through the individual issues now. |
Add Flux beta
Not sure whether this should/could be merged in or if it'd be better to cherry-pick/copy/steal selected changes out. Anyway, here goes:
This fork/branch is testing out a radically different way of installing Casks. It develops ideas exposed in the following issues:
linkapps and multiple .app files #105 — Features to help manage multiple .app foldersNot linking casks makes brew doctor complain #89 — Don't makebrew doctor
complain (about unlinked kegs)[Feature Request] brew cask info/open #72 — Features for metadataCellar location for apps #38 — Moar configurationApplications path #30 — Config: install/link pathPreference Panes #69 — Features for installing different typesCask option for checksums #82 — ChecksumsChecksums(DONE by phinze.)
content_length
has been removed. In its stead, there aremd5
,sha1
, andsha256
which all take a hexdigest string, e.g:brew cask install
will warn if there is no checksum provided, and error if the sums do not match.Audit
brew cask audit
has had a facelift, and is now based onbrew audit
. It checks whitespace, URLs, checksums, versions, and code style just like Homebrew's one, albeit modified to fit Casks (a lot of stuff related to compiling was removed).CaskroomCasks are now installed in
$HOMEBREW_PREFIX/Caskroom/$name/$version/
instead of in the Cellar. This stops Homebrew from complaining about unlinked kegs, and from listing our casks onbrew list
.Devel & Edge
You can now specify alternate specs for devel (checksummed, versioned) and edge (un-checksummed, unversioned) using blocks, e.g.
If the top level
url
is unspecified, then the edge spec will be used, e.g.Version parsing
Additionally, we will attempt to parse the URL to get the version, so if the correct version is within the URL, there is no need to specify it explicitely using
version
. This also applies to devel specs.LinkingMoar breaking changes:
brew cask linkapps
is removed. Linking is done at install-time, and by default has the same behaviour (link every.app
found recursively). However, that behaviour can be overridden in the formula:install
is spec-specific (so you have a different one for devel and edge), and takes a hash with a single pair of the form:You can have as many
install ...
statements as necessary. Currently, the only types supported areapp
(.app
files, linked into~/Applications
or whatever--appdir
is set to) andpref
(.prefPane
files, linked into~/Library/PreferencePanes
or whatever--prefdir
is set to).Configuration(DONE in #117)
You can now configure some aspects of
brew cask
's operation. You can set options on the command:or you can set them in the
HOMEBREW_CASK_OPTS
environment variable:Command-line options override environment ones.
Available options:
--appdir=PATH
— Where applications are linked / aliased. Defaults to ~/Applications.--prefdir=PATH
— Where preference panes are linked / aliased. Defaults to ~/Library/PreferencePanes.--edge
— Use the edge spec for that cask.--devel
— Use the devel spec for that cask.--stable
— Use the stable spec for that cask. Useful to override the ENV.--[no-]ignore-edge-only
— Ignore “edge-only” problems when auditing casks. If you'reworking with
brew cask audit
a lot, I recommend you put it in yourHOMEBREW_CASK_OPTS
.Cask infobrew cask info <a cask>
now gives:And you can use
brew cask open <cask name>
to open its homepage.