aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorjanv2012-03-20 23:24:55 +0100
committerAdam Vandenberg2012-03-20 19:24:58 -0700
commit84e2a7f596c35034ac5ad533038abb950f46c4ae (patch)
treecfd8528f69c8c1a5e4fe13748a3ddf2a95032cbb /Library
parent65cea5e9bbdb0a7808176fa55af79983e8bc57e1 (diff)
downloadhomebrew-84e2a7f596c35034ac5ad533038abb950f46c4ae.tar.bz2
Generate unique patch filenames
Closes #11098. Signed-off-by: Adam Vandenberg <flangy@gmail.com>
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/patches.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/Library/Homebrew/patches.rb b/Library/Homebrew/patches.rb
index 34a59cf2b..ee96450ed 100644
--- a/Library/Homebrew/patches.rb
+++ b/Library/Homebrew/patches.rb
@@ -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