From 5e25b08fe4b67c08ca2c36d21c7d6dd138618ac2 Mon Sep 17 00:00:00 2001 From: bigbes Date: Mon, 11 Jan 2016 00:26:48 +0700 Subject: [PATCH] bottle: merging problem when head conatins commas If `head` sections contains commas (e.g. `url "https://github.com/tarantool/tarantool.git", :branch => "1.6", :shallow => false`) then re thinks that it reached the end and inserts `bottle do <-> end` block before it, that leads to problems in ` brew audit --devel tarantool --strict --online`: ``` ==> audit problems tarantool: * `head` (line 11) should be put before `bottle block` (line 7) ``` It blocks Homebrew/homebrew#47495 Closes Homebrew/homebrew#47931. Signed-off-by: Dominyk Tiller --- Library/Homebrew/cmd/bottle.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Library/Homebrew/cmd/bottle.rb b/Library/Homebrew/cmd/bottle.rb index 83f1147c52..c2ea0941d7 100644 --- a/Library/Homebrew/cmd/bottle.rb +++ b/Library/Homebrew/cmd/bottle.rb @@ -371,15 +371,15 @@ module Homebrew else string = s.sub!( /( - \ {2}( # two spaces at the beginning - url\ ['"][\S\ ]+['"] # url with a string + \ {2}( # two spaces at the beginning + (url|head)\ ['"][\S\ ]+['"] # url or head with a string ( - ,[\S\ ]*$ # url may have options - (\n^\ {3}[\S\ ]+$)* # options can be in multiple lines + ,[\S\ ]*$ # url may have options + (\n^\ {3}[\S\ ]+$)* # options can be in multiple lines )?| - (homepage|desc|sha1|sha256|head|version|mirror)\ ['"][\S\ ]+['"]| # specs with a string - revision\ \d+ # revision with a number - )\n+ # multiple empty lines + (homepage|desc|sha1|sha256|version|mirror)\ ['"][\S\ ]+['"]| # specs with a string + revision\ \d+ # revision with a number + )\n+ # multiple empty lines )+ /mx, '\0' + output + "\n") end