Merge pull request #1052 from sjackman/store-formula
Store the formula used to build the keg in the keg
This commit is contained in:
commit
98e7fb6b60
@ -140,6 +140,8 @@ class PrettyListing
|
||||
# dylibs have multiple symlinks and we don't care about them
|
||||
(pnn.extname == ".dylib" || pnn.extname == ".pc") && !pnn.symlink?
|
||||
end
|
||||
when ".brew"
|
||||
# Ignore .brew
|
||||
else
|
||||
if pn.directory?
|
||||
if pn.symlink?
|
||||
|
||||
@ -259,6 +259,12 @@ class FormulaInstaller
|
||||
compute_and_install_dependencies if not_pouring && !ignore_deps?
|
||||
build
|
||||
clean
|
||||
|
||||
# Store the formula used to build the keg in the keg.
|
||||
s = formula.path.read.gsub(/ bottle do.+?end\n\n?/m, "")
|
||||
brew_prefix = formula.prefix/".brew"
|
||||
brew_prefix.mkdir
|
||||
Pathname(brew_prefix/"#{formula.name}.rb").atomic_write(s)
|
||||
end
|
||||
|
||||
build_bottle_postinstall if build_bottle?
|
||||
|
||||
@ -58,6 +58,7 @@ class InstallTests < Homebrew::TestCase
|
||||
bin = HOMEBREW_PREFIX+"bin"
|
||||
assert_predicate bin, :directory?
|
||||
assert_equal 3, bin.children.length
|
||||
assert_predicate f.prefix/".brew/testball.rb", :readable?
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user