From 393a97f868b3747e2abe5176af7d3f6fd657b842 Mon Sep 17 00:00:00 2001 From: Michael Cho Date: Sat, 16 Mar 2024 13:55:19 -0400 Subject: [PATCH] utils/pypi: allow overwriting resource patches Signed-off-by: Michael Cho --- Library/Homebrew/utils/pypi.rb | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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