forked from Homebrew/legacy-homebrew
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Created /Library moved brew tool to /bin
Moved Forumla and Cellar/homebrew into Library. This way the homebrew core files are more sensibly placed, Cellar is more internally consistent and only generated. And Homebrew is ready for use straight out of the tarball.
- Loading branch information
Showing
26 changed files
with
81 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
.DS_Store | ||
/*/ | ||
!/Cellar/ | ||
!/Formula/ | ||
/Cellar/*/ | ||
!/Cellar/homebrew/ | ||
!/Library/ | ||
!/bin/brew |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,23 @@ | ||
# Copyright 2009 Max Howell <[email protected]> | ||
# Licensed as per the GPL version 3 | ||
# Copyright 2009 Max Howell <[email protected]> | ||
# | ||
# 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/>. | ||
|
||
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Copyright 2009 Max Howell <[email protected]> | ||
# | ||
# 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/>. | ||
|
||
require 'pathname' | ||
|
||
$root=Pathname.new(__FILE__).dirname.parent.parent.realpath | ||
$formula=$root+'Library'+'Formula' | ||
$cellar=$root+'Cellar' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,17 @@ | ||
#!/usr/bin/ruby | ||
# Copyright 2009 Max Howell <[email protected]> | ||
# 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 | ||
dirs=Array.new | ||
$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<<path | ||
|
@@ -90,10 +87,10 @@ def ln name | |
raise '#{keg} is not a keg' | ||
end | ||
#TODO consider using hardlinks | ||
# yeah indeed, you have to force anything you want in the main tree into | ||
# these directories :P | ||
# yeah indeed, you have to force anything you need in the main tree into | ||
# these directories :P | ||
# NOTE that not everything needs to be in the main tree | ||
# TODO consider using hardlinks | ||
$n=0 | ||
lnd(keg, 'etc') {nil} | ||
lnd(keg, 'include') {nil} | ||
|
@@ -113,13 +110,8 @@ def ln name | |
end | ||
lnd(keg, 'share') do |path| | ||
path=path.to_s | ||
if ['man','doc','locale','info'].include? path | ||
:mkpath | ||
else | ||
mans=(1..9).collect {|x| "man/man#{x}"} | ||
:mkpath if mans.include? path | ||
end | ||
includes=(1..9).collect {|x| "man/man#{x}"} <<'man'<<'doc'<<'locale'<<'info' | ||
:mkpath if includes.include? path.to_s | ||
end | ||
return $n | ||
|
@@ -219,6 +211,8 @@ begin | |
o=__obj(name) | ||
raise "#{o.prefix} already exists!" if o.prefix.exist? | ||
o.brew { o.install } | ||
ohai 'Finishing up' | ||
o.clean | ||
ln name | ||
puts "#{o.prefix}: "+`find #{o.prefix} -type f | wc -l`.strip+ | ||
' files, '+ | ||
|