diff --git a/.gitignore b/.gitignore index 4787e8518ae5..72820f508b17 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,4 @@ .DS_Store /*/ -!/Cellar/ -!/Formula/ -/Cellar/*/ -!/Cellar/homebrew/ \ No newline at end of file +!/Library/ +!/bin/brew \ No newline at end of file diff --git a/Formula/ack.rb b/Library/Formula/ack.rb similarity index 100% rename from Formula/ack.rb rename to Library/Formula/ack.rb diff --git a/Formula/asciidoc.rb b/Library/Formula/asciidoc.rb similarity index 100% rename from Formula/asciidoc.rb rename to Library/Formula/asciidoc.rb diff --git a/Formula/boost.rb b/Library/Formula/boost.rb similarity index 100% rename from Formula/boost.rb rename to Library/Formula/boost.rb diff --git a/Formula/cmake.rb b/Library/Formula/cmake.rb similarity index 100% rename from Formula/cmake.rb rename to Library/Formula/cmake.rb diff --git a/Formula/dmd.rb b/Library/Formula/dmd.rb similarity index 100% rename from Formula/dmd.rb rename to Library/Formula/dmd.rb diff --git a/Formula/fftw.rb b/Library/Formula/fftw.rb similarity index 100% rename from Formula/fftw.rb rename to Library/Formula/fftw.rb diff --git a/Formula/git.rb b/Library/Formula/git.rb similarity index 100% rename from Formula/git.rb rename to Library/Formula/git.rb index 0f0620f407eb..56cf84e95a6b 100644 --- a/Formula/git.rb +++ b/Library/Formula/git.rb @@ -11,10 +11,10 @@ class Git > ~/.profile + brew grc --profile >> ~/.profile EOS end diff --git a/Formula/lame.rb b/Library/Formula/lame.rb similarity index 100% rename from Formula/lame.rb rename to Library/Formula/lame.rb diff --git a/Formula/liblastfm.rb b/Library/Formula/liblastfm.rb similarity index 77% rename from Formula/liblastfm.rb rename to Library/Formula/liblastfm.rb index 5d1999172b8f..6f2b6a3751a4 100644 --- a/Formula/liblastfm.rb +++ b/Library/Formula/liblastfm.rb @@ -2,8 +2,8 @@ class Liblastfm -# Licensed as per the GPL version 3 +# Copyright 2009 Max Howell +# +# 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 . + require 'pathname' require 'osx/cocoa' # to get number of cores +require "#{File.dirname __FILE__}/env" HOMEBREW_VERSION='0.1' @@ -181,36 +197,28 @@ def brew FileUtils.rm_rf tmp if tmp FileUtils.rm tgz if tgz and not self.cache? end - - ohai 'Finishing up' - - begin - prefix - rescue RuntimeError - # you can have packages that aren't for installing, see git - # this is a HACK though, and dirty, and not right - return - end - - prefix.find do |path| - if path==prefix #rubysucks - next - elsif path.file? - if path.extname == '.la' - path.unlink - else - fo=`file -h #{path}` - args=nil - args='-SxX' if fo =~ /Mach-O dynamically linked shared library/ - args='' if fo =~ /Mach-O executable/ #defaults strip everything - if args - puts "Stripping: #{path}" if ARGV.include? '--verbose' - `strip #{args} #{path}` - end + end + end + + def clean + prefix.find do |path| + if path==prefix #rubysucks + next + elsif path.file? + if path.extname == '.la' + path.unlink + else + fo=`file -h #{path}` + args=nil + args='-SxX' if fo =~ /Mach-O dynamically linked shared library/ + args='' if fo =~ /Mach-O executable/ #defaults strip everything + if args + puts "Stripping: #{path}" if ARGV.include? '--verbose' + `strip #{args} #{path}` end - elsif path.directory? and path!=prefix+'bin' and path!=prefix+'lib' - Find.prune end + elsif path.directory? and path!=prefix+'bin' and path!=prefix+'lib' + Find.prune end end end diff --git a/Library/Homebrew/env.rb b/Library/Homebrew/env.rb new file mode 100644 index 000000000000..e1beac1c178b --- /dev/null +++ b/Library/Homebrew/env.rb @@ -0,0 +1,22 @@ +# Copyright 2009 Max Howell +# +# 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 . + +require 'pathname' + +$root=Pathname.new(__FILE__).dirname.parent.parent.realpath +$formula=$root+'Library'+'Formula' +$cellar=$root+'Cellar' \ No newline at end of file diff --git a/Cellar/homebrew/unittest.rb b/Library/Homebrew/unittest.rb similarity index 92% rename from Cellar/homebrew/unittest.rb rename to Library/Homebrew/unittest.rb index 1982faefc126..5ec8f0e5de81 100755 --- a/Cellar/homebrew/unittest.rb +++ b/Library/Homebrew/unittest.rb @@ -1,11 +1,6 @@ #!/usr/bin/ruby -$:.unshift File.dirname(__FILE__) -require 'pathname' -$root=Pathname.new(__FILE__).realpath.dirname.parent.parent -$cellar=$root+'Cellar' -require 'brewkit' require 'test/unit' - +require "#{__FILE__}/../brewkit" class TestFormula -# Licensed as per the GPL version 3 + require 'find' require 'pathname' -$:.unshift "#{File.dirname __FILE__}/../Cellar/homebrew" -$root=Pathname.new(__FILE__).realpath.dirname.parent.parent -$formula=$root+'Formula' -$cellar=$root+'Cellar' +$:.unshift Pathname.new(__FILE__).dirname.parent.realpath+'Library'+'Homebrew' +require 'env' def prune n=0 @@ -14,7 +11,7 @@ def prune $root.find do |path| if path.directory? name=path.relative_path_from($root).to_s - if name == '.git' or name == 'Cellar' or name == 'Formula' + if name == '.git' or name == 'Cellar' or name == 'Library/Homebrew' or name == 'Library/Formula' Find.prune else dirs<