Generate unique patch filenames
Closes Homebrew/homebrew#11098. Signed-off-by: Adam Vandenberg <flangy@gmail.com>
This commit is contained in:
parent
975459a75c
commit
54f1837d23
@ -3,13 +3,14 @@ class Patches
|
|||||||
def initialize patches
|
def initialize patches
|
||||||
@patches = []
|
@patches = []
|
||||||
return if patches.nil?
|
return if patches.nil?
|
||||||
|
n = 0
|
||||||
normalize_patches(patches).each do |patch_p, urls|
|
normalize_patches(patches).each do |patch_p, urls|
|
||||||
# Wrap the urls list in an array if it isn't already;
|
# Wrap the urls list in an array if it isn't already;
|
||||||
# DATA.each does each line, which doesn't work so great
|
# DATA.each does each line, which doesn't work so great
|
||||||
urls = [urls] unless urls.kind_of? Array
|
urls = [urls] unless urls.kind_of? Array
|
||||||
urls.each_with_index do |url, n|
|
urls.each do |url|
|
||||||
@patches << Patch.new(patch_p, '%03d-homebrew.diff' % n, url)
|
@patches << Patch.new(patch_p, '%03d-homebrew.diff' % n, url)
|
||||||
|
n += 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user