aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMike McQuaid2013-10-31 19:03:23 -0700
committerMike McQuaid2013-10-31 19:03:31 -0700
commitfd254c3874ad949af9ad3d6510611a31ebc9bc47 (patch)
tree7f174fe7ab6f79aae9aea241a42d25da733c0c7c /Library
parent3f489e1eed73584b7a7b7ca175f945102a9f4f0e (diff)
downloadbrew-fd254c3874ad949af9ad3d6510611a31ebc9bc47.tar.bz2
bottle: improve written bottle output.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/bottle.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/Library/Homebrew/cmd/bottle.rb b/Library/Homebrew/cmd/bottle.rb
index 3927d84da..69ae64000 100644
--- a/Library/Homebrew/cmd/bottle.rb
+++ b/Library/Homebrew/cmd/bottle.rb
@@ -200,15 +200,16 @@ module Homebrew extend self
else
formula_path = HOMEBREW_REPOSITORY+formula_relative_path
end
+ has_bottle_block = f.class.send(:bottle).checksums.any?
inreplace formula_path do |s|
- if f.bottle
- s.gsub!(/ bottle do.+?end\n/m, output)
+ if has_bottle_block
+ s.sub!(/ bottle do.+?end\n/m, output)
else
- s.gsub!(/( (url|sha1|head|version) '\S*'\n+)+/m, '\0' + output + "\n")
+ s.sub!(/( (url|sha1|head|version) '\S*'\n+)+/m, '\0' + output + "\n")
end
end
- update_or_add = f.bottle.nil? ? 'add' : 'update'
+ update_or_add = has_bottle_block ? 'update' : 'add'
safe_system 'git', 'commit', formula_path, '-m',
"#{f.name}: #{update_or_add} bottle."