Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In a homebrew formula, is there a way to specify a github version of a source repository (e.g., using a sha)?

I am trying to put the finishing touches on a github formula. I have been able to pull a zip file from github, but (for some unknown reason) it has the wrong version of files in it. And I am trying to pull a specific version of the repository since (if I understand correctly) that is the customary way to build a formula. So, pulling a tag is apparently frowned upon (which is also OK, because the few relevant tagged versions can be pulled with HEAD and -devel).

Is there a way to pull a specific version (aside from HEAD and tag) of a repository using the homebrew GitDownloadStrategy?

For reference, here's what I've got for the current formula:

class Geocouch < Formula
  homepage 'https://github.com/couchbase/geocouch'
  head 'https://github.com/couchbase/geocouch.git', :using => :git, :tag => '1.2.x'
  url 'https://github.com/couchbase/geocouch/zipball/couchdb1.2.zip'
  md5 '2e72424d67e369f2c649ed4ed01cdbc2'

  devel do
    head 'https://github.com/couchbase/geocouch.git', :using => :git, :tag => 'master'
    version '1.3.x'
  end
[...]

Since the url line grabs an undesirable version, I am trying to replace the url line with something like :using => :git, :sha => 'eeeb0f2e8d0a77', but the :sha feature does not seem to work... though that's precisely what I need (I believe).

like image 694
occam Avatar asked Apr 24 '12 17:04

occam


1 Answers

You should be able to use :revision => 'eeeb0f2e8d0a77' to achieve this.

like image 169
jacknagel Avatar answered Sep 18 '22 10:09

jacknagel