Revert "Merge pull request #7316 from bayandin/fix-bump-revision"

This reverts commit a7fdc7046f5cda8743591040117e409cd24dae76, reversing
changes made to bfa175d118112989b24908ea16c5a97c1dd011e4.
This commit is contained in:
Alexander Bayandin 2020-04-26 15:11:31 +01:00
parent bdc7ebf3c7
commit 7ba0f34f72

View File

@ -42,14 +42,7 @@ 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 hash_type
old = if stable_block_given
# insert replacement revision before stable block
<<~EOS
stable do
EOS
elsif hash_type
# insert replacement revision after hash # insert replacement revision after hash
<<~EOS <<~EOS
#{hash_type} "#{old_hash}" #{hash_type} "#{old_hash}"
@ -60,12 +53,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}"