From 7a5a8baac523c68435bc163ebfa76f46a617adbb Mon Sep 17 00:00:00 2001 From: Seeker Date: Wed, 13 Jan 2021 18:36:20 -0800 Subject: [PATCH] patch: delete legacy code SoftwareSpec#add_legacy_patches and Patch#normalize_legacy_patches were added almost 6 years ago; let's delete them See commit 665b14c4a44c272b46b8559836e9fdbeee5d8a46 ``` $ grep -r 'normalize_legacy_patches' Library/Homebrew ./software_spec.rb: list = Patch.normalize_legacy_patches(list) ./patch.rb: def self.normalize_legacy_patches(list) ``` ``` $ grep -r 'add_legacy_patches' Library/Homebrew ./software_spec.rb: def add_legacy_patches(list) ``` --- Library/Homebrew/patch.rb | 19 ------------------- Library/Homebrew/software_spec.rb | 7 ------- 2 files changed, 26 deletions(-) diff --git a/Library/Homebrew/patch.rb b/Library/Homebrew/patch.rb index ebdbe3a19d..cb242aa0c7 100644 --- a/Library/Homebrew/patch.rb +++ b/Library/Homebrew/patch.rb @@ -29,25 +29,6 @@ module Patch raise ArgumentError, "unexpected value #{strip.inspect} for strip" 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 # An abstract class representing a patch embedded into a formula. diff --git a/Library/Homebrew/software_spec.rb b/Library/Homebrew/software_spec.rb index 8c7917c3e9..b8af355ccc 100644 --- a/Library/Homebrew/software_spec.rb +++ b/Library/Homebrew/software_spec.rb @@ -227,13 +227,6 @@ class SoftwareSpec 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) dep.option_names.each do |name| if dep.optional? && !option_defined?("with-#{name}")