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
|
# dylibs have multiple symlinks and we don't care about them
|
||||||
(pnn.extname == ".dylib" || pnn.extname == ".pc") && !pnn.symlink?
|
(pnn.extname == ".dylib" || pnn.extname == ".pc") && !pnn.symlink?
|
||||||
end
|
end
|
||||||
|
when ".brew"
|
||||||
|
# Ignore .brew
|
||||||
else
|
else
|
||||||
if pn.directory?
|
if pn.directory?
|
||||||
if pn.symlink?
|
if pn.symlink?
|
||||||
|
|||||||
@ -259,6 +259,12 @@ class FormulaInstaller
|
|||||||
compute_and_install_dependencies if not_pouring && !ignore_deps?
|
compute_and_install_dependencies if not_pouring && !ignore_deps?
|
||||||
build
|
build
|
||||||
clean
|
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
|
end
|
||||||
|
|
||||||
build_bottle_postinstall if build_bottle?
|
build_bottle_postinstall if build_bottle?
|
||||||
|
|||||||
@ -58,6 +58,7 @@ class InstallTests < Homebrew::TestCase
|
|||||||
bin = HOMEBREW_PREFIX+"bin"
|
bin = HOMEBREW_PREFIX+"bin"
|
||||||
assert_predicate bin, :directory?
|
assert_predicate bin, :directory?
|
||||||
assert_equal 3, bin.children.length
|
assert_equal 3, bin.children.length
|
||||||
|
assert_predicate f.prefix/".brew/testball.rb", :readable?
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user