Skip to content
Snippets Groups Projects
Commit 98e7fb6b authored by Mike McQuaid's avatar Mike McQuaid Committed by GitHub
Browse files

Merge pull request #1052 from sjackman/store-formula

Store the formula used to build the keg in the keg
parents c64ce3ef 25df0c03
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment