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
 | 
			
		||||
    @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
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user