Store the formula used to build the keg in the keg
Store the formula used to build the keg inside the keg in a file named NAME/VERSION/.brew/NAME.rb after removing the bottle do ... end block. See https://github.com/Homebrew/brew-evolution/pull/6. Closes https://github.com/Homebrew/brew/issues/931.
This commit is contained in:
parent
12aad5c65f
commit
25df0c03d6
@ -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?
|
||||||
|
@ -260,6 +260,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