Skip to content
This repository
Browse code

Add ARGV.build_head? and use it.

This allows both "--HEAD" and "-H" to be used consistently, which was the
intention in the first place.
  • Loading branch information...
commit 511d309374f693231938eecfda7202c2a6ce3e4d 1 parent 418902f
Adam Vandenberg authored July 09, 2010
4  Library/Formula/clojure-contrib.rb
@@ -7,14 +7,14 @@ class ClojureContrib <Formula
7 7
   homepage 'http://richhickey.github.com/clojure-contrib/branch-1.1.x/index.html'
8 8
 
9 9
   depends_on 'clojure'
10  
-  depends_on 'maven' if ARGV.include? '--HEAD'
  10
+  depends_on 'maven' if ARGV.build_head?
11 11
 
12 12
   def jar
13 13
     'clojure-contrib.jar'
14 14
   end
15 15
 
16 16
   def install
17  
-    if ARGV.include? '--HEAD'
  17
+    if ARGV.build_head?
18 18
       system "mvn package -Dclojure.jar=#{HOMEBREW_PREFIX}/Cellar/clojure/HEAD/clojure.jar"
19 19
       system "mv target/clojure-contrib-*.jar #{jar}"
20 20
     end
2  Library/Formula/clojure.rb
@@ -24,7 +24,7 @@ def script
24 24
   end
25 25
 
26 26
   def install
27  
-    system "ant" if ARGV.include? '--HEAD'
  27
+    system "ant" if ARGV.build_head?
28 28
     prefix.install jar
29 29
     (bin+'clj').write script
30 30
   end
4  Library/Formula/coffee-script.rb
@@ -9,7 +9,7 @@ class CoffeeScript <Formula
9 9
   # head coffee-script usually depends on head node and
10 10
   # since there isn't a way to specify that just remove
11 11
   # the depends_on
12  
-  depends_on :node unless ARGV.flag? '--HEAD'
  12
+  depends_on :node unless ARGV.build_head?
13 13
 
14 14
   def caveats
15 15
     <<-EOS.undent
@@ -20,7 +20,7 @@ def caveats
20 20
         brew uninstall node
21 21
         brew install node --HEAD
22 22
     EOS
23  
-  end if ARGV.flag? '--HEAD'
  23
+  end if ARGV.build_head?
24 24
 
25 25
   def install
26 26
     bin.mkpath
2  Library/Formula/git-flow.rb
... ...
@@ -1,7 +1,7 @@
1 1
 require 'formula'
2 2
 
3 3
 class GitFlow <Formula
4  
-  if ARGV.include? "--HEAD"
  4
+  if ARGV.build_head?
5 5
     head 'git://github.com/nvie/gitflow.git', :branch => 'develop'
6 6
   else
7 7
     head 'git://github.com/nvie/gitflow.git', :tag => '0.2.1'
4  Library/Formula/guile.rb
@@ -5,7 +5,7 @@ class Guile <Formula
5 5
   head 'ftp://alpha.gnu.org/gnu/guile/guile-1.9.11.tar.gz'
6 6
   homepage 'http://www.gnu.org/software/guile/'
7 7
 
8  
-  if ARGV.include? "--HEAD"
  8
+  if ARGV.build_head?
9 9
     sha1 'abd1424a927302db31395db828d4d14fa68d13f9'
10 10
   else
11 11
     sha1 '24cd2f06439c76d41d982a7384fe8a0fe5313b54'
@@ -27,6 +27,6 @@ def install
27 27
     system "make install"
28 28
 
29 29
     # A really messed up workaround required on OS X --mkhl
30  
-    lib.cd { Dir["*.dylib"].each {|p| ln_sf p, "#{File.basename(p, ".dylib")}.so" }}
  30
+    lib.cd { Dir["*.dylib"].each {|p| ln_sf p, File.basename(p, ".dylib")+".so" }}
31 31
   end
32 32
 end
2  Library/Formula/id3lib.rb
@@ -8,7 +8,7 @@ class Id3lib <Formula
8 8
 
9 9
   def patches
10 10
     {:p1 => DATA }
11  
-  end unless ARGV.include? "--HEAD"
  11
+  end unless ARGV.build_head?
12 12
 
13 13
   def install
14 14
     system "./configure", "--prefix=#{prefix}", "--disable-debug", "--disable-dependency-tracking"
2  Library/Formula/libdrizzle.rb
@@ -7,7 +7,7 @@ class Libdrizzle <Formula
7 7
   md5 '9b2f0ed5d9f63d0f0b9253d03c817d55'
8 8
 
9 9
   def install
10  
-    system "./config/autorun.sh" if ARGV.include? '--HEAD'
  10
+    system "./config/autorun.sh" if ARGV.build_head?
11 11
     system "./configure", "--prefix=#{prefix}", "--disable-debug", "--disable-dependency-tracking"
12 12
     system "make install"
13 13
   end
2  Library/Formula/libevent.rb
@@ -7,7 +7,7 @@ class Libevent <Formula
7 7
   head 'git://levent.git.sourceforge.net/gitroot/levent/levent'
8 8
 
9 9
   def install
10  
-    system "./autogen.sh" if ARGV.include? '--HEAD'
  10
+    system "./autogen.sh" if ARGV.build_head?
11 11
 
12 12
     ENV.j1 # Needed for Mac Pro compilation
13 13
     system "./configure", "--prefix=#{prefix}"
2  Library/Formula/maven.rb
@@ -5,7 +5,7 @@ class Maven <Formula
5 5
   head 'http://www.apache.org/dist/maven/binaries/apache-maven-3.0-beta-1-bin.tar.gz'
6 6
   homepage 'http://maven.apache.org/'
7 7
 
8  
-  if ARGV.include? "--HEAD"
  8
+  if ARGV.build_head?
9 9
     md5 '82d43745cf2f2d1d939f1139a09d6654'
10 10
   else
11 11
     md5 '3f829ed854cbacdaca8f809e4954c916'
6  Library/Formula/nginx.rb
@@ -5,10 +5,10 @@ class Nginx < Formula
5 5
   head 'http://nginx.org/download/nginx-0.8.44.tar.gz'
6 6
   homepage 'http://nginx.org/'
7 7
 
8  
-  unless (ARGV & ['--HEAD', '-H']).empty?
9  
-    @md5='7158c67ba2697f7d469aa7b17bef202f'
  8
+  if ARGV.build_head?
  9
+    md5 'b6e175f969d03a4d3c5643aaabc6a5ff'
10 10
   else
11  
-    @md5='b6e175f969d03a4d3c5643aaabc6a5ff'
  11
+    md5 '7158c67ba2697f7d469aa7b17bef202f'
12 12
   end
13 13
 
14 14
   depends_on 'pcre'
2  Library/Formula/ppl.rb
@@ -5,7 +5,7 @@ class Ppl <Formula
5 5
   head 'http://www.cs.unipr.it/ppl/Download/ftp/snapshots/ppl-0.11pre24.tar.bz2'
6 6
   homepage 'http://www.cs.unipr.it/ppl/'
7 7
 
8  
-  if ARGV.include? "--HEAD"
  8
+  if ARGV.build_head?
9 9
     md5 '14f4d5297a161f9ba22c33945fc61a27'
10 10
   else
11 11
     md5 '5667111f53150618b0fa522ffc53fc3e'
10  Library/Formula/ruby.rb
@@ -6,17 +6,17 @@ class Ruby <Formula
6 6
   url 'http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.1-p378.tar.gz'
7 7
   homepage 'http://www.ruby-lang.org/en/'
8 8
   head 'http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_2/', :using => :svn
9  
-  md5 '9fc5941bda150ac0a33b299e1e53654c' unless ARGV.include? '--HEAD'
  9
+  md5 '9fc5941bda150ac0a33b299e1e53654c'
10 10
 
11 11
   depends_on 'readline'
12  
-  
  12
+
13 13
   def options
14 14
     [
15 15
       ["--with-suffix", "Add a 19 suffix to commands"],
16 16
       ["--with-doc", "Install with the Ruby documentation"],
17 17
     ]
18 18
   end
19  
-  
  19
+
20 20
   def install
21 21
     fails_with_llvm
22 22
 
@@ -35,14 +35,14 @@ def install
35 35
 
36 36
     system "make install-doc" if ARGV.include? "--with-doc"
37 37
   end
38  
-  
  38
+
39 39
   def caveats; <<-EOS
40 40
 If you install gems with the RubyGems installed with this formula they will
41 41
 be installed to this formula's prefix. This needs to be fixed, as for example,
42 42
 upgrading Ruby will lose all your gems.
43 43
     EOS
44 44
   end
45  
-  
  45
+
46 46
   def skip_clean? path
47 47
     # TODO only skip the clean for the files that need it, we didn't get a
48 48
     # comment about why we're skipping the clean, so you'll need to figure
2  Library/Formula/schroedinger.rb
@@ -10,7 +10,7 @@ class Schroedinger <Formula
10 10
   depends_on 'orc'
11 11
 
12 12
   def install
13  
-    system "autoreconf -i -f" if ARGV.include? '--HEAD'
  13
+    system "autoreconf -i -f" if ARGV.build_head?
14 14
     system "./configure", "--prefix=#{prefix}", "--disable-debug", "--disable-dependency-tracking"
15 15
     system "make install"
16 16
   end
3  Library/Homebrew/extend/ARGV.rb
@@ -51,6 +51,9 @@ def quieter?
51 51
   def interactive?
52 52
     flag? '--interactive'
53 53
   end
  54
+  def build_head?
  55
+    flag? '--HEAD'
  56
+  end
54 57
 
55 58
   def flag? flag
56 59
     options.each do |arg|

0 notes on commit 511d309

Please sign in to comment.
Something went wrong with that request. Please try again.