Generate unique patch filenames

Closes Homebrew/homebrew#11098.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
This commit is contained in:
janv 2012-03-20 23:24:55 +01:00 committed by Adam Vandenberg
parent 975459a75c
commit 54f1837d23

View File

@ -3,13 +3,14 @@ class Patches
def initialize patches
@patches = []
return if patches.nil?
n = 0
normalize_patches(patches).each do |patch_p, urls|
# Wrap the urls list in an array if it isn't already;
# DATA.each does each line, which doesn't work so great
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)
n += 1
end
end
end