Handle missing receipt on brew install
.
For example if this is for a really old keg, keg where a user has manually removed stuff or used `brew diy`.
This commit is contained in:
parent
081461a268
commit
879b3360d3
@ -194,9 +194,11 @@ module Homebrew
|
|||||||
next unless f.opt_prefix.directory?
|
next unless f.opt_prefix.directory?
|
||||||
keg = Keg.new(f.opt_prefix.resolved_path)
|
keg = Keg.new(f.opt_prefix.resolved_path)
|
||||||
tab = Tab.for_keg(keg)
|
tab = Tab.for_keg(keg)
|
||||||
|
unless tab.installed_on_request
|
||||||
tab.installed_on_request = true
|
tab.installed_on_request = true
|
||||||
tab.write
|
tab.write
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
perform_preinstall_checks
|
perform_preinstall_checks
|
||||||
|
|
||||||
|
@ -100,11 +100,14 @@ class Tab < OpenStruct
|
|||||||
def self.for_keg(keg)
|
def self.for_keg(keg)
|
||||||
path = keg.join(FILENAME)
|
path = keg.join(FILENAME)
|
||||||
|
|
||||||
if path.exist?
|
tab = if path.exist?
|
||||||
from_file(path)
|
from_file(path)
|
||||||
else
|
else
|
||||||
empty
|
empty
|
||||||
end
|
end
|
||||||
|
|
||||||
|
tab["tabfile"] = path
|
||||||
|
tab
|
||||||
end
|
end
|
||||||
|
|
||||||
# Returns a tab for the named formula's installation,
|
# Returns a tab for the named formula's installation,
|
||||||
|
@ -258,7 +258,7 @@ describe Tab do
|
|||||||
it "can create a Tab for a non-existant Keg" do
|
it "can create a Tab for a non-existant Keg" do
|
||||||
f.prefix.mkpath
|
f.prefix.mkpath
|
||||||
|
|
||||||
expect(subject.tabfile).to be nil
|
expect(subject.tabfile).to eq(f_tab_path)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user