diff --git a/Library/Homebrew/utils/pypi.rb b/Library/Homebrew/utils/pypi.rb index 673f6dc765..bef4322792 100644 --- a/Library/Homebrew/utils/pypi.rb +++ b/Library/Homebrew/utils/pypi.rb @@ -370,7 +370,18 @@ module PyPI new_resource_blocks += " def install" else # Replace existing resource blocks with new resource blocks - inreplace_regex = / (resource .* do\s+url .*\s+sha256 .*\s+ end\s*)+/ + inreplace_regex = / + \ \ ( + resource\ .*\ do\s+ + url\ .*\s+ + sha256\ .*\s+ + ((\#.*\s+)* + patch\ (.*\ )?do\s+ + url\ .*\s+ + sha256\ .*\s+ + end\s+)* + end\s+)+ + /x new_resource_blocks += " " end