2009-06-04 19:21:19 +01:00
|
|
|
# Copyright 2009 Max Howell <max@methylblue.com>
|
|
|
|
#
|
|
|
|
# This file is part of Homebrew.
|
|
|
|
#
|
|
|
|
# Homebrew is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# Homebrew is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with Homebrew. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
2009-05-21 02:24:45 +01:00
|
|
|
require 'pathname'
|
2009-06-03 19:17:41 +01:00
|
|
|
require 'osx/cocoa' # to get number of cores
|
2009-06-05 12:57:37 +01:00
|
|
|
require 'env'
|
2009-05-21 02:24:45 +01:00
|
|
|
|
2009-05-22 00:14:57 +01:00
|
|
|
# optimise all the way to eleven, references:
|
|
|
|
# http://en.gentoo-wiki.com/wiki/Safe_Cflags/Intel
|
|
|
|
# http://forums.mozillazine.org/viewtopic.php?f=12&t=577299
|
|
|
|
# http://gcc.gnu.org/onlinedocs/gcc-4.0.1/gcc/i386-and-x86_002d64-Options.html
|
2009-05-21 01:28:11 +01:00
|
|
|
ENV['MACOSX_DEPLOYMENT_TARGET']='10.5'
|
2009-05-22 00:14:57 +01:00
|
|
|
ENV['CFLAGS']=ENV['CXXFLAGS']='-O3 -w -pipe -fomit-frame-pointer -march=prescott'
|
|
|
|
|
|
|
|
# lets use gcc 4.2, it is newer and "better", at least I believe so, mail me
|
|
|
|
# if I'm wrong
|
|
|
|
ENV['CC']='gcc-4.2'
|
|
|
|
ENV['CXX']='g++-4.2'
|
2009-06-03 19:17:41 +01:00
|
|
|
ENV['MAKEFLAGS']="-j#{OSX::NSProcessInfo.processInfo.processorCount}"
|
2009-05-22 00:14:57 +01:00
|
|
|
|
2009-06-02 13:39:39 +01:00
|
|
|
unless $root.to_s == '/usr/local'
|
|
|
|
ENV['CPPFLAGS']='-I'+$root+'include'
|
|
|
|
ENV['LDFLAGS']='-L'+$root+'lib'
|
2009-05-23 16:38:28 +01:00
|
|
|
end
|
2009-05-21 04:35:36 +01:00
|
|
|
|
2009-05-21 01:28:11 +01:00
|
|
|
|
2009-05-21 17:50:57 +01:00
|
|
|
def ohai title
|
2009-05-23 18:15:58 +01:00
|
|
|
n=`tput cols`.strip.to_i-4
|
|
|
|
puts "\033[0;34m==>\033[0;0;1m #{title[0,n]}\033[0;0m"
|
2009-05-21 02:24:45 +01:00
|
|
|
end
|
|
|
|
|
2009-06-28 17:35:04 +01:00
|
|
|
def cache
|
|
|
|
cache=File.expand_path "~/Library/Caches/Homebrew"
|
|
|
|
FileUtils.mkpath cache
|
|
|
|
return cache
|
2009-05-25 11:58:26 +01:00
|
|
|
end
|
2009-05-21 02:24:45 +01:00
|
|
|
|
2009-06-08 11:42:28 +01:00
|
|
|
class BuildError <RuntimeError
|
|
|
|
def initialize cmd
|
|
|
|
super "Build failed during: #{cmd}"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
# pass in the basename of the filename _without_ any file extension
|
|
|
|
def extract_version basename
|
2009-06-08 15:57:24 +01:00
|
|
|
# eg. boost_1_39_0
|
|
|
|
/((\d+_)+\d+)$/.match basename
|
|
|
|
return $1.gsub('_', '.') if $1
|
|
|
|
|
|
|
|
# eg. foobar-4.5.1-1
|
|
|
|
/-((\d+\.)*\d+-\d+)$/.match basename
|
|
|
|
return $1 if $1
|
|
|
|
|
2009-06-08 11:42:28 +01:00
|
|
|
# eg. foobar-4.5.1
|
2009-06-08 15:57:24 +01:00
|
|
|
/-((\d+\.)*\d+)$/.match basename
|
2009-06-08 11:42:28 +01:00
|
|
|
return $1 if $1
|
|
|
|
|
2009-06-08 15:57:24 +01:00
|
|
|
# eg. foobar-4.5.1b
|
2009-06-18 09:52:38 +01:00
|
|
|
/-((\d+\.)*\d+([abc]|rc\d))$/.match basename
|
2009-06-08 15:57:24 +01:00
|
|
|
return $1 if $1
|
2009-06-08 11:42:28 +01:00
|
|
|
|
2009-07-10 03:11:05 +01:00
|
|
|
# eg foobar-4.5.0-beta1
|
|
|
|
/-((\d+\.)*\d+-beta\d+)$/.match basename
|
|
|
|
return $1 if $1
|
|
|
|
|
2009-06-08 15:57:24 +01:00
|
|
|
# eg. foobar4.5.1
|
|
|
|
/((\d+\.)*\d+)$/.match basename
|
|
|
|
return $1 if $1
|
|
|
|
|
2009-06-15 00:54:58 +01:00
|
|
|
# eg. otp_src_R13B (this is erlang's style)
|
|
|
|
# eg. astyle_1.23_macosx.tar.gz
|
|
|
|
basename.scan /_([^_]+)/ do |match|
|
|
|
|
return match.first if /\d/.match $1
|
|
|
|
end
|
2009-06-08 11:42:28 +01:00
|
|
|
end
|
|
|
|
|
2009-06-02 13:39:39 +01:00
|
|
|
|
|
|
|
# make our code neater
|
|
|
|
class Pathname
|
2009-06-18 09:49:13 +01:00
|
|
|
def mv dst
|
2009-06-02 13:39:39 +01:00
|
|
|
FileUtils.mv to_s, dst
|
|
|
|
end
|
2009-06-18 09:49:13 +01:00
|
|
|
|
|
|
|
def rename dst
|
|
|
|
dst=Pathname.new dst
|
|
|
|
dst.unlink if dst.exist?
|
|
|
|
mv dst
|
|
|
|
end
|
2009-06-08 15:57:58 +01:00
|
|
|
|
2009-06-15 00:55:18 +01:00
|
|
|
def install src
|
2009-07-23 01:14:22 +01:00
|
|
|
if src.is_a? Array
|
|
|
|
src.each {|src| install src }
|
|
|
|
elsif File.exist? src
|
2009-06-26 13:05:48 +01:00
|
|
|
mkpath
|
2009-07-23 01:14:22 +01:00
|
|
|
if File.symlink? src
|
|
|
|
# we cp symlinks because FileUtils.mv is shit and won't mv a symlink
|
|
|
|
# if its final destination has an invalid target! FFS. Ruby is shit.
|
|
|
|
FileUtils.cp src, to_s
|
|
|
|
else
|
|
|
|
# we mv when possible as it is faster and you should only be using
|
|
|
|
# this function when installing from the temporary build directory
|
|
|
|
FileUtils.mv src, to_s
|
|
|
|
end
|
2009-06-26 13:05:48 +01:00
|
|
|
end
|
2009-06-08 15:57:58 +01:00
|
|
|
end
|
|
|
|
|
2009-06-02 13:39:39 +01:00
|
|
|
def cp dst
|
|
|
|
if file?
|
|
|
|
FileUtils.cp to_s, dst
|
|
|
|
else
|
|
|
|
FileUtils.cp_r to_s, dst
|
|
|
|
end
|
|
|
|
end
|
2009-06-08 11:42:28 +01:00
|
|
|
|
2009-07-23 01:14:22 +01:00
|
|
|
# for filetypes we support
|
2009-06-08 11:42:28 +01:00
|
|
|
def extname
|
|
|
|
/\.(zip|tar\.(gz|bz2)|tgz)$/.match to_s
|
|
|
|
return ".#{$1}" if $1
|
|
|
|
return File.extname(to_s)
|
|
|
|
end
|
|
|
|
|
2009-07-23 01:14:22 +01:00
|
|
|
# for filetypes we support, basename without extension
|
2009-06-08 11:42:28 +01:00
|
|
|
def stem
|
|
|
|
return File.basename(to_s, extname)
|
|
|
|
end
|
2009-06-02 13:39:39 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
|
2009-06-05 23:39:56 +01:00
|
|
|
# the base class variety of formula, you don't get a prefix, so it's not really
|
|
|
|
# useful. See the derived classes for fun and games.
|
|
|
|
class AbstractFormula
|
2009-05-21 03:26:44 +01:00
|
|
|
require 'find'
|
|
|
|
require 'fileutils'
|
2009-05-21 12:40:40 +01:00
|
|
|
|
2009-06-02 13:39:39 +01:00
|
|
|
# fuck knows, ruby is weird
|
2009-06-05 23:39:56 +01:00
|
|
|
# TODO please fix!
|
2009-06-02 13:39:39 +01:00
|
|
|
def self.url
|
|
|
|
@url
|
|
|
|
end
|
|
|
|
def url
|
|
|
|
self.class.url
|
|
|
|
end
|
|
|
|
def self.md5
|
|
|
|
@md5
|
|
|
|
end
|
|
|
|
def md5
|
|
|
|
self.class.md5
|
|
|
|
end
|
|
|
|
def self.homepage
|
|
|
|
@homepage
|
|
|
|
end
|
|
|
|
def homepage
|
|
|
|
self.class.homepage
|
|
|
|
end
|
|
|
|
# end ruby is weird section
|
|
|
|
|
2009-06-05 23:39:56 +01:00
|
|
|
def version
|
|
|
|
@version
|
|
|
|
end
|
|
|
|
def name
|
|
|
|
@name
|
|
|
|
end
|
|
|
|
|
|
|
|
def initialize name=nil
|
|
|
|
@name=name
|
2009-06-02 13:39:39 +01:00
|
|
|
# fuck knows, ruby is weird
|
|
|
|
@url=url if @url.nil?
|
|
|
|
raise "@url.nil?" if @url.nil?
|
|
|
|
@md5=md5 if @md5.nil?
|
|
|
|
# end ruby is weird section
|
2009-06-05 23:39:56 +01:00
|
|
|
end
|
2009-05-21 00:04:43 +01:00
|
|
|
|
2009-06-02 13:39:39 +01:00
|
|
|
public
|
|
|
|
def prefix
|
|
|
|
raise "@name.nil!" if @name.nil?
|
2009-05-21 00:04:43 +01:00
|
|
|
raise "@version.nil?" if @version.nil?
|
2009-06-02 13:39:39 +01:00
|
|
|
$cellar+@name+@version
|
|
|
|
end
|
|
|
|
def bin
|
2009-06-26 13:05:48 +01:00
|
|
|
prefix+'bin'
|
2009-06-02 13:39:39 +01:00
|
|
|
end
|
|
|
|
def doc
|
2009-06-26 13:05:48 +01:00
|
|
|
prefix+'share'+'doc'+name
|
2009-06-02 13:39:39 +01:00
|
|
|
end
|
|
|
|
def man
|
2009-06-26 13:05:48 +01:00
|
|
|
prefix+'share'+'man'
|
2009-06-02 13:39:39 +01:00
|
|
|
end
|
2009-06-08 15:58:52 +01:00
|
|
|
def man1
|
2009-06-26 13:05:48 +01:00
|
|
|
prefix+'share'+'man'+'man1'
|
2009-06-08 15:58:52 +01:00
|
|
|
end
|
2009-06-02 13:39:39 +01:00
|
|
|
def lib
|
2009-06-26 13:05:48 +01:00
|
|
|
prefix+'lib'
|
2009-06-02 13:39:39 +01:00
|
|
|
end
|
|
|
|
def include
|
2009-06-26 13:05:48 +01:00
|
|
|
prefix+'include'
|
2009-06-02 13:39:39 +01:00
|
|
|
end
|
2009-05-21 12:40:40 +01:00
|
|
|
|
2009-06-02 13:39:39 +01:00
|
|
|
def caveats
|
|
|
|
nil
|
|
|
|
end
|
2009-05-21 03:26:44 +01:00
|
|
|
|
2009-06-05 23:39:56 +01:00
|
|
|
# yields self with current working directory set to the uncompressed tarball
|
2009-06-02 13:39:39 +01:00
|
|
|
def brew
|
2009-05-23 13:07:19 +01:00
|
|
|
ohai "Downloading #{@url}"
|
2009-06-28 17:35:04 +01:00
|
|
|
Dir.chdir cache do
|
2009-06-08 11:43:28 +01:00
|
|
|
tmp=tgz=nil
|
2009-05-21 00:04:43 +01:00
|
|
|
begin
|
2009-06-08 11:43:28 +01:00
|
|
|
tgz=Pathname.new(fetch()).realpath
|
|
|
|
md5=`md5 -q "#{tgz}"`.strip
|
|
|
|
raise "MD5 mismatch: #{md5}" unless @md5 and md5 == @md5.downcase
|
|
|
|
|
|
|
|
# we make an additional subdirectory so know exactly what we are
|
|
|
|
# recursively deleting later
|
|
|
|
# we use mktemp rather than appsupport/blah because some build scripts
|
|
|
|
# can't handle being built in a directory with spaces in it :P
|
2009-06-02 13:39:39 +01:00
|
|
|
tmp=`mktemp -dt #{File.basename @url}`.strip
|
2009-05-21 00:04:43 +01:00
|
|
|
Dir.chdir tmp do
|
|
|
|
Dir.chdir uncompress(tgz) do
|
2009-06-02 13:39:39 +01:00
|
|
|
yield self
|
2009-05-21 00:04:43 +01:00
|
|
|
end
|
|
|
|
end
|
2009-06-08 11:43:28 +01:00
|
|
|
rescue Interrupt, RuntimeError
|
|
|
|
if ARGV.include? '--debug'
|
2009-05-21 17:54:31 +01:00
|
|
|
# debug mode allows the packager to intercept a failed build and
|
|
|
|
# investigate the problems
|
|
|
|
puts "Rescued build at: #{tmp}"
|
|
|
|
exit! 1
|
|
|
|
else
|
|
|
|
raise
|
|
|
|
end
|
2009-05-21 00:04:43 +01:00
|
|
|
ensure
|
2009-05-25 11:56:30 +01:00
|
|
|
FileUtils.rm_rf tmp if tmp
|
2009-05-21 00:04:43 +01:00
|
|
|
end
|
2009-06-04 19:21:19 +01:00
|
|
|
end
|
|
|
|
end
|
2009-06-08 11:44:04 +01:00
|
|
|
|
2009-06-04 19:21:19 +01:00
|
|
|
def clean
|
2009-07-22 20:28:42 +01:00
|
|
|
#TODO strip libexec too
|
2009-06-08 11:44:04 +01:00
|
|
|
[bin,lib].each {|path| path.find do |path|
|
|
|
|
if not path.file?
|
2009-06-04 19:21:19 +01:00
|
|
|
next
|
2009-06-08 11:44:04 +01:00
|
|
|
elsif path.extname == '.la'
|
|
|
|
# .la files are stupid
|
|
|
|
path.unlink
|
|
|
|
else
|
|
|
|
fo=`file -h #{path}`
|
|
|
|
args=nil
|
2009-07-22 20:28:42 +01:00
|
|
|
perms=0444
|
2009-07-10 00:36:16 +01:00
|
|
|
if fo =~ /Mach-O dynamically linked shared library/
|
|
|
|
args='-SxX'
|
|
|
|
elsif fo =~ /Mach-O executable/ # defaults strip everything
|
2009-06-26 13:05:48 +01:00
|
|
|
args='' # still do the strip
|
2009-07-22 20:28:42 +01:00
|
|
|
perms=0544
|
2009-07-10 00:36:16 +01:00
|
|
|
elsif fo =~ /script text executable/
|
2009-07-22 20:28:42 +01:00
|
|
|
perms=0544
|
2009-06-26 13:05:48 +01:00
|
|
|
end
|
2009-06-08 11:44:04 +01:00
|
|
|
if args
|
|
|
|
puts "Stripping: #{path}" if ARGV.include? '--verbose'
|
2009-06-26 13:05:48 +01:00
|
|
|
path.chmod 0644 # so we can strip
|
2009-07-22 20:28:42 +01:00
|
|
|
unless path.stat.nlink > 1
|
|
|
|
`strip #{args} #{path}`
|
|
|
|
else
|
|
|
|
# strip unlinks the file and recreates it, thus breaking hard links!
|
|
|
|
# is this expected behaviour? patch does it too… still,mktm this fixes it
|
|
|
|
tmp=`mktemp -t #{path.basename}`.strip
|
|
|
|
`strip -o #{tmp} #{path}`
|
|
|
|
`cat #{tmp} > #{path}`
|
|
|
|
File.unlink tmp
|
|
|
|
end
|
2009-05-23 13:07:19 +01:00
|
|
|
end
|
2009-07-22 20:28:42 +01:00
|
|
|
path.chmod perms
|
2009-05-23 13:07:19 +01:00
|
|
|
end
|
2009-06-08 11:44:04 +01:00
|
|
|
end}
|
2009-06-26 13:05:48 +01:00
|
|
|
|
|
|
|
# remove empty directories
|
|
|
|
`perl -MFile::Find -e"finddepth(sub{rmdir},'#{prefix}')"`
|
2009-05-21 00:04:43 +01:00
|
|
|
end
|
|
|
|
|
2009-06-05 23:39:56 +01:00
|
|
|
protected
|
|
|
|
def uncompress path
|
|
|
|
path.dirname
|
2009-05-21 00:04:43 +01:00
|
|
|
end
|
|
|
|
|
2009-06-05 23:39:56 +01:00
|
|
|
private
|
2009-05-21 00:04:43 +01:00
|
|
|
def fetch
|
2009-05-22 19:45:52 +01:00
|
|
|
%r[http://(www.)?github.com/.*/(zip|tar)ball/].match @url
|
|
|
|
if $2
|
|
|
|
# curl doesn't do the redirect magic that we would like, so we get a
|
|
|
|
# stupidly named file, this is why wget would be beter, but oh well
|
|
|
|
tgz="#{@name}-#{@version}.#{$2=='tar' ? 'tgz' : $2}"
|
|
|
|
oarg="-o #{tgz}"
|
|
|
|
else
|
|
|
|
oarg='-O' #use the filename that curl gets
|
|
|
|
tgz=File.expand_path File.basename(@url)
|
|
|
|
end
|
|
|
|
|
2009-06-02 13:39:39 +01:00
|
|
|
agent="Homebrew #{HOMEBREW_VERSION} (Ruby #{VERSION}; Mac OS X 10.5 Leopard)"
|
|
|
|
|
2009-05-21 04:36:53 +01:00
|
|
|
unless File.exists? tgz
|
2009-06-02 13:39:39 +01:00
|
|
|
`curl -#LA "#{agent}" #{oarg} "#{@url}"`
|
2009-05-21 04:36:53 +01:00
|
|
|
raise "Download failed" unless $? == 0
|
2009-05-23 13:07:19 +01:00
|
|
|
else
|
|
|
|
puts "File already downloaded and cached"
|
2009-05-21 04:36:53 +01:00
|
|
|
end
|
2009-05-21 00:04:43 +01:00
|
|
|
return tgz
|
|
|
|
end
|
|
|
|
|
2009-06-05 23:39:56 +01:00
|
|
|
def method_added method
|
|
|
|
raise 'You cannot override Formula.brew' if method == 'brew'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
# somewhat useful, it'll raise if you call prefix, but it'll unpack a tar/zip
|
|
|
|
# for you, check the md5, and allow you to yield from brew
|
|
|
|
class UnidentifiedFormula <AbstractFormula
|
|
|
|
def initialize name=nil
|
|
|
|
super name
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
2009-05-21 00:04:43 +01:00
|
|
|
def uncompress(path)
|
|
|
|
if path.extname == '.zip'
|
|
|
|
`unzip -qq "#{path}"`
|
|
|
|
else
|
|
|
|
`tar xf "#{path}"`
|
|
|
|
end
|
|
|
|
|
|
|
|
raise "Compression tool failed" if $? != 0
|
|
|
|
|
|
|
|
entries=Dir['*']
|
2009-06-02 13:39:39 +01:00
|
|
|
if entries.nil? or entries.length == 0
|
|
|
|
raise "Empty tarball!"
|
|
|
|
elsif entries.length == 1
|
|
|
|
# if one dir enter it as that will be where the build is
|
|
|
|
entries.first
|
|
|
|
else
|
|
|
|
# if there's more than one dir, then this is the build directory already
|
|
|
|
Dir.pwd
|
|
|
|
end
|
2009-06-05 23:39:56 +01:00
|
|
|
end
|
|
|
|
end
|
2009-05-21 00:04:43 +01:00
|
|
|
|
2009-06-05 23:39:56 +01:00
|
|
|
# this is what you will mostly use, reimplement install, prefix won't raise
|
|
|
|
class Formula <UnidentifiedFormula
|
|
|
|
def initialize name
|
|
|
|
super name
|
2009-06-26 13:05:48 +01:00
|
|
|
@version=extract_version Pathname.new(File.basename(@url)).stem unless @version
|
2009-05-21 00:04:43 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2009-06-02 13:39:39 +01:00
|
|
|
# see ack.rb for an example usage
|
2009-06-05 23:39:56 +01:00
|
|
|
class ScriptFileFormula <AbstractFormula
|
2009-06-02 13:39:39 +01:00
|
|
|
def install
|
2009-07-23 04:12:25 +01:00
|
|
|
bin.install name
|
2009-06-02 13:39:39 +01:00
|
|
|
end
|
2009-05-23 12:31:32 +01:00
|
|
|
end
|
|
|
|
|
2009-06-05 23:39:56 +01:00
|
|
|
class GithubGistFormula <ScriptFileFormula
|
2009-06-05 12:57:37 +01:00
|
|
|
def initialize
|
2009-06-05 23:39:56 +01:00
|
|
|
super File.basename(url)
|
2009-05-23 13:07:19 +01:00
|
|
|
@version=File.basename(File.dirname(url))[0,6]
|
2009-05-23 12:35:12 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2009-05-21 00:04:43 +01:00
|
|
|
def inreplace(path, before, after)
|
2009-05-22 14:02:11 +01:00
|
|
|
before=before.to_s.gsub('"', '\"').gsub('/', '\/')
|
|
|
|
after=after.to_s.gsub('"', '\"').gsub('/', '\/')
|
2009-05-22 00:15:28 +01:00
|
|
|
|
2009-05-21 00:04:43 +01:00
|
|
|
# we're not using Ruby because the perl script is more concise
|
2009-05-22 00:15:28 +01:00
|
|
|
#TODO the above escapes are worse, use a proper ruby script :P
|
|
|
|
#TODO optimise it by taking before and after as arrays
|
|
|
|
#Bah, just make the script writers do it themselves with a standard collect block
|
2009-05-22 14:02:11 +01:00
|
|
|
#TODO use ed -- less to escape
|
|
|
|
`perl -pi -e "s/#{before}/#{after}/g" "#{path}"`
|
2009-05-21 00:04:43 +01:00
|
|
|
end
|
|
|
|
|
2009-05-21 02:24:45 +01:00
|
|
|
def system cmd
|
2009-05-21 17:50:57 +01:00
|
|
|
ohai cmd
|
2009-05-21 02:24:45 +01:00
|
|
|
|
|
|
|
out=''
|
2009-05-23 16:39:23 +01:00
|
|
|
IO.popen("#{cmd} 2>&1") do |f|
|
2009-05-21 02:24:45 +01:00
|
|
|
until f.eof?
|
|
|
|
s=f.gets
|
2009-06-08 11:42:28 +01:00
|
|
|
if ARGV.include? '--verbose'
|
|
|
|
puts s
|
|
|
|
else
|
|
|
|
out+=s
|
|
|
|
end
|
2009-05-21 02:24:45 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
unless $? == 0
|
|
|
|
puts out unless ARGV.include? '--verbose' #already did that above
|
2009-06-08 11:42:28 +01:00
|
|
|
raise BuildError.new(cmd)
|
2009-05-21 02:24:45 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2009-06-05 12:57:37 +01:00
|
|
|
####################################################################### script
|
2009-05-21 00:04:43 +01:00
|
|
|
if $0 == __FILE__
|
|
|
|
d=$cellar.parent+'bin'
|
|
|
|
d.mkpath unless d.exist?
|
2009-05-23 16:39:51 +01:00
|
|
|
Dir.chdir d
|
|
|
|
Pathname.new('brew').make_symlink Pathname.new('../Cellar')+'homebrew'+'brew'
|
2009-05-21 00:04:43 +01:00
|
|
|
end
|