aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorjanv2012-03-20 23:24:55 +0100
committerAdam Vandenberg2012-03-20 19:24:58 -0700
commit54f1837d237b2c1b09d96815bd8a990ac1c951e5 (patch)
treef6c7830dbd518b252a1d3c2fa956353a667d8e72 /Library
parent975459a75cc371d97ec381ed3ffa2aa2733d9f1f (diff)
downloadbrew-54f1837d237b2c1b09d96815bd8a990ac1c951e5.tar.bz2
Generate unique patch filenames
Closes Homebrew/homebrew#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