utils/pypi: allow overwriting resource patches

Signed-off-by: Michael Cho <michael@michaelcho.dev>
This commit is contained in:
Michael Cho 2024-03-16 13:55:19 -04:00
parent bb753a6c48
commit 393a97f868
No known key found for this signature in database
GPG Key ID: 55E85E28A7CD1E85

View File

@ -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