aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/dev-cmd
diff options
context:
space:
mode:
authorZhiming Wang2016-12-22 00:54:08 -0500
committerZhiming Wang2016-12-22 00:54:08 -0500
commit3ebd7df62d0b05a8a010bec74793cc4e688a2fc8 (patch)
tree219301881c35be5b6d8b41f5b81f80666179a4fe /Library/Homebrew/dev-cmd
parent8f85eb64c4875fed514150dec755cb267a96df74 (diff)
downloadbrew-3ebd7df62d0b05a8a010bec74793cc4e688a2fc8.tar.bz2
bump-formula-pr: fix removal of old mirrors
Previously, old mirrors are only removed if the requested spec is stable, and if the mirror lines only have two leading spaces. This leads to stale mirror line(s) when the formula a stable block like stable do url "http://example.com/v1.0.tar.gz" mirror "http://example.net/v1.0.tar.gz" end where the mirror line is lead by four spaces. In this commit, we discard the /(^ mirror .*\n)?/ pattern, and instead create a pattern with the exact url and flexible leading spaces for each mirror of the requested spec.
Diffstat (limited to 'Library/Homebrew/dev-cmd')
-rw-r--r--Library/Homebrew/dev-cmd/bump-formula-pr.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/Library/Homebrew/dev-cmd/bump-formula-pr.rb b/Library/Homebrew/dev-cmd/bump-formula-pr.rb
index b1f851b8d..8fdbd97b6 100644
--- a/Library/Homebrew/dev-cmd/bump-formula-pr.rb
+++ b/Library/Homebrew/dev-cmd/bump-formula-pr.rb
@@ -156,7 +156,9 @@ module Homebrew
replacement_pairs << [/^ revision \d+\n(\n( head "))?/m, "\\2"]
end
- replacement_pairs << [/(^ mirror .*\n)?/, ""] if requested_spec == :stable
+ replacement_pairs += formula_spec.mirrors.map do |mirror|
+ [/ +mirror \"#{mirror}\"\n/m, ""]
+ end
replacement_pairs += if new_url_hash
[