Merge pull request #10318 from SeekingMeaning/patch-legacy-cleanup
patch: delete legacy code
This commit is contained in:
commit
053ca17b50
@ -29,25 +29,6 @@ module Patch
|
|||||||
raise ArgumentError, "unexpected value #{strip.inspect} for strip"
|
raise ArgumentError, "unexpected value #{strip.inspect} for strip"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.normalize_legacy_patches(list)
|
|
||||||
patches = []
|
|
||||||
|
|
||||||
case list
|
|
||||||
when Hash
|
|
||||||
list
|
|
||||||
when Array, String, :DATA
|
|
||||||
{ p1: list }
|
|
||||||
else
|
|
||||||
{}
|
|
||||||
end.each_pair do |strip, urls|
|
|
||||||
Array(urls).each do
|
|
||||||
patches << DATAPatch.new(strip)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
patches
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# An abstract class representing a patch embedded into a formula.
|
# An abstract class representing a patch embedded into a formula.
|
||||||
|
@ -227,13 +227,6 @@ class SoftwareSpec
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# TODO: ?
|
|
||||||
def add_legacy_patches(list)
|
|
||||||
list = Patch.normalize_legacy_patches(list)
|
|
||||||
list.each { |p| p.owner = self }
|
|
||||||
patches.concat(list)
|
|
||||||
end
|
|
||||||
|
|
||||||
def add_dep_option(dep)
|
def add_dep_option(dep)
|
||||||
dep.option_names.each do |name|
|
dep.option_names.each do |name|
|
||||||
if dep.optional? && !option_defined?("with-#{name}")
|
if dep.optional? && !option_defined?("with-#{name}")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user