aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorilovezfs2016-07-06 05:00:45 -0700
committerilovezfs2016-09-27 02:46:08 -0700
commita9a62972bdce95a2b94db1be2e732480d88e17eb (patch)
tree5339f8534d74eded772fbc52b24ec2a1c758300d /Library
parent19df03219bfedaf29f1ed92c6b0b26e757163197 (diff)
downloadbrew-a9a62972bdce95a2b94db1be2e732480d88e17eb.tar.bz2
bump-formula-pr: handle explicit version DSL
--version=1.2.3 option to set `version "1.2.3"` Note that --version=0 will remove a no-longer-needed explicit version
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/dev-cmd/bump-formula-pr.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/Library/Homebrew/dev-cmd/bump-formula-pr.rb b/Library/Homebrew/dev-cmd/bump-formula-pr.rb
index b67b48730..2d89d85e8 100644
--- a/Library/Homebrew/dev-cmd/bump-formula-pr.rb
+++ b/Library/Homebrew/dev-cmd/bump-formula-pr.rb
@@ -101,6 +101,7 @@ module Homebrew
new_tag = ARGV.value("tag")
new_revision = ARGV.value("revision")
new_mirror = ARGV.value("mirror")
+ forced_version = ARGV.value("version")
new_url_hash = if new_url && new_hash
true
elsif new_tag && new_revision
@@ -155,6 +156,11 @@ module Homebrew
replacement_pairs << [/^( +)(url \"#{new_url}\"\n)/m, "\\1\\2\\1mirror \"#{new_mirror}\"\n"]
end
+ if forced_version && forced_version != "0"
+ replacement_pairs << [old_formula_version, forced_version]
+ elsif forced_version && forced_version == "0"
+ replacement_pairs << [/^ version \"[a-z\d+\.]+\"\n/m, ""]
+ end
new_contents = inreplace_pairs(formula.path, replacement_pairs)
new_formula_version = formula_version(formula, requested_spec, new_contents)