Switch back to monkey-patching
Also gsub! some particular formula contents to work around older
formulae ("brewkit" isn't around anymore, and url is expected to
be a method, not an instance variable).
This commit is contained in:
parent
95abdf9662
commit
260867627b
@ -15,20 +15,19 @@ require "utils/git"
|
|||||||
require "formulary"
|
require "formulary"
|
||||||
require "tap"
|
require "tap"
|
||||||
|
|
||||||
module ExtractExtensions
|
class BottleSpecification
|
||||||
refine BottleSpecification do
|
|
||||||
def method_missing(m, *_args, &_block)
|
def method_missing(m, *_args, &_block)
|
||||||
# no-op
|
# no-op
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
refine Module do
|
class Module
|
||||||
def method_missing(m, *_args, &_block)
|
def method_missing(m, *_args, &_block)
|
||||||
# no-op
|
# no-op
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
refine DependencyCollector do
|
class DependencyCollector
|
||||||
def parse_symbol_spec(spec, tags)
|
def parse_symbol_spec(spec, tags)
|
||||||
case spec
|
case spec
|
||||||
when :x11 then X11Requirement.new(spec.to_s, tags)
|
when :x11 then X11Requirement.new(spec.to_s, tags)
|
||||||
@ -45,15 +44,17 @@ module ExtractExtensions
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
module Compat
|
||||||
def parse_string_spec(spec, tags)
|
def parse_string_spec(spec, tags)
|
||||||
opoo "'depends_on ... => :run' is disabled. There is no replacement." if tags.include?(:run) && ARGV.debug?
|
opoo "'depends_on ... => :run' is disabled. There is no replacement." if tags.include?(:run) && ARGV.debug?
|
||||||
super
|
super
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
prepend Compat
|
||||||
end
|
end
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
using ExtractExtensions
|
|
||||||
module_function
|
module_function
|
||||||
|
|
||||||
def extract
|
def extract
|
||||||
@ -124,6 +125,8 @@ module Homebrew
|
|||||||
def formula_at_revision(repo, name, file, rev)
|
def formula_at_revision(repo, name, file, rev)
|
||||||
return if rev.empty?
|
return if rev.empty?
|
||||||
contents = Git.last_revision_of_file(repo, file, before_commit: rev)
|
contents = Git.last_revision_of_file(repo, file, before_commit: rev)
|
||||||
|
contents.gsub!("@url=", "url ")
|
||||||
|
contents.gsub!("require 'brewkit'", "require 'formula'")
|
||||||
Formulary.from_contents(name, file, contents)
|
Formulary.from_contents(name, file, contents)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user