Merge pull request #7441 from bayandin/bump-revision-stable-do
bump-revision: re-apply proper fix for handling stable block
This commit is contained in:
commit
8c681d836b
@ -42,12 +42,10 @@ module Homebrew
|
|||||||
[checksum.hash_type, checksum.hexdigest]
|
[checksum.hash_type, checksum.hexdigest]
|
||||||
end
|
end
|
||||||
|
|
||||||
stable_block_given = formula.path.read.include? " stable do"
|
old = if formula.path.read.include?("stable do\n")
|
||||||
|
# insert replacement revision after homepage
|
||||||
old = if stable_block_given
|
|
||||||
# insert replacement revision before stable block
|
|
||||||
<<~EOS
|
<<~EOS
|
||||||
stable do
|
homepage "#{formula.homepage}"
|
||||||
EOS
|
EOS
|
||||||
elsif hash_type
|
elsif hash_type
|
||||||
# insert replacement revision after hash
|
# insert replacement revision after hash
|
||||||
@ -60,12 +58,8 @@ module Homebrew
|
|||||||
:revision => "#{formula_spec.specs[:revision]}"
|
:revision => "#{formula_spec.specs[:revision]}"
|
||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
|
replacement = old + " revision 1\n"
|
||||||
|
|
||||||
replacement = if stable_block_given
|
|
||||||
"revision 1\n " + old
|
|
||||||
else
|
|
||||||
old + " revision 1\n"
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
old = "revision #{current_revision}"
|
old = "revision #{current_revision}"
|
||||||
replacement = "revision #{current_revision+1}"
|
replacement = "revision #{current_revision+1}"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user