Merge pull request #7563 from MikeMcQuaid/prepare_patches
Split out prepare_patches and fetch_patches methods.
This commit is contained in:
commit
390778f2a5
@ -1165,6 +1165,8 @@ class Formula
|
|||||||
active_spec.fetch if fetch
|
active_spec.fetch if fetch
|
||||||
stage do |staging|
|
stage do |staging|
|
||||||
staging.retain! if Homebrew.args.keep_tmp?
|
staging.retain! if Homebrew.args.keep_tmp?
|
||||||
|
|
||||||
|
prepare_patches
|
||||||
fetch_patches if fetch
|
fetch_patches if fetch
|
||||||
|
|
||||||
begin
|
begin
|
||||||
@ -2082,14 +2084,16 @@ class Formula
|
|||||||
end
|
end
|
||||||
|
|
||||||
def fetch_patches
|
def fetch_patches
|
||||||
active_spec.add_legacy_patches(patches) if respond_to?(:patches)
|
|
||||||
|
|
||||||
patchlist.grep(DATAPatch) { |p| p.path = path }
|
|
||||||
patchlist.select(&:external?).each(&:fetch)
|
patchlist.select(&:external?).each(&:fetch)
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
def prepare_patches
|
||||||
|
active_spec.add_legacy_patches(patches) if respond_to?(:patches)
|
||||||
|
patchlist.grep(DATAPatch) { |p| p.path = path }
|
||||||
|
end
|
||||||
|
|
||||||
# Returns the prefix for a given formula version number.
|
# Returns the prefix for a given formula version number.
|
||||||
# @private
|
# @private
|
||||||
def versioned_prefix(v)
|
def versioned_prefix(v)
|
||||||
|
@ -74,14 +74,18 @@ class Resource
|
|||||||
def stage(target = nil, &block)
|
def stage(target = nil, &block)
|
||||||
raise ArgumentError, "target directory or block is required" if target.blank? && block.blank?
|
raise ArgumentError, "target directory or block is required" if target.blank? && block.blank?
|
||||||
|
|
||||||
|
prepare_patches
|
||||||
fetch_patches(skip_downloaded: true)
|
fetch_patches(skip_downloaded: true)
|
||||||
fetch unless downloaded?
|
fetch unless downloaded?
|
||||||
|
|
||||||
unpack(target, &block)
|
unpack(target, &block)
|
||||||
end
|
end
|
||||||
|
|
||||||
def fetch_patches(skip_downloaded: false)
|
def prepare_patches
|
||||||
patches.grep(DATAPatch) { |p| p.path = owner.owner.path }
|
patches.grep(DATAPatch) { |p| p.path = owner.owner.path }
|
||||||
|
end
|
||||||
|
|
||||||
|
def fetch_patches(skip_downloaded: false)
|
||||||
patches.select!(&:external?)
|
patches.select!(&:external?)
|
||||||
patches.reject!(&:downloaded?) if skip_downloaded
|
patches.reject!(&:downloaded?) if skip_downloaded
|
||||||
patches.each(&:fetch)
|
patches.each(&:fetch)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user