aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXu Cheng2015-06-07 16:44:03 +0800
committerXu Cheng2015-06-07 20:33:25 +0800
commit3c418cfb4eaa5eeafb3613172954c01aca831af1 (patch)
treea21fa553076eb5c390751de66d624e12fc022a8b
parentf8efea0cf3ffbd5aa3a71a12a177cf0dd7bed130 (diff)
downloadbrew-3c418cfb4eaa5eeafb3613172954c01aca831af1.tar.bz2
bottle: add homepage and desc into regex
Some formulae put `desc` field behind `url` which can make bottle block go to strange place. So let's add `homepage` and `desc` into bottle regex. Closes Homebrew/homebrew#40469. Signed-off-by: Xu Cheng <xucheng@me.com>
-rw-r--r--Library/Homebrew/cmd/bottle.rb25
1 files changed, 13 insertions, 12 deletions
diff --git a/Library/Homebrew/cmd/bottle.rb b/Library/Homebrew/cmd/bottle.rb
index 966b13721..6d721b1aa 100644
--- a/Library/Homebrew/cmd/bottle.rb
+++ b/Library/Homebrew/cmd/bottle.rb
@@ -250,18 +250,19 @@ module Homebrew
indent = s.slice(/^ +stable do/).length - "stable do".length
string = s.sub!(/^ {#{indent}}stable do(.|\n)+?^ {#{indent}}end\n/m, '\0' + output + "\n")
else
- string = s.sub!(/(
- \ {2}( # two spaces at the beginning
- url\ ['"][\S\ ]+['"] # url with a string
- (
- ,[\S\ ]*$ # url may have options
- (\n^\ {3}[\S\ ]+$)* # options can be in multiple lines
- )?|
- (sha1|sha256|head|version|mirror)\ ['"][\S\ ]+['"]| # specs with a string
- revision\ \d+ # revision with a number
- )\n+ # multiple empty lines
- )+
- /mx, '\0' + output + "\n")
+ string = s.sub!(
+ /(
+ \ {2}( # two spaces at the beginning
+ url\ ['"][\S\ ]+['"] # url with a string
+ (
+ ,[\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
+ )+
+ /mx, '\0' + output + "\n")
end
odie 'Bottle block addition failed!' unless string
end