aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorAdam Vandenberg2012-03-03 15:50:27 -0800
committerAdam Vandenberg2012-03-06 06:53:07 -0800
commit841324b880c4fa5a7e86beca38152e42467598b9 (patch)
tree02f9a25c770c93cc37bdd4a2c0d545e01579f3b3 /Library
parent9cf15ae6dccd02aca662e118354457a3ae070630 (diff)
downloadhomebrew-841324b880c4fa5a7e86beca38152e42467598b9.tar.bz2
use which method
Diffstat (limited to 'Library')
-rw-r--r--Library/Formula/asymptote.rb4
-rw-r--r--Library/Formula/auctex.rb3
-rw-r--r--Library/Formula/dbslayer.rb2
-rw-r--r--Library/Formula/dotless.rb5
-rw-r--r--Library/Formula/fftw.rb2
-rw-r--r--Library/Formula/git-hg.rb2
-rw-r--r--Library/Formula/git.rb2
-rw-r--r--Library/Formula/lilypond.rb2
-rw-r--r--Library/Formula/mydumper.rb4
-rw-r--r--Library/Formula/mysql-proxy.rb4
-rw-r--r--Library/Formula/noweb.rb9
-rw-r--r--Library/Formula/pg_top.rb4
-rw-r--r--Library/Formula/pgtap.rb2
-rw-r--r--Library/Formula/pure-ftpd.rb30
-rw-r--r--Library/Formula/signing-party.rb2
-rw-r--r--Library/Formula/skytools.rb2
-rw-r--r--Library/Formula/sphinx.rb13
17 files changed, 44 insertions, 48 deletions
diff --git a/Library/Formula/asymptote.rb b/Library/Formula/asymptote.rb
index 07907c96a..19b536be7 100644
--- a/Library/Formula/asymptote.rb
+++ b/Library/Formula/asymptote.rb
@@ -1,7 +1,5 @@
require 'formula'
-def TeX_installed?; return `which latex`.chomp != ''; end
-
class Asymptote < Formula
homepage 'http://asymptote.sourceforge.net/'
url 'http://downloads.sourceforge.net/asymptote/asymptote-2.15.src.tgz'
@@ -11,7 +9,7 @@ class Asymptote < Formula
depends_on 'bdw-gc'
def install
- unless TeX_installed?
+ unless which 'latex'
onoe <<-EOS.undent
Asymptote requires a TeX/LaTeX installation; aborting now.
You can obtain the TeX distribution for Mac OS X from
diff --git a/Library/Formula/auctex.rb b/Library/Formula/auctex.rb
index bd500f3bf..d36b3df3c 100644
--- a/Library/Formula/auctex.rb
+++ b/Library/Formula/auctex.rb
@@ -21,8 +21,7 @@ class Auctex < Formula
end
def install
- # based on the asymtote formula LaTeX check
- if `which latex`.chomp == ''
+ unless which 'latex'
onoe <<-EOS.undent
AUCTeX requires a TeX/LaTeX installation; aborting now.
You can obtain the TeX distribution for Mac OS X from
diff --git a/Library/Formula/dbslayer.rb b/Library/Formula/dbslayer.rb
index 8ddeb4d51..2b2e32cb4 100644
--- a/Library/Formula/dbslayer.rb
+++ b/Library/Formula/dbslayer.rb
@@ -7,7 +7,7 @@ class Dbslayer < Formula
md5 'a529ea503c244d723166f78c75df3bb3'
def install
- unless `/usr/bin/which mysql_config`.size > 0
+ unless which 'mysql_config'
opoo "No MySQL client library detected"
puts "This formula may fail to build, see caveats for more information."
end
diff --git a/Library/Formula/dotless.rb b/Library/Formula/dotless.rb
index 6c5f86106..67132e756 100644
--- a/Library/Formula/dotless.rb
+++ b/Library/Formula/dotless.rb
@@ -6,11 +6,12 @@ class Dotless < Formula
md5 "dd06170b2e6a8f943f715977cfcd254d"
def install
- mono_path = `/usr/bin/which mono`.strip
- if mono_path.size == 0
+ mono_path = which 'mono'
+ unless mono_path
opoo "mono not found in path"
puts "You need to install Mono to run this software:"
puts "http://www.go-mono.com/mono-downloads/download.html"
+ exit 1
end
(bin+'dotless').write <<-EOF.undent
diff --git a/Library/Formula/fftw.rb b/Library/Formula/fftw.rb
index 9fc39547d..655c0e80f 100644
--- a/Library/Formula/fftw.rb
+++ b/Library/Formula/fftw.rb
@@ -13,7 +13,7 @@ class Fftw < Formula
"--disable-dependency-tracking"]
# check for gfortran
- args << "--disable-fortran" if `/usr/bin/which gfortran`.chomp.empty?
+ args << "--disable-fortran" unless which 'gfortran'
# single precision
# enable-sse only works with single
diff --git a/Library/Formula/git-hg.rb b/Library/Formula/git-hg.rb
index ac2a4b6d9..153062fee 100644
--- a/Library/Formula/git-hg.rb
+++ b/Library/Formula/git-hg.rb
@@ -5,7 +5,7 @@ class GitHg < Formula
homepage 'http://offbytwo.com/git-hg/'
def install
- unless `/usr/bin/which hg`.size > 0
+ unless which 'hg'
puts "You may need to install Mercurial before using this software:"
puts " brew install mercurial"
end
diff --git a/Library/Formula/git.rb b/Library/Formula/git.rb
index cb9bf96b8..411514cd0 100644
--- a/Library/Formula/git.rb
+++ b/Library/Formula/git.rb
@@ -32,7 +32,7 @@ class Git < Formula
ENV['NO_R_TO_GCC_LINKER'] = '1' # pass arguments to LD correctly
ENV['NO_GETTEXT'] = '1'
# workaround for users of perlbrew
- ENV['PERL_PATH'] = `/usr/bin/which perl`.chomp
+ ENV['PERL_PATH'] = which 'perl'
# Clean XCode 4.x installs don't include Perl MakeMaker
ENV['NO_PERL_MAKEMAKER']='1' if MacOS.lion?
diff --git a/Library/Formula/lilypond.rb b/Library/Formula/lilypond.rb
index 0f26540ba..bbc78b119 100644
--- a/Library/Formula/lilypond.rb
+++ b/Library/Formula/lilypond.rb
@@ -17,7 +17,7 @@ class Lilypond < Formula
skip_clean :all
def install
- abort caveats unless quiet_system "/usr/bin/which -s mpost"
+ abort caveats unless which "mpost"
gs = Formula.factory('ghostscript')
system "./configure", "--prefix=#{prefix}",
diff --git a/Library/Formula/mydumper.rb b/Library/Formula/mydumper.rb
index 36b5039d4..5e897c051 100644
--- a/Library/Formula/mydumper.rb
+++ b/Library/Formula/mydumper.rb
@@ -11,8 +11,8 @@ class Mydumper < Formula
depends_on 'pcre'
def install
- if `which mysql_config`.chomp.empty?
- opoo "`mysql_config` not found"
+ unless which 'mysql_config'
+ opoo "`mysql_config` was not found"
puts "This software requires the MySQL client libraries."
puts "You can install them via Homebrew with one of these:"
puts " brew install mysql-connector-c"
diff --git a/Library/Formula/mysql-proxy.rb b/Library/Formula/mysql-proxy.rb
index f46c8a578..eadffe616 100644
--- a/Library/Formula/mysql-proxy.rb
+++ b/Library/Formula/mysql-proxy.rb
@@ -11,8 +11,8 @@ class MysqlProxy < Formula
depends_on 'lua'
def install
- if `which mysql_config`.chomp.empty?
- opoo "`mysql_config` not found"
+ unless which 'mysql_config'
+ opoo "`mysql_config` was not found"
puts "This software requires the MySQL client libraries."
puts "You can install them via Homebrew with one of these:"
puts " brew install mysql-connector-c"
diff --git a/Library/Formula/noweb.rb b/Library/Formula/noweb.rb
index 783a566f3..60d1057be 100644
--- a/Library/Formula/noweb.rb
+++ b/Library/Formula/noweb.rb
@@ -13,13 +13,12 @@ class Noweb < Formula
system "bash", "awkname", "awk"
system "make LIBSRC=icon ICONC=icont CFLAGS='-U_POSIX_C_SOURCE -D_POSIX_C_SOURCE=1'"
- kpse = `which kpsewhich`
- if kpse == ''
- ohai 'No TeX installation found. Installing TeX support files in the noweb Cellar.'
- texmf = "#{prefix}"
- else
+ if which 'kpsewhich'
ohai 'TeX installation found. Installing TeX support files there might fail if your user does not have permission'
texmf = "`kpsewhich -var-value=TEXMFLOCAL`"
+ else
+ ohai 'No TeX installation found. Installing TeX support files in the noweb Cellar.'
+ texmf = "#{prefix}"
end
bin.mkpath
diff --git a/Library/Formula/pg_top.rb b/Library/Formula/pg_top.rb
index 762fd8758..4d88b1ed4 100644
--- a/Library/Formula/pg_top.rb
+++ b/Library/Formula/pg_top.rb
@@ -1,12 +1,12 @@
require 'formula'
class PgTop < Formula
- url 'http://pgfoundry.org/frs/download.php/1781/pg_top-3.6.2.tar.gz'
homepage 'http://ptop.projects.postgresql.org/'
+ url 'http://pgfoundry.org/frs/download.php/1781/pg_top-3.6.2.tar.gz'
md5 '12ddb50cf83e3027d182a1381d388f1d'
def install
- unless `/usr/bin/which pg_config`.size > 0
+ unless which 'pg_config'
opoo "No pg_config was detected."
puts <<-EOS.undent
pg_top requires postgresql in order to compile, but pg_config was not
diff --git a/Library/Formula/pgtap.rb b/Library/Formula/pgtap.rb
index 42b13253c..16415304a 100644
--- a/Library/Formula/pgtap.rb
+++ b/Library/Formula/pgtap.rb
@@ -8,7 +8,7 @@ class Pgtap < Formula
skip_clean :all
def install
- unless `/usr/bin/which pg_config`.size > 0
+ unless which 'pg_config'
opoo "No pg_config was detected."
puts <<-EOS.undent
pg_top requires postgresql in order to compile, but pg_config was not
diff --git a/Library/Formula/pure-ftpd.rb b/Library/Formula/pure-ftpd.rb
index feb52a2ed..4b5f5f4c7 100644
--- a/Library/Formula/pure-ftpd.rb
+++ b/Library/Formula/pure-ftpd.rb
@@ -7,7 +7,9 @@ class PureFtpd < Formula
def install
args = ["--disable-dependency-tracking",
- "--prefix=#{prefix}", "--mandir=#{man}", "--sysconfdir=#{etc}",
+ "--prefix=#{prefix}",
+ "--mandir=#{man}",
+ "--sysconfdir=#{etc}",
"--with-pam",
"--with-altlog",
"--with-puredb",
@@ -22,8 +24,8 @@ class PureFtpd < Formula
"--with-tls",
"--with-bonjour"]
- args << "--with-pgsql" if `/usr/bin/which pg_config`.size > 0
- args << "--with-mysql" if `/usr/bin/which mysql`.size > 0
+ args << "--with-pgsql" if which 'pg_config'
+ args << "--with-mysql" if which 'mysql'
system "./configure", *args
system "make install"
@@ -31,25 +33,23 @@ class PureFtpd < Formula
plist_path.chmod 0644
end
- def caveats
- <<-EOS.undent
+ def caveats; <<-EOS.undent
If this is your first install, automatically load on login with:
- mkdir -p ~/Library/LaunchAgents
- cp #{plist_path} ~/Library/LaunchAgents/
- launchctl load -w ~/Library/LaunchAgents/#{plist_path.basename}
+ mkdir -p ~/Library/LaunchAgents
+ cp #{plist_path} ~/Library/LaunchAgents/
+ launchctl load -w ~/Library/LaunchAgents/#{plist_path.basename}
If this is an upgrade and you already have the #{plist_path.basename} loaded:
- launchctl unload -w ~/Library/LaunchAgents/#{plist_path.basename}
- cp #{plist_path} ~/Library/LaunchAgents/
- launchctl load -w ~/Library/LaunchAgents/#{plist_path.basename}
+ launchctl unload -w ~/Library/LaunchAgents/#{plist_path.basename}
+ cp #{plist_path} ~/Library/LaunchAgents/
+ launchctl load -w ~/Library/LaunchAgents/#{plist_path.basename}
- To start pure-ftpd manually:
- pure-ftpd <options>
+ To start pure-ftpd manually:
+ pure-ftpd <options>
EOS
end
- def startup_plist
- return <<-EOPLIST
+ def startup_plist; <<-EOPLIST
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
diff --git a/Library/Formula/signing-party.rb b/Library/Formula/signing-party.rb
index bef945bbf..3e97774f7 100644
--- a/Library/Formula/signing-party.rb
+++ b/Library/Formula/signing-party.rb
@@ -5,7 +5,7 @@ class SigningParty < Formula
url 'http://ftp.debian.org/debian/pool/main/s/signing-party/signing-party_1.1.4.orig.tar.gz'
md5 '675f8f1edd01baa8b58a743927d13750'
- depends_on 'gnupg' unless system "/usr/bin/which -s gpg"
+ depends_on 'gnupg' unless which 'gpg'
depends_on 'dialog'
depends_on 'qprint'
depends_on 'MIME::Tools' => :perl
diff --git a/Library/Formula/skytools.rb b/Library/Formula/skytools.rb
index 63aae8851..34572dec5 100644
--- a/Library/Formula/skytools.rb
+++ b/Library/Formula/skytools.rb
@@ -6,7 +6,7 @@ class Skytools < Formula
md5 '94f3391d5b3c3ac6c2edcbfbda705573'
def install
- unless `/usr/bin/which pg_config`.size > 0
+ unless which 'pg_config'
opoo "No pg_config was detected."
puts <<-EOS.undent
pg_top requires postgresql in order to compile, but pg_config was not
diff --git a/Library/Formula/sphinx.rb b/Library/Formula/sphinx.rb
index bf585b80f..1dcd7b20b 100644
--- a/Library/Formula/sphinx.rb
+++ b/Library/Formula/sphinx.rb
@@ -9,10 +9,11 @@ class Libstemmer < Formula
end
class Sphinx < Formula
+ homepage 'http://www.sphinxsearch.com'
url 'http://sphinxsearch.com/files/sphinx-2.0.3-release.tar.gz'
version '2.0.3'
- homepage 'http://www.sphinxsearch.com'
md5 'a1293aecd5034aa797811610beb7ba89'
+
head 'http://sphinxsearch.googlecode.com/svn/trunk/'
fails_with_llvm "ld: rel32 out of range in _GetPrivateProfileString from /usr/lib/libodbc.a(SQLGetPrivateProfileString.o)",
@@ -20,8 +21,7 @@ class Sphinx < Formula
def install
lstem = Pathname.pwd+'libstemmer_c'
- lstem.mkpath
- Libstemmer.new.brew { mv Dir['*'], lstem }
+ Libstemmer.new.brew { lstem.install Dir['*'] }
args = ["--prefix=#{prefix}",
"--disable-debug",
@@ -32,15 +32,14 @@ class Sphinx < Formula
args << "--with-libstemmer"
# configure script won't auto-select PostgreSQL
- args << "--with-pgsql" if `/usr/bin/which pg_config`.size > 0
- args << "--without-mysql" unless `/usr/bin/which mysql`.size > 0
+ args << "--with-pgsql" if which 'pg_config'
+ args << "--without-mysql" unless which 'mysql'
system "./configure", *args
system "make install"
end
- def caveats
- <<-EOS.undent
+ def caveats; <<-EOS.undent
Sphinx has been compiled with libstemmer support.
Sphinx depends on either MySQL or PostreSQL as a datasource.