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

add Cask::SubversionDownloadStrategy #2822

Merged
merged 1 commit into from
Feb 14, 2014

Conversation

rolandwalker
Copy link
Contributor

abstract out module Cask::DownloadStrategy, add some commentary

The interface is through new url keys: :using, :trust_cert, and :revision.

There's one oddity about this implementation, which is that I tarball the directory that SVN gives us. At first glance this sounds like a horrible hack, but I've decided that it is actually a solid way to go. Here are my comments on the subject from the code:

  • A single file is tractable to the rest of the Cask toolchain,
  • An alternative would be to create a Directory container type. However, some type of file-serialization trick would still be needed in order to enable calculating a single checksum over a directory. So, in that alternative implementation, the special cases would propagate outside this class, including the use of tar or equivalent.
  • SubversionDownloadStrategy.cached_location is not versioned
  • tarball_path provides a needed return value for our overridden fetch method.
  • We can also take this private opportunity to strip files from the download which are protocol-specific.

And here is an example Cask that would use this functionality in the fonts repo, addressing Homebrew/homebrew-cask-fonts#29, where multiple Casks are required to supply a single font.

class FontLekton < Cask
  url 'https://github.com/w0ng/googlefontdirectory/trunk/fonts/lekton', :using => :svn, :trust_cert => true
  homepage 'http://www.google.com/fonts/specimen/Lekton'
  version 'latest'
  no_checksum
  font 'Lekton-Bold.ttf'
  font 'Lekton-Italic.ttf'
  font 'Lekton-Regular.ttf'
end

abstract out module `Cask::DownloadStrategy`, add some commentary
@phinze
Copy link
Contributor

phinze commented Feb 14, 2014

reviewed and looks good 👍

solid (but not overdone) comments throughout.

eventually i think we'll probably extract out the needed functionality from uncle homebrew so we don't lean on fragile interfaces there, but this looks great for now.

rolandwalker added a commit that referenced this pull request Feb 14, 2014
@rolandwalker rolandwalker merged commit 82452b3 into Homebrew:master Feb 14, 2014
@rolandwalker rolandwalker deleted the svn_download_strategy branch February 14, 2014 18:27
@Homebrew Homebrew locked and limited conversation to collaborators May 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants