aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/formula_installer.rb
diff options
context:
space:
mode:
authorMike McQuaid2016-10-01 12:24:19 +0100
committerGitHub2016-10-01 12:24:19 +0100
commit98e7fb6b60c9463bd7d259bb16a00244e95bbc82 (patch)
treebe0bf046e744132aac612780fdc847e310ea0060 /Library/Homebrew/formula_installer.rb
parentc64ce3ef07dbbba79f311c1dd928c743fc897667 (diff)
parent25df0c03d6abd79fbc103f3be9df38d48bd4f938 (diff)
downloadbrew-98e7fb6b60c9463bd7d259bb16a00244e95bbc82.tar.bz2
Merge pull request #1052 from sjackman/store-formula
Store the formula used to build the keg in the keg
Diffstat (limited to 'Library/Homebrew/formula_installer.rb')
-rw-r--r--Library/Homebrew/formula_installer.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb
index 3738c3784..652f87ae3 100644
--- a/Library/Homebrew/formula_installer.rb
+++ b/Library/Homebrew/formula_installer.rb
@@ -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?