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
|
||||
stage do |staging|
|
||||
staging.retain! if Homebrew.args.keep_tmp?
|
||||
|
||||
prepare_patches
|
||||
fetch_patches if fetch
|
||||
|
||||
begin
|
||||
@ -2082,14 +2084,16 @@ class Formula
|
||||
end
|
||||
|
||||
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)
|
||||
end
|
||||
|
||||
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.
|
||||
# @private
|
||||
def versioned_prefix(v)
|
||||
|
@ -74,14 +74,18 @@ class Resource
|
||||
def stage(target = nil, &block)
|
||||
raise ArgumentError, "target directory or block is required" if target.blank? && block.blank?
|
||||
|
||||
prepare_patches
|
||||
fetch_patches(skip_downloaded: true)
|
||||
fetch unless downloaded?
|
||||
|
||||
unpack(target, &block)
|
||||
end
|
||||
|
||||
def fetch_patches(skip_downloaded: false)
|
||||
def prepare_patches
|
||||
patches.grep(DATAPatch) { |p| p.path = owner.owner.path }
|
||||
end
|
||||
|
||||
def fetch_patches(skip_downloaded: false)
|
||||
patches.select!(&:external?)
|
||||
patches.reject!(&:downloaded?) if skip_downloaded
|
||||
patches.each(&:fetch)
|
||||
|
Loading…
x
Reference in New Issue
Block a user